Skip to content

Commit 313b508

Browse files
authored
Add Fabric support (#410)
* Add fabric on iOS (#400) * Update podspec file for fabric * Define codegen spec & move import to separate file * Add codegenConfig in package.json * Update podspec to detect .mm files * Change spec types to floats * Implement fabric component with props updating * Re-order functions, add accessibilityIncrements prop * Clean up imports, remove comment * Sort out props updating, remove unused functions * Add event handling * Add tapToSeek implementation * Fix tapToSeek * Handle images using bridge * Add missing typedef * Verify the build for new arch with GH Actions * Save new-arch Pods under new-arch cache key * Use Podfile.lock with old arch and regenerate for new one * Correct path for new arch Podfile.lock creation * Disable flipper in Podfile * Install pods with new arch flag * Fix tapToSeek on iOS * Allow value property to be controlled * Generate project.pbxproj for new arch * Separate npm & pods step in CI * Change step names, fix cache keys * Remove pods cache * Run npm install if cache was not found * Run build using xcodebuild * Fix: Pods-related error after using Pods from cache (#407) * Bring back Pods to cache * Use new-arch string in key for new arch cache * Try to reinstall pods instead of creating new * Separate deps installation between two caches * Rename Pods reinstall step * Remove explicit folly version, default to old arch * Add clean scripts in example for codegen cleanup * Change CI step names * Remove isFabricEnabled This check is no longer needed. Co-authored-by: BartoszKlonowski <[email protected]> * Add fabric on Android (#402) * Configure build.gradle * Update libraryName on android * Create ReactSlider shared implementation * Split implementations into oldarch and newarch * Dispatch events * Cleanup eventDispatcher * Make oldarch implementation use shared code * Add defaults to js spec * Clean up newarch ReactSliderManager * Reorder props to fix disabled state * Handle TestID setter * Move ReactSliderShadowNode to shared implementation * Share getExportedCustomDirectEventTypeConstants * Remove comments, add empty line
1 parent 18297cd commit 313b508

File tree

18 files changed

+1043
-503
lines changed

18 files changed

+1043
-503
lines changed

.github/workflows/ReactNativeSlider-CI.yml

Lines changed: 84 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060

6161

6262
verify:
63-
name: Verify the Example app sources
63+
name: Verify example app sources
6464
runs-on: ubuntu-latest
6565

6666
steps:
@@ -75,7 +75,7 @@ jobs:
7575

7676

7777
build-android-app:
78-
name: Verify the package and example app builds for Android platform
78+
name: Build example app Android
7979
runs-on: ubuntu-latest
8080
needs: [verify]
8181

@@ -95,7 +95,7 @@ jobs:
9595

9696

9797
build-iOS-app:
98-
name: Verify the package and example app builds for iOS platform
98+
name: Build example app iOS
9999
runs-on: macos-latest
100100
needs: [verify]
101101
steps:
@@ -105,33 +105,101 @@ jobs:
105105
id: cache-npm
106106
uses: actions/cache@v3
107107
env:
108-
cache-name: cached-ios-deps
108+
cache-name: cached-ios-npm-deps
109109
with:
110-
path: |
111-
example/node_modules
112-
example/ios/Pods
113-
key: ${{ hashFiles('./example/package-lock.json') }}-${{ hashFiles('./package/package-lock.json') }}-${{ hashFiles('./example/ios/Podfile.lock') }}
110+
path: example/node_modules
111+
key: ${{ hashFiles('./example/package-lock.json') }}-${{ hashFiles('./package/package-lock.json') }}
114112

115-
- name: Install required dependencies on cache miss
113+
- name: Install required dependencies on cache miss (npm)
116114
if: steps.cache-npm.outputs.cache-hit != 'true'
117115
run: |
118116
npm install
119-
cd example/ios && pod install --verbose
117+
118+
- name: Cache Pods
119+
id: cache-pods
120+
uses: actions/cache@v3
121+
env:
122+
cache-name: cached-ios-pods-deps
123+
with:
124+
path: example/ios/Pods
125+
key: ${{ hashFiles('./example/ios/Podfile.lock') }}
126+
127+
- name: Install required dependencies on cache miss (Pods)
128+
if: steps.cache-pods.outputs.cache-hit != 'true'
129+
run: |
130+
cd example/ios && pod install
131+
132+
- name: Reinstall Pods only if using cached ones
133+
if: steps.cache-pods.outputs.cache-hit == 'true'
134+
run: cd example/ios && pod install
120135

121136
- name: Use the current package sources in build
122137
run: cd example && npm run refresh-package
123138

124-
- name: Opening Simulator app
125-
uses: futureware-tech/simulator-action@v1
139+
- name: Build iOS
140+
run: |
141+
device_name='iPhone 13'
142+
device=$(xcrun simctl list devices "${device_name}" available | grep "${device_name} (")
143+
re='\(([-0-9A-Fa-f]+)\)'
144+
[[ $device =~ $re ]] || exit 1
145+
xcodebuild -workspace example.xcworkspace -scheme example -destination "platform=iOS Simulator,id=${BASH_REMATCH[1]}" CODE_SIGNING_ALLOWED=NO COMPILER_INDEX_STORE_ENABLE=NO build
146+
working-directory: example/ios
147+
148+
149+
build-iOS-new-arch-app:
150+
name: Build example app iOS (Fabric)
151+
runs-on: macos-latest
152+
needs: [build-iOS-app]
153+
steps:
154+
- uses: actions/checkout@v3
155+
156+
- name: Cache node modules
157+
id: cache-npm
158+
uses: actions/cache@v3
159+
env:
160+
cache-name: cached-ios-npm-deps
161+
with:
162+
path: example/node_modules
163+
key: new-arch-${{ hashFiles('./example/package-lock.json') }}-${{ hashFiles('./package/package-lock.json') }}
164+
165+
- name: Install required dependencies on cache miss (npm)
166+
if: steps.cache-npm.outputs.cache-hit != 'true'
167+
run: |
168+
npm install
169+
170+
- name: Cache Pods
171+
id: cache-pods
172+
uses: actions/cache@v3
173+
env:
174+
cache-name: cached-ios-pods-deps
126175
with:
127-
model: 'iPhone 12 mini'
176+
path: example/ios/Pods
177+
key: new-arch-${{ hashFiles('./example/ios/Podfile.lock') }}
178+
179+
- name: Install required dependencies on cache miss (Pods)
180+
if: steps.cache-pods.outputs.cache-hit != 'true'
181+
run: |
182+
cd example/ios && RCT_NEW_ARCH_ENABLED=1 pod install
183+
184+
- name: Reinstall Pods only if using cached ones
185+
if: steps.cache-pods.outputs.cache-hit == 'true'
186+
run: cd example/ios && RCT_NEW_ARCH_ENABLED=1 pod install
128187

129-
- name: Builds the iOS app
130-
run: cd example && npx react-native run-ios
188+
- name: Use the current package sources in build
189+
run: cd example && npm run refresh-package
190+
191+
- name: Build iOS - Fabric
192+
run: |
193+
device_name='iPhone 13'
194+
device=$(xcrun simctl list devices "${device_name}" available | grep "${device_name} (")
195+
re='\(([-0-9A-Fa-f]+)\)'
196+
[[ $device =~ $re ]] || exit 1
197+
xcodebuild -workspace example.xcworkspace -scheme example -destination "platform=iOS Simulator,id=${BASH_REMATCH[1]}" CODE_SIGNING_ALLOWED=NO COMPILER_INDEX_STORE_ENABLE=NO build
198+
working-directory: example/ios
131199

132200

133201
build-Windows-app:
134-
name: Verify the package and example app builds for Windows platform
202+
name: Build example app Windows
135203
runs-on: windows-latest
136204
needs: [verify]
137205
steps:

example/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ target 'example' do
2828
#
2929
# Note that if you have use_frameworks! enabled, Flipper will not work and
3030
# you should disable the next line.
31-
use_flipper!()
31+
# use_flipper!()
3232

3333
post_install do |installer|
3434
react_native_post_install(installer)

example/ios/Podfile.lock

Lines changed: 2 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
PODS:
22
- boost (1.76.0)
3-
- CocoaAsyncSocket (7.6.5)
43
- DoubleConversion (1.1.6)
54
- FBLazyVector (0.69.1)
65
- FBReactNativeSpec (0.69.1):
@@ -10,71 +9,8 @@ PODS:
109
- React-Core (= 0.69.1)
1110
- React-jsi (= 0.69.1)
1211
- ReactCommon/turbomodule/core (= 0.69.1)
13-
- Flipper (0.125.0):
14-
- Flipper-Folly (~> 2.6)
15-
- Flipper-RSocket (~> 1.4)
16-
- Flipper-Boost-iOSX (1.76.0.1.11)
17-
- Flipper-DoubleConversion (3.2.0.1)
18-
- Flipper-Fmt (7.1.7)
19-
- Flipper-Folly (2.6.10):
20-
- Flipper-Boost-iOSX
21-
- Flipper-DoubleConversion
22-
- Flipper-Fmt (= 7.1.7)
23-
- Flipper-Glog
24-
- libevent (~> 2.1.12)
25-
- OpenSSL-Universal (= 1.1.1100)
26-
- Flipper-Glog (0.5.0.5)
27-
- Flipper-PeerTalk (0.0.4)
28-
- Flipper-RSocket (1.4.3):
29-
- Flipper-Folly (~> 2.6)
30-
- FlipperKit (0.125.0):
31-
- FlipperKit/Core (= 0.125.0)
32-
- FlipperKit/Core (0.125.0):
33-
- Flipper (~> 0.125.0)
34-
- FlipperKit/CppBridge
35-
- FlipperKit/FBCxxFollyDynamicConvert
36-
- FlipperKit/FBDefines
37-
- FlipperKit/FKPortForwarding
38-
- SocketRocket (~> 0.6.0)
39-
- FlipperKit/CppBridge (0.125.0):
40-
- Flipper (~> 0.125.0)
41-
- FlipperKit/FBCxxFollyDynamicConvert (0.125.0):
42-
- Flipper-Folly (~> 2.6)
43-
- FlipperKit/FBDefines (0.125.0)
44-
- FlipperKit/FKPortForwarding (0.125.0):
45-
- CocoaAsyncSocket (~> 7.6)
46-
- Flipper-PeerTalk (~> 0.0.4)
47-
- FlipperKit/FlipperKitHighlightOverlay (0.125.0)
48-
- FlipperKit/FlipperKitLayoutHelpers (0.125.0):
49-
- FlipperKit/Core
50-
- FlipperKit/FlipperKitHighlightOverlay
51-
- FlipperKit/FlipperKitLayoutTextSearchable
52-
- FlipperKit/FlipperKitLayoutIOSDescriptors (0.125.0):
53-
- FlipperKit/Core
54-
- FlipperKit/FlipperKitHighlightOverlay
55-
- FlipperKit/FlipperKitLayoutHelpers
56-
- YogaKit (~> 1.18)
57-
- FlipperKit/FlipperKitLayoutPlugin (0.125.0):
58-
- FlipperKit/Core
59-
- FlipperKit/FlipperKitHighlightOverlay
60-
- FlipperKit/FlipperKitLayoutHelpers
61-
- FlipperKit/FlipperKitLayoutIOSDescriptors
62-
- FlipperKit/FlipperKitLayoutTextSearchable
63-
- YogaKit (~> 1.18)
64-
- FlipperKit/FlipperKitLayoutTextSearchable (0.125.0)
65-
- FlipperKit/FlipperKitNetworkPlugin (0.125.0):
66-
- FlipperKit/Core
67-
- FlipperKit/FlipperKitReactPlugin (0.125.0):
68-
- FlipperKit/Core
69-
- FlipperKit/FlipperKitUserDefaultsPlugin (0.125.0):
70-
- FlipperKit/Core
71-
- FlipperKit/SKIOSNetworkPlugin (0.125.0):
72-
- FlipperKit/Core
73-
- FlipperKit/FlipperKitNetworkPlugin
7412
- fmt (6.2.1)
7513
- glog (0.3.5)
76-
- libevent (2.1.12)
77-
- OpenSSL-Universal (1.1.1100)
7814
- RCT-Folly (2021.06.28.00-v2):
7915
- boost
8016
- DoubleConversion
@@ -352,39 +288,14 @@ PODS:
352288
- React-jsi (= 0.69.1)
353289
- React-logger (= 0.69.1)
354290
- React-perflogger (= 0.69.1)
355-
- SocketRocket (0.6.0)
356291
- Yoga (1.14.0)
357-
- YogaKit (1.18.1):
358-
- Yoga (~> 1.14)
359292

360293
DEPENDENCIES:
361294
- boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
362295
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
363296
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
364297
- FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
365-
- Flipper (= 0.125.0)
366-
- Flipper-Boost-iOSX (= 1.76.0.1.11)
367-
- Flipper-DoubleConversion (= 3.2.0.1)
368-
- Flipper-Fmt (= 7.1.7)
369-
- Flipper-Folly (= 2.6.10)
370-
- Flipper-Glog (= 0.5.0.5)
371-
- Flipper-PeerTalk (= 0.0.4)
372-
- Flipper-RSocket (= 1.4.3)
373-
- FlipperKit (= 0.125.0)
374-
- FlipperKit/Core (= 0.125.0)
375-
- FlipperKit/CppBridge (= 0.125.0)
376-
- FlipperKit/FBCxxFollyDynamicConvert (= 0.125.0)
377-
- FlipperKit/FBDefines (= 0.125.0)
378-
- FlipperKit/FKPortForwarding (= 0.125.0)
379-
- FlipperKit/FlipperKitHighlightOverlay (= 0.125.0)
380-
- FlipperKit/FlipperKitLayoutPlugin (= 0.125.0)
381-
- FlipperKit/FlipperKitLayoutTextSearchable (= 0.125.0)
382-
- FlipperKit/FlipperKitNetworkPlugin (= 0.125.0)
383-
- FlipperKit/FlipperKitReactPlugin (= 0.125.0)
384-
- FlipperKit/FlipperKitUserDefaultsPlugin (= 0.125.0)
385-
- FlipperKit/SKIOSNetworkPlugin (= 0.125.0)
386298
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
387-
- OpenSSL-Universal (= 1.1.1100)
388299
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
389300
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
390301
- RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
@@ -418,21 +329,7 @@ DEPENDENCIES:
418329

419330
SPEC REPOS:
420331
trunk:
421-
- CocoaAsyncSocket
422-
- Flipper
423-
- Flipper-Boost-iOSX
424-
- Flipper-DoubleConversion
425-
- Flipper-Fmt
426-
- Flipper-Folly
427-
- Flipper-Glog
428-
- Flipper-PeerTalk
429-
- Flipper-RSocket
430-
- FlipperKit
431332
- fmt
432-
- libevent
433-
- OpenSSL-Universal
434-
- SocketRocket
435-
- YogaKit
436333

437334
EXTERNAL SOURCES:
438335
boost:
@@ -504,23 +401,11 @@ EXTERNAL SOURCES:
504401

505402
SPEC CHECKSUMS:
506403
boost: a7c83b31436843459a1961bfd74b96033dc77234
507-
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
508404
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
509405
FBLazyVector: 068141206af867f72854753423d0117c4bf53419
510406
FBReactNativeSpec: 546a637adc797fa436dd51d1c63c580f820de31c
511-
Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0
512-
Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c
513-
Flipper-DoubleConversion: 2dc99b02f658daf147069aad9dbd29d8feb06d30
514-
Flipper-Fmt: 60cbdd92fc254826e61d669a5d87ef7015396a9b
515-
Flipper-Folly: 584845625005ff068a6ebf41f857f468decd26b3
516-
Flipper-Glog: 70c50ce58ddaf67dc35180db05f191692570f446
517-
Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9
518-
Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541
519-
FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86
520407
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
521408
glog: 3d02b25ca00c2d456734d0bcff864cbc62f6ae1a
522-
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
523-
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
524409
RCT-Folly: b9d9fe1fc70114b751c076104e52f3b1b5e5a95a
525410
RCTRequired: ae07282b2ec9c90d7eb98251603bc3f82403d239
526411
RCTTypeSafety: a04dc1339af2e1da759ccd093bf11c310dce1ef6
@@ -535,7 +420,7 @@ SPEC CHECKSUMS:
535420
React-jsiexecutor: 758e70947c232828a66b5ddc42d02b4d010fa26e
536421
React-jsinspector: 55605caf04e02f9b0e05842b786f1c12dde08f4b
537422
React-logger: ca970551cb7eea2fd814d0d5f6fc1a471eb53b76
538-
react-native-slider: 8a61f3dfa62c859e67f545ed707e9438ada8be6c
423+
react-native-slider: 541c8579b23211cc985ac44023dd0f0d46c9f497
539424
React-perflogger: c9161ff0f1c769993cd11d2751e4331ff4ceb7cd
540425
React-RCTActionSheet: 2d885b0bea76a5254ef852939273edd8de116180
541426
React-RCTAnimation: 353fa4fc3c19060068832dd32e555182ec07be45
@@ -548,10 +433,8 @@ SPEC CHECKSUMS:
548433
React-RCTVibration: e8b7dd6635cc95689b5db643b5a3848f1e05b30b
549434
React-runtimeexecutor: 27f468c5576eaf05ffb7a907528e44c75a3fcbae
550435
ReactCommon: e30ec17dfb1d4c4f3419eac254350d6abca6d5a2
551-
SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
552436
Yoga: 7ab6e3ee4ce47d7b789d1cb520163833e515f452
553-
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
554437

555-
PODFILE CHECKSUM: ea17b1731971e714550ad4c057f8c9e4dd544466
438+
PODFILE CHECKSUM: 2bee2bd5d60bce023442613522baa9154a69716b
556439

557440
COCOAPODS: 1.11.3

0 commit comments

Comments
 (0)