From a9bc59ba0144df7aea54832e000263a7c2d58ed4 Mon Sep 17 00:00:00 2001 From: Krzysztof Piaskowy Date: Tue, 31 Oct 2023 13:47:14 +0100 Subject: [PATCH 01/12] Test install_modules_dependencies --- Example/ios/Podfile.lock | 31 +------ .../project.pbxproj | 16 +--- .../FabricExample.xcodeproj/project.pbxproj | 16 +--- FabricExample/ios/Podfile.lock | 34 +++----- RNReanimated.podspec | 86 ++++++++++--------- 5 files changed, 62 insertions(+), 121 deletions(-) diff --git a/Example/ios/Podfile.lock b/Example/ios/Podfile.lock index de6333de774b..f7365762c84f 100644 --- a/Example/ios/Podfile.lock +++ b/Example/ios/Podfile.lock @@ -505,34 +505,9 @@ PODS: - RNGestureHandler (2.13.2): - React-Core - RNReanimated (3.5.0): - - DoubleConversion - - FBLazyVector - - glog - - hermes-engine - - RCT-Folly - - RCTRequired - - RCTTypeSafety - - React-callinvoker + - RCT-Folly (= 2021.07.22.00) - React-Core - - React-Core/DevSupport - - React-Core/RCTWebSocket - - React-CoreModules - - React-cxxreact - - React-hermes - - React-jsi - - React-jsiexecutor - - React-jsinspector - - React-RCTActionSheet - - React-RCTAnimation - - React-RCTAppDelegate - - React-RCTBlob - - React-RCTImage - - React-RCTLinking - - React-RCTNetwork - - React-RCTSettings - - React-RCTText - ReactCommon/turbomodule/core - - Yoga - RNScreens (3.25.0): - React-Core - React-RCTImage @@ -798,7 +773,7 @@ SPEC CHECKSUMS: RNCMaskedView: f7c74478c83c4fdfc5cf4df51f80c0dd5cf125c6 RNCPicker: 529d564911e93598cc399b56cc0769ce3675f8c8 RNGestureHandler: bb86e378287f7713baf3ca205423eb8109790022 - RNReanimated: 7032c33fc6caf259b4872375342b72183c688fc3 + RNReanimated: d6138334fbdf0b4ba9a740db9b8caa06c20f38ed RNScreens: 85d3880b52d34db7b8eeebe2f1a0e807c05e69fa RNSVG: d00c8f91c3cbf6d476451313a18f04d220d4f396 SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 @@ -807,4 +782,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: f37cea0ea1b6dc523fb88a9c2bdb9993f4b567ce -COCOAPODS: 1.14.0 +COCOAPODS: 1.12.1 diff --git a/Example/ios/ReanimatedExample.xcodeproj/project.pbxproj b/Example/ios/ReanimatedExample.xcodeproj/project.pbxproj index d196c458f07c..0797c2443754 100644 --- a/Example/ios/ReanimatedExample.xcodeproj/project.pbxproj +++ b/Example/ios/ReanimatedExample.xcodeproj/project.pbxproj @@ -650,13 +650,7 @@ "-DFOLLY_MOBILE=1", "-DFOLLY_USE_LIBCPP=1", ); - OTHER_LDFLAGS = ( - "$(inherited)", - "-Wl", - "-ld_classic", - " ", - "-Wl -ld_classic ", - ); + OTHER_LDFLAGS = "$(inherited)"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; }; @@ -726,13 +720,7 @@ "-DFOLLY_MOBILE=1", "-DFOLLY_USE_LIBCPP=1", ); - OTHER_LDFLAGS = ( - "$(inherited)", - "-Wl", - "-ld_classic", - " ", - "-Wl -ld_classic ", - ); + OTHER_LDFLAGS = "$(inherited)"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; diff --git a/FabricExample/ios/FabricExample.xcodeproj/project.pbxproj b/FabricExample/ios/FabricExample.xcodeproj/project.pbxproj index cc468034d20d..f5f4b7faf07b 100644 --- a/FabricExample/ios/FabricExample.xcodeproj/project.pbxproj +++ b/FabricExample/ios/FabricExample.xcodeproj/project.pbxproj @@ -649,13 +649,7 @@ "-DFOLLY_USE_LIBCPP=1", "-DRN_FABRIC_ENABLED", ); - OTHER_LDFLAGS = ( - "$(inherited)", - "-Wl", - "-ld_classic", - " ", - "-Wl -ld_classic ", - ); + OTHER_LDFLAGS = "$(inherited)"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; }; @@ -729,13 +723,7 @@ "-DFOLLY_USE_LIBCPP=1", "-DRN_FABRIC_ENABLED", ); - OTHER_LDFLAGS = ( - "$(inherited)", - "-Wl", - "-ld_classic", - " ", - "-Wl -ld_classic ", - ); + OTHER_LDFLAGS = "$(inherited)"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; diff --git a/FabricExample/ios/Podfile.lock b/FabricExample/ios/Podfile.lock index 1aeed667014d..5eacea0e3524 100644 --- a/FabricExample/ios/Podfile.lock +++ b/FabricExample/ios/Podfile.lock @@ -1153,33 +1153,19 @@ PODS: - React-RCTFabric - ReactCommon/turbomodule/core - RNReanimated (3.5.0): - - DoubleConversion - - FBLazyVector - - glog - hermes-engine - - RCT-Folly + - RCT-Folly (= 2021.07.22.00) - RCTRequired - RCTTypeSafety - - React-callinvoker - React-Codegen - React-Core - - React-Core/DevSupport - - React-Core/RCTWebSocket - - React-CoreModules - - React-cxxreact - - React-hermes - - React-jsi - - React-jsiexecutor - - React-jsinspector - - React-RCTActionSheet - - React-RCTAnimation - - React-RCTBlob + - React-debug + - React-Fabric + - React-graphics + - React-NativeModulesApple - React-RCTFabric - - React-RCTImage - - React-RCTLinking - - React-RCTNetwork - - React-RCTSettings - - React-RCTText + - React-utils + - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - RNScreens (3.25.0): @@ -1487,7 +1473,7 @@ SPEC CHECKSUMS: React-perflogger: e3596db7e753f51766bceadc061936ef1472edc3 React-RCTActionSheet: 17ab132c748b4471012abbcdcf5befe860660485 React-RCTAnimation: c8bbaab62be5817d2a31c36d5f2571e3f7dcf099 - React-RCTAppDelegate: d43ecd62e3ff9a8d09eab3a05ce786d160786dfe + React-RCTAppDelegate: 7a68d7f49d93f4899acde16ff5050854602a6ca2 React-RCTBlob: 1bcf3a0341eb8d6950009b1ddb8aefaf46996b8c React-RCTFabric: 2d72175df6e0e230a13ec2a7eef184ac0a122fd3 React-RCTImage: 670a3486b532292649b1aef3ffddd0b495a5cee4 @@ -1505,7 +1491,7 @@ SPEC CHECKSUMS: RNCMaskedView: f7c74478c83c4fdfc5cf4df51f80c0dd5cf125c6 RNCPicker: 529d564911e93598cc399b56cc0769ce3675f8c8 RNGestureHandler: 039162c42c65de1228c58eb48be90c279bfde3f1 - RNReanimated: 87385a5102be3fed4b2ffd4d78ed8b49cb1350cb + RNReanimated: 8cc8023cc3e113440b3209c07771186bc4514452 RNScreens: cba72a26a6c967765a8388fe85f78e7771012ca1 RNSVG: df9aaada196f6a61c8e30dc55d41e6c108a954e7 SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 @@ -1514,4 +1500,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 200355ebe627c91121916eeac614c78c24ec30b7 -COCOAPODS: 1.14.0 +COCOAPODS: 1.12.1 diff --git a/RNReanimated.podspec b/RNReanimated.podspec index dd67526ed156..c668e3ec1dae 100644 --- a/RNReanimated.podspec +++ b/RNReanimated.podspec @@ -18,6 +18,8 @@ example_flag = config[:is_reanimated_example_app] ? '-DIS_REANIMATED_EXAMPLE_APP version_flag = '-DREANIMATED_VERSION=' + reanimated_package_json["version"] debug_flag = is_release ? '-DNDEBUG' : '' ios_min_version = config[:react_native_minor_version] >= 73 ? '10.0' : '9.0' +new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1' +# ios_min_version = new_arch_enabled ? '11.0' : '9.0' Pod::Spec.new do |s| @@ -58,47 +60,49 @@ Pod::Spec.new do |s| s.requires_arc = true - s.dependency "React-Core" - if fabric_enabled - s.dependency "React-RCTFabric" - s.dependency "React-Codegen" - end - s.dependency "RCT-Folly" - s.dependency "RCTRequired" - s.dependency "RCTTypeSafety" + # s.dependency "React-Core" + # if fabric_enabled + # s.dependency "React-RCTFabric" + # s.dependency "React-Codegen" + # end + # s.dependency "RCT-Folly" + # s.dependency "RCTRequired" + # s.dependency "RCTTypeSafety" s.dependency "ReactCommon/turbomodule/core" - s.dependency 'FBLazyVector' - if config[:react_native_minor_version] <= 71 - s.dependency 'FBReactNativeSpec' - end - s.dependency 'React-Core' - s.dependency 'React-CoreModules' - s.dependency 'React-Core/DevSupport' - if !config[:is_tvos_target] - s.dependency 'React-RCTActionSheet' - end - s.dependency 'React-RCTNetwork' - s.dependency 'React-RCTAnimation' - s.dependency 'React-RCTLinking' - s.dependency 'React-RCTBlob' - s.dependency 'React-RCTSettings' - s.dependency 'React-RCTText' - s.dependency 'React-RCTImage' - s.dependency 'React-Core/RCTWebSocket' - s.dependency 'React-cxxreact' - s.dependency 'React-jsi' - s.dependency 'React-jsiexecutor' - s.dependency 'React-jsinspector' - s.dependency 'Yoga' - s.dependency 'DoubleConversion' - s.dependency 'glog' - if using_hermes && !config[:is_tvos_target] && config[:react_native_minor_version] >= 70 - s.dependency 'React-hermes' - s.dependency 'hermes-engine' - end - s.dependency 'React-callinvoker' + # s.dependency 'FBLazyVector' + # if config[:react_native_minor_version] <= 71 + # s.dependency 'FBReactNativeSpec' + # end + # s.dependency 'React-Core' + # s.dependency 'React-CoreModules' + # s.dependency 'React-Core/DevSupport' + # if !config[:is_tvos_target] + # s.dependency 'React-RCTActionSheet' + # end + # s.dependency 'React-RCTNetwork' + # s.dependency 'React-RCTAnimation' + # s.dependency 'React-RCTLinking' + # s.dependency 'React-RCTBlob' + # s.dependency 'React-RCTSettings' + # s.dependency 'React-RCTText' + # s.dependency 'React-RCTImage' + # s.dependency 'React-Core/RCTWebSocket' + # s.dependency 'React-cxxreact' + # s.dependency 'React-jsi' + # s.dependency 'React-jsiexecutor' + # s.dependency 'React-jsinspector' + # s.dependency 'Yoga' + # s.dependency 'DoubleConversion' + # s.dependency 'glog' + # if using_hermes && !config[:is_tvos_target] && config[:react_native_minor_version] >= 70 + # s.dependency 'React-hermes' + # s.dependency 'hermes-engine' + # end + # s.dependency 'React-callinvoker' - if config[:react_native_minor_version] >= 72 && !fabric_enabled - s.dependency 'React-RCTAppDelegate' - end + # if config[:react_native_minor_version] >= 72 && !fabric_enabled + # s.dependency 'React-RCTAppDelegate' + # end + + install_modules_dependencies(s); end From 91f858284d387c89851f4f443db10106001626fa Mon Sep 17 00:00:00 2001 From: Krzysztof Piaskowy Date: Tue, 31 Oct 2023 13:59:52 +0100 Subject: [PATCH 02/12] Add legacy fallback implementation --- RNReanimated.podspec | 104 ++++++++++++++++++++++--------------------- 1 file changed, 54 insertions(+), 50 deletions(-) diff --git a/RNReanimated.podspec b/RNReanimated.podspec index c668e3ec1dae..efce7741c55b 100644 --- a/RNReanimated.podspec +++ b/RNReanimated.podspec @@ -6,20 +6,65 @@ config = find_config() assert_latest_react_native_with_new_architecture(config, reanimated_package_json) assert_minimal_react_native_version(config) -fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1' +new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1' is_release = ENV['PRODUCTION'] == '1' using_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1' folly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DREACT_NATIVE_MINOR_VERSION=' + config[:react_native_minor_version].to_s folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32' boost_compiler_flags = '-Wno-documentation' -fabric_flags = fabric_enabled ? '-DRCT_NEW_ARCH_ENABLED' : '' +fabric_flags = new_arch_enabled ? '-DRCT_NEW_ARCH_ENABLED' : '' example_flag = config[:is_reanimated_example_app] ? '-DIS_REANIMATED_EXAMPLE_APP' : '' version_flag = '-DREANIMATED_VERSION=' + reanimated_package_json["version"] debug_flag = is_release ? '-DNDEBUG' : '' ios_min_version = config[:react_native_minor_version] >= 73 ? '10.0' : '9.0' -new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1' -# ios_min_version = new_arch_enabled ? '11.0' : '9.0' +if new_arch_enabled + ios_min_version = '11.0' +end + +def legacy_install_modules_dependencies(s, config, new_arch_enabled) + s.dependency "React-Core" + if new_arch_enabled + s.dependency "React-RCTFabric" + s.dependency "React-Codegen" + end + s.dependency "RCT-Folly" + s.dependency "RCTRequired" + s.dependency "RCTTypeSafety" + s.dependency 'FBLazyVector' + if config[:react_native_minor_version] <= 71 + s.dependency 'FBReactNativeSpec' + end + s.dependency 'React-Core' + s.dependency 'React-CoreModules' + s.dependency 'React-Core/DevSupport' + if !config[:is_tvos_target] + s.dependency 'React-RCTActionSheet' + end + s.dependency 'React-RCTNetwork' + s.dependency 'React-RCTAnimation' + s.dependency 'React-RCTLinking' + s.dependency 'React-RCTBlob' + s.dependency 'React-RCTSettings' + s.dependency 'React-RCTText' + s.dependency 'React-RCTImage' + s.dependency 'React-Core/RCTWebSocket' + s.dependency 'React-cxxreact' + s.dependency 'React-jsi' + s.dependency 'React-jsiexecutor' + s.dependency 'React-jsinspector' + s.dependency 'Yoga' + s.dependency 'DoubleConversion' + s.dependency 'glog' + if using_hermes && !config[:is_tvos_target] && config[:react_native_minor_version] >= 70 + s.dependency 'React-hermes' + s.dependency 'hermes-engine' + end + s.dependency 'React-callinvoker' + if config[:react_native_minor_version] >= 72 && !new_arch_enabled + s.dependency 'React-RCTAppDelegate' + end +end Pod::Spec.new do |s| @@ -57,52 +102,11 @@ Pod::Spec.new do |s| "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/Headers/Public/React-hermes\" \"$(PODS_ROOT)/Headers/Public/hermes-engine\" \"$(PODS_ROOT)/#{config[:react_native_common_dir]}\"", "OTHER_CFLAGS" => "$(inherited)" + " " + folly_flags + " " + fabric_flags + " " + example_flag + " " + version_flag + " " + debug_flag } - s.requires_arc = true - - # s.dependency "React-Core" - # if fabric_enabled - # s.dependency "React-RCTFabric" - # s.dependency "React-Codegen" - # end - # s.dependency "RCT-Folly" - # s.dependency "RCTRequired" - # s.dependency "RCTTypeSafety" s.dependency "ReactCommon/turbomodule/core" - # s.dependency 'FBLazyVector' - # if config[:react_native_minor_version] <= 71 - # s.dependency 'FBReactNativeSpec' - # end - # s.dependency 'React-Core' - # s.dependency 'React-CoreModules' - # s.dependency 'React-Core/DevSupport' - # if !config[:is_tvos_target] - # s.dependency 'React-RCTActionSheet' - # end - # s.dependency 'React-RCTNetwork' - # s.dependency 'React-RCTAnimation' - # s.dependency 'React-RCTLinking' - # s.dependency 'React-RCTBlob' - # s.dependency 'React-RCTSettings' - # s.dependency 'React-RCTText' - # s.dependency 'React-RCTImage' - # s.dependency 'React-Core/RCTWebSocket' - # s.dependency 'React-cxxreact' - # s.dependency 'React-jsi' - # s.dependency 'React-jsiexecutor' - # s.dependency 'React-jsinspector' - # s.dependency 'Yoga' - # s.dependency 'DoubleConversion' - # s.dependency 'glog' - # if using_hermes && !config[:is_tvos_target] && config[:react_native_minor_version] >= 70 - # s.dependency 'React-hermes' - # s.dependency 'hermes-engine' - # end - # s.dependency 'React-callinvoker' - - # if config[:react_native_minor_version] >= 72 && !fabric_enabled - # s.dependency 'React-RCTAppDelegate' - # end - - install_modules_dependencies(s); + if defined?(install_modules_dependencies()) != nil + install_modules_dependencies(s) + else + legacy_install_modules_dependencies(s, config, new_arch_enabled) + end end From 02941e26f0415f302e307108c6aba29c950d7c79 Mon Sep 17 00:00:00 2001 From: Krzysztof Piaskowy Date: Tue, 31 Oct 2023 14:29:22 +0100 Subject: [PATCH 03/12] Wrap method by module to make it visible from Spec definition --- FabricExample/ios/Podfile.lock | 2 +- RNReanimated.podspec | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/FabricExample/ios/Podfile.lock b/FabricExample/ios/Podfile.lock index 5eacea0e3524..f5d61fa1bea3 100644 --- a/FabricExample/ios/Podfile.lock +++ b/FabricExample/ios/Podfile.lock @@ -1491,7 +1491,7 @@ SPEC CHECKSUMS: RNCMaskedView: f7c74478c83c4fdfc5cf4df51f80c0dd5cf125c6 RNCPicker: 529d564911e93598cc399b56cc0769ce3675f8c8 RNGestureHandler: 039162c42c65de1228c58eb48be90c279bfde3f1 - RNReanimated: 8cc8023cc3e113440b3209c07771186bc4514452 + RNReanimated: 4b82c89a58f66169352b947403f45b2142e7595b RNScreens: cba72a26a6c967765a8388fe85f78e7771012ca1 RNSVG: df9aaada196f6a61c8e30dc55d41e6c108a954e7 SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 diff --git a/RNReanimated.podspec b/RNReanimated.podspec index efce7741c55b..eadec6c0bf0b 100644 --- a/RNReanimated.podspec +++ b/RNReanimated.podspec @@ -22,7 +22,8 @@ if new_arch_enabled ios_min_version = '11.0' end -def legacy_install_modules_dependencies(s, config, new_arch_enabled) +module LegacyModule +def self.install_modules_dependencies(s, config, new_arch_enabled, using_hermes) s.dependency "React-Core" if new_arch_enabled s.dependency "React-RCTFabric" @@ -65,6 +66,7 @@ def legacy_install_modules_dependencies(s, config, new_arch_enabled) s.dependency 'React-RCTAppDelegate' end end +end Pod::Spec.new do |s| @@ -107,6 +109,6 @@ Pod::Spec.new do |s| if defined?(install_modules_dependencies()) != nil install_modules_dependencies(s) else - legacy_install_modules_dependencies(s, config, new_arch_enabled) + LegacyModule.install_modules_dependencies(s, config, new_arch_enabled, using_hermes) end end From e578c511d096afc4cef8ebfecd738923dcf8a275 Mon Sep 17 00:00:00 2001 From: Krzysztof Piaskowy Date: Tue, 31 Oct 2023 16:48:01 +0100 Subject: [PATCH 04/12] Update cocoapods --- Example/ios/Podfile.lock | 2 +- FabricExample/ios/Podfile.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Example/ios/Podfile.lock b/Example/ios/Podfile.lock index f7365762c84f..e392cc329fda 100644 --- a/Example/ios/Podfile.lock +++ b/Example/ios/Podfile.lock @@ -782,4 +782,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: f37cea0ea1b6dc523fb88a9c2bdb9993f4b567ce -COCOAPODS: 1.12.1 +COCOAPODS: 1.14.2 diff --git a/FabricExample/ios/Podfile.lock b/FabricExample/ios/Podfile.lock index f5d61fa1bea3..d29af63840e6 100644 --- a/FabricExample/ios/Podfile.lock +++ b/FabricExample/ios/Podfile.lock @@ -1500,4 +1500,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 200355ebe627c91121916eeac614c78c24ec30b7 -COCOAPODS: 1.12.1 +COCOAPODS: 1.14.2 From 9934b5499dc90aa8bcef61d5e1cb6e9042f8364d Mon Sep 17 00:00:00 2001 From: Krzysztof Piaskowy Date: Tue, 31 Oct 2023 16:50:44 +0100 Subject: [PATCH 05/12] Restore changes --- .../ReanimatedExample.xcodeproj/project.pbxproj | 16 ++++++++++++++-- .../ios/FabricExample.xcodeproj/project.pbxproj | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/Example/ios/ReanimatedExample.xcodeproj/project.pbxproj b/Example/ios/ReanimatedExample.xcodeproj/project.pbxproj index 0797c2443754..d196c458f07c 100644 --- a/Example/ios/ReanimatedExample.xcodeproj/project.pbxproj +++ b/Example/ios/ReanimatedExample.xcodeproj/project.pbxproj @@ -650,7 +650,13 @@ "-DFOLLY_MOBILE=1", "-DFOLLY_USE_LIBCPP=1", ); - OTHER_LDFLAGS = "$(inherited)"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-Wl", + "-ld_classic", + " ", + "-Wl -ld_classic ", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; }; @@ -720,7 +726,13 @@ "-DFOLLY_MOBILE=1", "-DFOLLY_USE_LIBCPP=1", ); - OTHER_LDFLAGS = "$(inherited)"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-Wl", + "-ld_classic", + " ", + "-Wl -ld_classic ", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; diff --git a/FabricExample/ios/FabricExample.xcodeproj/project.pbxproj b/FabricExample/ios/FabricExample.xcodeproj/project.pbxproj index f5f4b7faf07b..cc468034d20d 100644 --- a/FabricExample/ios/FabricExample.xcodeproj/project.pbxproj +++ b/FabricExample/ios/FabricExample.xcodeproj/project.pbxproj @@ -649,7 +649,13 @@ "-DFOLLY_USE_LIBCPP=1", "-DRN_FABRIC_ENABLED", ); - OTHER_LDFLAGS = "$(inherited)"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-Wl", + "-ld_classic", + " ", + "-Wl -ld_classic ", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; }; @@ -723,7 +729,13 @@ "-DFOLLY_USE_LIBCPP=1", "-DRN_FABRIC_ENABLED", ); - OTHER_LDFLAGS = "$(inherited)"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-Wl", + "-ld_classic", + " ", + "-Wl -ld_classic ", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; From e9535a48b993f7f55f9d1e68267a057030db24c6 Mon Sep 17 00:00:00 2001 From: Krzysztof Piaskowy Date: Fri, 10 Nov 2023 10:30:11 +0100 Subject: [PATCH 06/12] Update RNReanimated.podspec Co-authored-by: Tomek Zawadzki --- RNReanimated.podspec | 1 - 1 file changed, 1 deletion(-) diff --git a/RNReanimated.podspec b/RNReanimated.podspec index eadec6c0bf0b..16b4fb464c4e 100644 --- a/RNReanimated.podspec +++ b/RNReanimated.podspec @@ -78,7 +78,6 @@ Pod::Spec.new do |s| DESC s.homepage = "https://github.com/software-mansion/react-native-reanimated" s.license = "MIT" - # s.license = { :type => "MIT", :file => "FILE_LICENSE" } s.author = { "author" => "author@domain.cn" } s.platforms = { :ios => ios_min_version, :tvos => "9.0", :osx => "10.14" } s.source = { :git => "https://github.com/software-mansion/react-native-reanimated.git", :tag => "#{s.version}" } From efb97afb42f0261251c5134e504d19b7acc45588 Mon Sep 17 00:00:00 2001 From: Krzysztof Piaskowy Date: Fri, 10 Nov 2023 10:30:19 +0100 Subject: [PATCH 07/12] Update RNReanimated.podspec Co-authored-by: Tomek Zawadzki --- RNReanimated.podspec | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/RNReanimated.podspec b/RNReanimated.podspec index 16b4fb464c4e..2df8dae1baf1 100644 --- a/RNReanimated.podspec +++ b/RNReanimated.podspec @@ -17,10 +17,7 @@ fabric_flags = new_arch_enabled ? '-DRCT_NEW_ARCH_ENABLED' : '' example_flag = config[:is_reanimated_example_app] ? '-DIS_REANIMATED_EXAMPLE_APP' : '' version_flag = '-DREANIMATED_VERSION=' + reanimated_package_json["version"] debug_flag = is_release ? '-DNDEBUG' : '' -ios_min_version = config[:react_native_minor_version] >= 73 ? '10.0' : '9.0' -if new_arch_enabled - ios_min_version = '11.0' -end +ios_min_version = new_arch_enabled ? '11.0' : config[:react_native_minor_version] >= 73 ? '10.0' : '9.0' module LegacyModule def self.install_modules_dependencies(s, config, new_arch_enabled, using_hermes) From d68a5b486435d295d3df8c37a58c542fb512873e Mon Sep 17 00:00:00 2001 From: Krzysztof Piaskowy Date: Wed, 15 Nov 2023 12:32:24 +0100 Subject: [PATCH 08/12] Improvements after review --- RNReanimated.podspec | 116 +++++++++++++++++++++++-------------------- 1 file changed, 63 insertions(+), 53 deletions(-) diff --git a/RNReanimated.podspec b/RNReanimated.podspec index 2df8dae1baf1..da20a22419ed 100644 --- a/RNReanimated.podspec +++ b/RNReanimated.podspec @@ -2,68 +2,78 @@ require "json" require_relative './scripts/reanimated_utils' reanimated_package_json = JSON.parse(File.read(File.join(__dir__, "package.json"))) -config = find_config() -assert_latest_react_native_with_new_architecture(config, reanimated_package_json) -assert_minimal_react_native_version(config) +$config = find_config() +assert_latest_react_native_with_new_architecture($config, reanimated_package_json) +assert_minimal_react_native_version($config) -new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1' +$new_arch_enabled = ENV['RCT_new_arch_enabled'] == '1' is_release = ENV['PRODUCTION'] == '1' -using_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1' -folly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DREACT_NATIVE_MINOR_VERSION=' + config[:react_native_minor_version].to_s +folly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DREACT_NATIVE_MINOR_VERSION=' + $config[:react_native_minor_version].to_s folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32' boost_compiler_flags = '-Wno-documentation' -fabric_flags = new_arch_enabled ? '-DRCT_NEW_ARCH_ENABLED' : '' -example_flag = config[:is_reanimated_example_app] ? '-DIS_REANIMATED_EXAMPLE_APP' : '' +fabric_flags = $new_arch_enabled ? '-DRCT_new_arch_enabled' : '' +example_flag = $config[:is_reanimated_example_app] ? '-DIS_REANIMATED_EXAMPLE_APP' : '' version_flag = '-DREANIMATED_VERSION=' + reanimated_package_json["version"] debug_flag = is_release ? '-DNDEBUG' : '' -ios_min_version = new_arch_enabled ? '11.0' : config[:react_native_minor_version] >= 73 ? '10.0' : '9.0' module LegacyModule -def self.install_modules_dependencies(s, config, new_arch_enabled, using_hermes) - s.dependency "React-Core" - if new_arch_enabled - s.dependency "React-RCTFabric" - s.dependency "React-Codegen" + def self.install_modules_dependencies(s) + using_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1' + s.dependency "React-Core" + if $new_arch_enabled + s.dependency "React-RCTFabric" + s.dependency "React-Codegen" + end + s.dependency "RCT-Folly" + s.dependency "RCTRequired" + s.dependency "RCTTypeSafety" + s.dependency 'FBLazyVector' + if $config[:react_native_minor_version] <= 71 + s.dependency 'FBReactNativeSpec' + end + s.dependency 'React-Core' + s.dependency 'React-CoreModules' + s.dependency 'React-Core/DevSupport' + if !$config[:is_tvos_target] + s.dependency 'React-RCTActionSheet' + end + s.dependency 'React-RCTNetwork' + s.dependency 'React-RCTAnimation' + s.dependency 'React-RCTLinking' + s.dependency 'React-RCTBlob' + s.dependency 'React-RCTSettings' + s.dependency 'React-RCTText' + s.dependency 'React-RCTImage' + s.dependency 'React-Core/RCTWebSocket' + s.dependency 'React-cxxreact' + s.dependency 'React-jsi' + s.dependency 'React-jsiexecutor' + s.dependency 'React-jsinspector' + s.dependency 'Yoga' + s.dependency 'DoubleConversion' + s.dependency 'glog' + if using_hermes && !$config[:is_tvos_target] && $config[:react_native_minor_version] >= 70 + s.dependency 'React-hermes' + s.dependency 'hermes-engine' + end + s.dependency 'React-callinvoker' + if $config[:react_native_minor_version] >= 72 && !$new_arch_enabled + s.dependency 'React-RCTAppDelegate' + end end - s.dependency "RCT-Folly" - s.dependency "RCTRequired" - s.dependency "RCTTypeSafety" - s.dependency 'FBLazyVector' - if config[:react_native_minor_version] <= 71 - s.dependency 'FBReactNativeSpec' - end - s.dependency 'React-Core' - s.dependency 'React-CoreModules' - s.dependency 'React-Core/DevSupport' - if !config[:is_tvos_target] - s.dependency 'React-RCTActionSheet' - end - s.dependency 'React-RCTNetwork' - s.dependency 'React-RCTAnimation' - s.dependency 'React-RCTLinking' - s.dependency 'React-RCTBlob' - s.dependency 'React-RCTSettings' - s.dependency 'React-RCTText' - s.dependency 'React-RCTImage' - s.dependency 'React-Core/RCTWebSocket' - s.dependency 'React-cxxreact' - s.dependency 'React-jsi' - s.dependency 'React-jsiexecutor' - s.dependency 'React-jsinspector' - s.dependency 'Yoga' - s.dependency 'DoubleConversion' - s.dependency 'glog' - if using_hermes && !config[:is_tvos_target] && config[:react_native_minor_version] >= 70 - s.dependency 'React-hermes' - s.dependency 'hermes-engine' - end - s.dependency 'React-callinvoker' - if config[:react_native_minor_version] >= 72 && !new_arch_enabled - s.dependency 'React-RCTAppDelegate' + + def self.get_ios_min_version() + if $config[:react_native_minor_version] <= 72 + return '9.0' + end + # 0.73+ supports iOS 10+, but with new architecture enabled it supports iOS 11+ + if $new_arch_enabled + return '11.0' + end + return '10.0' end end -end Pod::Spec.new do |s| @@ -76,7 +86,7 @@ Pod::Spec.new do |s| s.homepage = "https://github.com/software-mansion/react-native-reanimated" s.license = "MIT" s.author = { "author" => "author@domain.cn" } - s.platforms = { :ios => ios_min_version, :tvos => "9.0", :osx => "10.14" } + s.platforms = { :ios => LegacyModule.get_ios_min_version(), :tvos => "9.0", :osx => "10.14" } s.source = { :git => "https://github.com/software-mansion/react-native-reanimated.git", :tag => "#{s.version}" } s.source_files = [ @@ -97,7 +107,7 @@ Pod::Spec.new do |s| } s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags + ' -DHERMES_ENABLE_DEBUGGER' s.xcconfig = { - "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/Headers/Public/React-hermes\" \"$(PODS_ROOT)/Headers/Public/hermes-engine\" \"$(PODS_ROOT)/#{config[:react_native_common_dir]}\"", + "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/Headers/Public/React-hermes\" \"$(PODS_ROOT)/Headers/Public/hermes-engine\" \"$(PODS_ROOT)/#{$config[:react_native_common_dir]}\"", "OTHER_CFLAGS" => "$(inherited)" + " " + folly_flags + " " + fabric_flags + " " + example_flag + " " + version_flag + " " + debug_flag } s.requires_arc = true @@ -105,6 +115,6 @@ Pod::Spec.new do |s| if defined?(install_modules_dependencies()) != nil install_modules_dependencies(s) else - LegacyModule.install_modules_dependencies(s, config, new_arch_enabled, using_hermes) + LegacyModule.install_modules_dependencies(s) end end From 6f82425202435a691073a20cf07b033f61a9c8a5 Mon Sep 17 00:00:00 2001 From: Krzysztof Piaskowy Date: Wed, 15 Nov 2023 12:46:59 +0100 Subject: [PATCH 09/12] Set minimal ios version to 13.4 --- RNReanimated.podspec | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/RNReanimated.podspec b/RNReanimated.podspec index da20a22419ed..66bf6b535b59 100644 --- a/RNReanimated.podspec +++ b/RNReanimated.podspec @@ -67,11 +67,8 @@ module LegacyModule if $config[:react_native_minor_version] <= 72 return '9.0' end - # 0.73+ supports iOS 10+, but with new architecture enabled it supports iOS 11+ - if $new_arch_enabled - return '11.0' - end - return '10.0' + # 0.73+ supports iOS 13.4+, https://github.com/facebook/react-native/pull/39478 + return '13.4' end end From 7c0080634276d06db9095feacb8185276d35b66f Mon Sep 17 00:00:00 2001 From: Krzysztof Piaskowy Date: Wed, 15 Nov 2023 13:44:14 +0100 Subject: [PATCH 10/12] Restore name --- RNReanimated.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RNReanimated.podspec b/RNReanimated.podspec index 66bf6b535b59..896e3661ed3c 100644 --- a/RNReanimated.podspec +++ b/RNReanimated.podspec @@ -6,13 +6,13 @@ $config = find_config() assert_latest_react_native_with_new_architecture($config, reanimated_package_json) assert_minimal_react_native_version($config) -$new_arch_enabled = ENV['RCT_new_arch_enabled'] == '1' +$new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1' is_release = ENV['PRODUCTION'] == '1' folly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DREACT_NATIVE_MINOR_VERSION=' + $config[:react_native_minor_version].to_s folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32' boost_compiler_flags = '-Wno-documentation' -fabric_flags = $new_arch_enabled ? '-DRCT_new_arch_enabled' : '' +fabric_flags = $new_arch_enabled ? '-DRCT_NEW_ARCH_ENABLED' : '' example_flag = $config[:is_reanimated_example_app] ? '-DIS_REANIMATED_EXAMPLE_APP' : '' version_flag = '-DREANIMATED_VERSION=' + reanimated_package_json["version"] debug_flag = is_release ? '-DNDEBUG' : '' From 77a6e581294179be3158f7e63a9935d75479c9b3 Mon Sep 17 00:00:00 2001 From: Krzysztof Piaskowy Date: Thu, 16 Nov 2023 10:54:08 +0100 Subject: [PATCH 11/12] Min ios version detection --- RNReanimated.podspec | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/RNReanimated.podspec b/RNReanimated.podspec index 896e3661ed3c..870b5470c499 100644 --- a/RNReanimated.podspec +++ b/RNReanimated.podspec @@ -16,6 +16,7 @@ fabric_flags = $new_arch_enabled ? '-DRCT_NEW_ARCH_ENABLED' : '' example_flag = $config[:is_reanimated_example_app] ? '-DIS_REANIMATED_EXAMPLE_APP' : '' version_flag = '-DREANIMATED_VERSION=' + reanimated_package_json["version"] debug_flag = is_release ? '-DNDEBUG' : '' +ios_min_version = $config[:react_native_minor_version] >= 73 ? '13.4' : '9.0' module LegacyModule def self.install_modules_dependencies(s) @@ -62,14 +63,6 @@ module LegacyModule s.dependency 'React-RCTAppDelegate' end end - - def self.get_ios_min_version() - if $config[:react_native_minor_version] <= 72 - return '9.0' - end - # 0.73+ supports iOS 13.4+, https://github.com/facebook/react-native/pull/39478 - return '13.4' - end end Pod::Spec.new do |s| @@ -83,7 +76,7 @@ Pod::Spec.new do |s| s.homepage = "https://github.com/software-mansion/react-native-reanimated" s.license = "MIT" s.author = { "author" => "author@domain.cn" } - s.platforms = { :ios => LegacyModule.get_ios_min_version(), :tvos => "9.0", :osx => "10.14" } + s.platforms = { :ios => ios_min_version, :tvos => "9.0", :osx => "10.14" } s.source = { :git => "https://github.com/software-mansion/react-native-reanimated.git", :tag => "#{s.version}" } s.source_files = [ From 58c77be82814b36e3cbf61c5f55d6a66bac3e716 Mon Sep 17 00:00:00 2001 From: Krzysztof Piaskowy Date: Mon, 20 Nov 2023 22:17:20 +0100 Subject: [PATCH 12/12] Use regular method instead of module --- RNReanimated.podspec | 88 ++++++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 45 deletions(-) diff --git a/RNReanimated.podspec b/RNReanimated.podspec index 870b5470c499..b68c37c76cc9 100644 --- a/RNReanimated.podspec +++ b/RNReanimated.podspec @@ -18,50 +18,48 @@ version_flag = '-DREANIMATED_VERSION=' + reanimated_package_json["version"] debug_flag = is_release ? '-DNDEBUG' : '' ios_min_version = $config[:react_native_minor_version] >= 73 ? '13.4' : '9.0' -module LegacyModule - def self.install_modules_dependencies(s) - using_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1' - s.dependency "React-Core" - if $new_arch_enabled - s.dependency "React-RCTFabric" - s.dependency "React-Codegen" - end - s.dependency "RCT-Folly" - s.dependency "RCTRequired" - s.dependency "RCTTypeSafety" - s.dependency 'FBLazyVector' - if $config[:react_native_minor_version] <= 71 - s.dependency 'FBReactNativeSpec' - end - s.dependency 'React-Core' - s.dependency 'React-CoreModules' - s.dependency 'React-Core/DevSupport' - if !$config[:is_tvos_target] - s.dependency 'React-RCTActionSheet' - end - s.dependency 'React-RCTNetwork' - s.dependency 'React-RCTAnimation' - s.dependency 'React-RCTLinking' - s.dependency 'React-RCTBlob' - s.dependency 'React-RCTSettings' - s.dependency 'React-RCTText' - s.dependency 'React-RCTImage' - s.dependency 'React-Core/RCTWebSocket' - s.dependency 'React-cxxreact' - s.dependency 'React-jsi' - s.dependency 'React-jsiexecutor' - s.dependency 'React-jsinspector' - s.dependency 'Yoga' - s.dependency 'DoubleConversion' - s.dependency 'glog' - if using_hermes && !$config[:is_tvos_target] && $config[:react_native_minor_version] >= 70 - s.dependency 'React-hermes' - s.dependency 'hermes-engine' - end - s.dependency 'React-callinvoker' - if $config[:react_native_minor_version] >= 72 && !$new_arch_enabled - s.dependency 'React-RCTAppDelegate' - end +def self.install_modules_dependencies_legacy(s) + using_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1' + s.dependency "React-Core" + if $new_arch_enabled + s.dependency "React-RCTFabric" + s.dependency "React-Codegen" + end + s.dependency "RCT-Folly" + s.dependency "RCTRequired" + s.dependency "RCTTypeSafety" + s.dependency 'FBLazyVector' + if $config[:react_native_minor_version] <= 71 + s.dependency 'FBReactNativeSpec' + end + s.dependency 'React-Core' + s.dependency 'React-CoreModules' + s.dependency 'React-Core/DevSupport' + if !$config[:is_tvos_target] + s.dependency 'React-RCTActionSheet' + end + s.dependency 'React-RCTNetwork' + s.dependency 'React-RCTAnimation' + s.dependency 'React-RCTLinking' + s.dependency 'React-RCTBlob' + s.dependency 'React-RCTSettings' + s.dependency 'React-RCTText' + s.dependency 'React-RCTImage' + s.dependency 'React-Core/RCTWebSocket' + s.dependency 'React-cxxreact' + s.dependency 'React-jsi' + s.dependency 'React-jsiexecutor' + s.dependency 'React-jsinspector' + s.dependency 'Yoga' + s.dependency 'DoubleConversion' + s.dependency 'glog' + if using_hermes && !$config[:is_tvos_target] && $config[:react_native_minor_version] >= 70 + s.dependency 'React-hermes' + s.dependency 'hermes-engine' + end + s.dependency 'React-callinvoker' + if $config[:react_native_minor_version] >= 72 && !$new_arch_enabled + s.dependency 'React-RCTAppDelegate' end end @@ -105,6 +103,6 @@ Pod::Spec.new do |s| if defined?(install_modules_dependencies()) != nil install_modules_dependencies(s) else - LegacyModule.install_modules_dependencies(s) + install_modules_dependencies_legacy(s) end end