Skip to content

Commit

Permalink
Add fabric on iOS (#400)
Browse files Browse the repository at this point in the history
* 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 <Bartosz.Klonowski@callstack.com>
  • Loading branch information
okwasniewski and BartoszKlonowski authored Aug 2, 2022
1 parent 18297cd commit 533db3c
Show file tree
Hide file tree
Showing 13 changed files with 478 additions and 240 deletions.
100 changes: 84 additions & 16 deletions .github/workflows/ReactNativeSlider-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:


verify:
name: Verify the Example app sources
name: Verify example app sources
runs-on: ubuntu-latest

steps:
Expand All @@ -75,7 +75,7 @@ jobs:


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

Expand All @@ -95,7 +95,7 @@ jobs:


build-iOS-app:
name: Verify the package and example app builds for iOS platform
name: Build example app iOS
runs-on: macos-latest
needs: [verify]
steps:
Expand All @@ -105,33 +105,101 @@ jobs:
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cached-ios-deps
cache-name: cached-ios-npm-deps
with:
path: |
example/node_modules
example/ios/Pods
key: ${{ hashFiles('./example/package-lock.json') }}-${{ hashFiles('./package/package-lock.json') }}-${{ hashFiles('./example/ios/Podfile.lock') }}
path: example/node_modules
key: ${{ hashFiles('./example/package-lock.json') }}-${{ hashFiles('./package/package-lock.json') }}

- name: Install required dependencies on cache miss
- name: Install required dependencies on cache miss (npm)
if: steps.cache-npm.outputs.cache-hit != 'true'
run: |
npm install
cd example/ios && pod install --verbose
- name: Cache Pods
id: cache-pods
uses: actions/cache@v3
env:
cache-name: cached-ios-pods-deps
with:
path: example/ios/Pods
key: ${{ hashFiles('./example/ios/Podfile.lock') }}

- name: Install required dependencies on cache miss (Pods)
if: steps.cache-pods.outputs.cache-hit != 'true'
run: |
cd example/ios && pod install
- name: Reinstall Pods only if using cached ones
if: steps.cache-pods.outputs.cache-hit == 'true'
run: cd example/ios && pod install

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

- name: Opening Simulator app
uses: futureware-tech/simulator-action@v1
- name: Build iOS
run: |
device_name='iPhone 13'
device=$(xcrun simctl list devices "${device_name}" available | grep "${device_name} (")
re='\(([-0-9A-Fa-f]+)\)'
[[ $device =~ $re ]] || exit 1
xcodebuild -workspace example.xcworkspace -scheme example -destination "platform=iOS Simulator,id=${BASH_REMATCH[1]}" CODE_SIGNING_ALLOWED=NO COMPILER_INDEX_STORE_ENABLE=NO build
working-directory: example/ios


build-iOS-new-arch-app:
name: Build example app iOS (Fabric)
runs-on: macos-latest
needs: [build-iOS-app]
steps:
- uses: actions/checkout@v3

- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cached-ios-npm-deps
with:
path: example/node_modules
key: new-arch-${{ hashFiles('./example/package-lock.json') }}-${{ hashFiles('./package/package-lock.json') }}

- name: Install required dependencies on cache miss (npm)
if: steps.cache-npm.outputs.cache-hit != 'true'
run: |
npm install
- name: Cache Pods
id: cache-pods
uses: actions/cache@v3
env:
cache-name: cached-ios-pods-deps
with:
model: 'iPhone 12 mini'
path: example/ios/Pods
key: new-arch-${{ hashFiles('./example/ios/Podfile.lock') }}

- name: Install required dependencies on cache miss (Pods)
if: steps.cache-pods.outputs.cache-hit != 'true'
run: |
cd example/ios && RCT_NEW_ARCH_ENABLED=1 pod install
- name: Reinstall Pods only if using cached ones
if: steps.cache-pods.outputs.cache-hit == 'true'
run: cd example/ios && RCT_NEW_ARCH_ENABLED=1 pod install

- name: Builds the iOS app
run: cd example && npx react-native run-ios
- name: Use the current package sources in build
run: cd example && npm run refresh-package

- name: Build iOS - Fabric
run: |
device_name='iPhone 13'
device=$(xcrun simctl list devices "${device_name}" available | grep "${device_name} (")
re='\(([-0-9A-Fa-f]+)\)'
[[ $device =~ $re ]] || exit 1
xcodebuild -workspace example.xcworkspace -scheme example -destination "platform=iOS Simulator,id=${BASH_REMATCH[1]}" CODE_SIGNING_ALLOWED=NO COMPILER_INDEX_STORE_ENABLE=NO build
working-directory: example/ios


build-Windows-app:
name: Verify the package and example app builds for Windows platform
name: Build example app Windows
runs-on: windows-latest
needs: [verify]
steps:
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ target 'example' do
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
use_flipper!()
# use_flipper!()

post_install do |installer|
react_native_post_install(installer)
Expand Down
121 changes: 2 additions & 119 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
PODS:
- boost (1.76.0)
- CocoaAsyncSocket (7.6.5)
- DoubleConversion (1.1.6)
- FBLazyVector (0.69.1)
- FBReactNativeSpec (0.69.1):
Expand All @@ -10,71 +9,8 @@ PODS:
- React-Core (= 0.69.1)
- React-jsi (= 0.69.1)
- ReactCommon/turbomodule/core (= 0.69.1)
- Flipper (0.125.0):
- Flipper-Folly (~> 2.6)
- Flipper-RSocket (~> 1.4)
- Flipper-Boost-iOSX (1.76.0.1.11)
- Flipper-DoubleConversion (3.2.0.1)
- Flipper-Fmt (7.1.7)
- Flipper-Folly (2.6.10):
- Flipper-Boost-iOSX
- Flipper-DoubleConversion
- Flipper-Fmt (= 7.1.7)
- Flipper-Glog
- libevent (~> 2.1.12)
- OpenSSL-Universal (= 1.1.1100)
- Flipper-Glog (0.5.0.5)
- Flipper-PeerTalk (0.0.4)
- Flipper-RSocket (1.4.3):
- Flipper-Folly (~> 2.6)
- FlipperKit (0.125.0):
- FlipperKit/Core (= 0.125.0)
- FlipperKit/Core (0.125.0):
- Flipper (~> 0.125.0)
- FlipperKit/CppBridge
- FlipperKit/FBCxxFollyDynamicConvert
- FlipperKit/FBDefines
- FlipperKit/FKPortForwarding
- SocketRocket (~> 0.6.0)
- FlipperKit/CppBridge (0.125.0):
- Flipper (~> 0.125.0)
- FlipperKit/FBCxxFollyDynamicConvert (0.125.0):
- Flipper-Folly (~> 2.6)
- FlipperKit/FBDefines (0.125.0)
- FlipperKit/FKPortForwarding (0.125.0):
- CocoaAsyncSocket (~> 7.6)
- Flipper-PeerTalk (~> 0.0.4)
- FlipperKit/FlipperKitHighlightOverlay (0.125.0)
- FlipperKit/FlipperKitLayoutHelpers (0.125.0):
- FlipperKit/Core
- FlipperKit/FlipperKitHighlightOverlay
- FlipperKit/FlipperKitLayoutTextSearchable
- FlipperKit/FlipperKitLayoutIOSDescriptors (0.125.0):
- FlipperKit/Core
- FlipperKit/FlipperKitHighlightOverlay
- FlipperKit/FlipperKitLayoutHelpers
- YogaKit (~> 1.18)
- FlipperKit/FlipperKitLayoutPlugin (0.125.0):
- FlipperKit/Core
- FlipperKit/FlipperKitHighlightOverlay
- FlipperKit/FlipperKitLayoutHelpers
- FlipperKit/FlipperKitLayoutIOSDescriptors
- FlipperKit/FlipperKitLayoutTextSearchable
- YogaKit (~> 1.18)
- FlipperKit/FlipperKitLayoutTextSearchable (0.125.0)
- FlipperKit/FlipperKitNetworkPlugin (0.125.0):
- FlipperKit/Core
- FlipperKit/FlipperKitReactPlugin (0.125.0):
- FlipperKit/Core
- FlipperKit/FlipperKitUserDefaultsPlugin (0.125.0):
- FlipperKit/Core
- FlipperKit/SKIOSNetworkPlugin (0.125.0):
- FlipperKit/Core
- FlipperKit/FlipperKitNetworkPlugin
- fmt (6.2.1)
- glog (0.3.5)
- libevent (2.1.12)
- OpenSSL-Universal (1.1.1100)
- RCT-Folly (2021.06.28.00-v2):
- boost
- DoubleConversion
Expand Down Expand Up @@ -352,39 +288,14 @@ PODS:
- React-jsi (= 0.69.1)
- React-logger (= 0.69.1)
- React-perflogger (= 0.69.1)
- SocketRocket (0.6.0)
- Yoga (1.14.0)
- YogaKit (1.18.1):
- Yoga (~> 1.14)

DEPENDENCIES:
- boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
- FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
- Flipper (= 0.125.0)
- Flipper-Boost-iOSX (= 1.76.0.1.11)
- Flipper-DoubleConversion (= 3.2.0.1)
- Flipper-Fmt (= 7.1.7)
- Flipper-Folly (= 2.6.10)
- Flipper-Glog (= 0.5.0.5)
- Flipper-PeerTalk (= 0.0.4)
- Flipper-RSocket (= 1.4.3)
- FlipperKit (= 0.125.0)
- FlipperKit/Core (= 0.125.0)
- FlipperKit/CppBridge (= 0.125.0)
- FlipperKit/FBCxxFollyDynamicConvert (= 0.125.0)
- FlipperKit/FBDefines (= 0.125.0)
- FlipperKit/FKPortForwarding (= 0.125.0)
- FlipperKit/FlipperKitHighlightOverlay (= 0.125.0)
- FlipperKit/FlipperKitLayoutPlugin (= 0.125.0)
- FlipperKit/FlipperKitLayoutTextSearchable (= 0.125.0)
- FlipperKit/FlipperKitNetworkPlugin (= 0.125.0)
- FlipperKit/FlipperKitReactPlugin (= 0.125.0)
- FlipperKit/FlipperKitUserDefaultsPlugin (= 0.125.0)
- FlipperKit/SKIOSNetworkPlugin (= 0.125.0)
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- OpenSSL-Universal (= 1.1.1100)
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
- RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
Expand Down Expand Up @@ -418,21 +329,7 @@ DEPENDENCIES:

SPEC REPOS:
trunk:
- CocoaAsyncSocket
- Flipper
- Flipper-Boost-iOSX
- Flipper-DoubleConversion
- Flipper-Fmt
- Flipper-Folly
- Flipper-Glog
- Flipper-PeerTalk
- Flipper-RSocket
- FlipperKit
- fmt
- libevent
- OpenSSL-Universal
- SocketRocket
- YogaKit

EXTERNAL SOURCES:
boost:
Expand Down Expand Up @@ -504,23 +401,11 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
boost: a7c83b31436843459a1961bfd74b96033dc77234
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
FBLazyVector: 068141206af867f72854753423d0117c4bf53419
FBReactNativeSpec: 546a637adc797fa436dd51d1c63c580f820de31c
Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0
Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c
Flipper-DoubleConversion: 2dc99b02f658daf147069aad9dbd29d8feb06d30
Flipper-Fmt: 60cbdd92fc254826e61d669a5d87ef7015396a9b
Flipper-Folly: 584845625005ff068a6ebf41f857f468decd26b3
Flipper-Glog: 70c50ce58ddaf67dc35180db05f191692570f446
Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9
Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541
FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 3d02b25ca00c2d456734d0bcff864cbc62f6ae1a
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
RCT-Folly: b9d9fe1fc70114b751c076104e52f3b1b5e5a95a
RCTRequired: ae07282b2ec9c90d7eb98251603bc3f82403d239
RCTTypeSafety: a04dc1339af2e1da759ccd093bf11c310dce1ef6
Expand All @@ -535,7 +420,7 @@ SPEC CHECKSUMS:
React-jsiexecutor: 758e70947c232828a66b5ddc42d02b4d010fa26e
React-jsinspector: 55605caf04e02f9b0e05842b786f1c12dde08f4b
React-logger: ca970551cb7eea2fd814d0d5f6fc1a471eb53b76
react-native-slider: 8a61f3dfa62c859e67f545ed707e9438ada8be6c
react-native-slider: 541c8579b23211cc985ac44023dd0f0d46c9f497
React-perflogger: c9161ff0f1c769993cd11d2751e4331ff4ceb7cd
React-RCTActionSheet: 2d885b0bea76a5254ef852939273edd8de116180
React-RCTAnimation: 353fa4fc3c19060068832dd32e555182ec07be45
Expand All @@ -548,10 +433,8 @@ SPEC CHECKSUMS:
React-RCTVibration: e8b7dd6635cc95689b5db643b5a3848f1e05b30b
React-runtimeexecutor: 27f468c5576eaf05ffb7a907528e44c75a3fcbae
ReactCommon: e30ec17dfb1d4c4f3419eac254350d6abca6d5a2
SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
Yoga: 7ab6e3ee4ce47d7b789d1cb520163833e515f452
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: ea17b1731971e714550ad4c057f8c9e4dd544466
PODFILE CHECKSUM: 2bee2bd5d60bce023442613522baa9154a69716b

COCOAPODS: 1.11.3
Loading

0 comments on commit 533db3c

Please sign in to comment.