From 4c21abe31b1546524b11894cbbe78104ace128a7 Mon Sep 17 00:00:00 2001 From: grabbou Date: Wed, 9 Sep 2020 19:08:01 +0200 Subject: [PATCH 01/45] feat: initial commit Hermes on iOS --- React-Core.podspec | 4 +- React/CxxBridge/RCTCxxBridge.mm | 2 +- package.json | 1 + .../react-native-codegen/android/gradlew.bat | 178 +++++++++--------- packages/rn-tester/Podfile | 4 +- packages/rn-tester/Podfile.lock | 90 ++++++--- packages/rn-tester/RNTester/AppDelegate.mm | 12 ++ .../RNTesterPods.xcodeproj/project.pbxproj | 54 ++++++ third-party-podspecs/RCT-Folly.podspec | 11 +- third-party-podspecs/libevent.podspec | 2 +- yarn.lock | 5 + 11 files changed, 233 insertions(+), 130 deletions(-) diff --git a/React-Core.podspec b/React-Core.podspec index 7a004607739d7f..a06a7258eb2216 100644 --- a/React-Core.podspec +++ b/React-Core.podspec @@ -70,14 +70,14 @@ Pod::Spec.new do |s| end s.subspec "Hermes" do |ss| - ss.platforms = { :osx => "10.14" } + ss.platforms = { :osx => "10.14", :ios => "10.0" } ss.source_files = "ReactCommon/hermes/executor/*.{cpp,h}", "ReactCommon/hermes/inspector/*.{cpp,h}", "ReactCommon/hermes/inspector/chrome/*.{cpp,h}", "ReactCommon/hermes/inspector/detail/*.{cpp,h}" ss.pod_target_xcconfig = { "GCC_PREPROCESSOR_DEFINITIONS" => "HERMES_ENABLE_DEBUGGER=1" } ss.dependency "RCT-Folly/Futures" - ss.dependency "hermes", "~> 0.6.0" + ss.dependency "hermes" end s.subspec "DevSupport" do |ss| diff --git a/React/CxxBridge/RCTCxxBridge.mm b/React/CxxBridge/RCTCxxBridge.mm index 171005a4f02cf8..b7609722101c5a 100644 --- a/React/CxxBridge/RCTCxxBridge.mm +++ b/React/CxxBridge/RCTCxxBridge.mm @@ -37,7 +37,7 @@ #import #import -#if TARGET_OS_OSX && __has_include() +#if __has_include() #define RCT_USE_HERMES 1 #endif #if RCT_USE_HERMES diff --git a/package.json b/package.json index 98757ed0375887..865554ea14b73e 100644 --- a/package.json +++ b/package.json @@ -97,6 +97,7 @@ "event-target-shim": "^5.0.1", "fbjs-scripts": "^1.1.0", "hermes-engine": "~0.6.0", + "hermes-engine-darwin": "0.6.0", "invariant": "^2.2.4", "jsc-android": "^245459.0.0", "metro-babel-register": "0.63.0", diff --git a/packages/react-native-codegen/android/gradlew.bat b/packages/react-native-codegen/android/gradlew.bat index ac1b06f93825db..107acd32c4e687 100644 --- a/packages/react-native-codegen/android/gradlew.bat +++ b/packages/react-native-codegen/android/gradlew.bat @@ -1,89 +1,89 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/rn-tester/Podfile b/packages/rn-tester/Podfile index 574cbb4d0d0ccc..b83b7e7ab38571 100644 --- a/packages/rn-tester/Podfile +++ b/packages/rn-tester/Podfile @@ -13,12 +13,12 @@ def pods() # Enable TurboModule prefix_path = "../.." - use_react_native!(path:prefix_path) + use_react_native!(path: prefix_path, hermes_enabled: true, hermes_path: "#{prefix_path}/../hermes") pod 'ReactCommon/turbomodule/samples', :path => "#{prefix_path}/ReactCommon" # Additional Pods which aren't included in the default Podfile pod 'React-RCTPushNotification', :path => "#{prefix_path}/Libraries/PushNotificationIOS" - pod 'Yoga',:path => "#{prefix_path}/ReactCommon/yoga", :modular_headers => true + pod 'Yoga', :path => "#{prefix_path}/ReactCommon/yoga", :modular_headers => true # Additional Pods which are classed as unstable # # To use fabric: add `fabric_enabled` option to the use_react_native method above, like below diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index 4aed3559d8229f..4b75a89221aede 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -58,6 +58,12 @@ PODS: - FlipperKit/Core - FlipperKit/FlipperKitNetworkPlugin - glog (0.3.5) + - hermes (0.6.0) + - libevent (2.1.11): + - libevent/core (= 2.1.11) + - libevent/core (2.1.11): + - libevent/event2-headers + - libevent/event2-headers (2.1.11) - OpenSSL-Universal (1.0.2.19): - OpenSSL-Universal/Static (= 1.0.2.19) - OpenSSL-Universal/Static (1.0.2.19) @@ -70,6 +76,11 @@ PODS: - boost-for-react-native - DoubleConversion - glog + - RCT-Folly/Futures (2020.01.13.00): + - boost-for-react-native + - DoubleConversion + - glog + - libevent - RCTRequired (1000.0.0) - RCTTypeSafety (1000.0.0): - FBLazyVector (= 1000.0.0) @@ -127,6 +138,16 @@ PODS: - React-jsinspector (= 1000.0.0) - React-perflogger (= 1000.0.0) - Yoga + - React-Core/Hermes (1000.0.0): + - glog + - hermes (= 0.6.0) + - RCT-Folly (= 2020.01.13.00) + - RCT-Folly/Futures + - React-cxxreact (= 1000.0.0) + - React-jsi (= 1000.0.0) + - React-jsiexecutor (= 1000.0.0) + - React-perflogger (= 1000.0.0) + - Yoga - React-Core/RCTActionSheetHeaders (1000.0.0): - glog - RCT-Folly (= 2020.01.13.00) @@ -377,6 +398,8 @@ DEPENDENCIES: - FlipperKit/FlipperKitUserDefaultsPlugin (~> 0.41.1) - FlipperKit/SKIOSNetworkPlugin (~> 0.41.1) - glog (from `../../third-party-podspecs/glog.podspec`) + - hermes (from `../../../hermes`) + - libevent (from `../../third-party-podspecs/libevent.podspec`) - RCT-Folly (from `../../third-party-podspecs/RCT-Folly.podspec`) - RCTRequired (from `../../Libraries/RCTRequired`) - RCTTypeSafety (from `../../Libraries/TypeSafety`) @@ -384,6 +407,7 @@ DEPENDENCIES: - React-callinvoker (from `../../ReactCommon/callinvoker`) - React-Core (from `../../`) - React-Core/DevSupport (from `../../`) + - React-Core/Hermes (from `../../`) - React-Core/RCTWebSocket (from `../../`) - React-CoreModules (from `../../React/CoreModules`) - React-cxxreact (from `../../ReactCommon/cxxreact`) @@ -431,6 +455,10 @@ EXTERNAL SOURCES: :path: "../../Libraries/FBReactNativeSpec" glog: :podspec: "../../third-party-podspecs/glog.podspec" + hermes: + :path: "../../../hermes" + libevent: + :podspec: "../../third-party-podspecs/libevent.podspec" RCT-Folly: :podspec: "../../third-party-podspecs/RCT-Folly.podspec" RCTRequired: @@ -489,8 +517,8 @@ SPEC CHECKSUMS: CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845 CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f DoubleConversion: cde416483dac037923206447da6e1454df403714 - FBLazyVector: 8ea0285646adaf7fa725c20ed737c49ee5ea680a - FBReactNativeSpec: 29b1b8a11346e71351f3a2ba126439810edee362 + FBLazyVector: d8559264d893d9f9025342901fb5e2062a374326 + FBReactNativeSpec: 36ff6fbd846ad7af3093cad662419850a00a87d6 Flipper: 33585e2d9810fe5528346be33bcf71b37bb7ae13 Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41 Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3 @@ -499,35 +527,37 @@ SPEC CHECKSUMS: Flipper-RSocket: 64e7431a55835eb953b0bf984ef3b90ae9fdddd7 FlipperKit: bc68102cd4952a258a23c9c1b316c7bec1fecf83 glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3 + hermes: 247372059d167f28c6fe29c2e106d71524fd8ca6 + libevent: f1c51c1e883112c92d1247a63c1c4c0f4a56618e OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355 - RCT-Folly: b39288cedafe50da43317ec7d91bcc8cc0abbf33 - RCTRequired: 34582e9b3ebe69f244e091f37218d318406d5c4a - RCTTypeSafety: 84db212a990ce622a28f1bcb1ac68c658e722373 - React: cafb3c2321f7df55ce90dbf29d513799a79e4418 - React-callinvoker: 0dada022d38b73e6e15b33e2a96476153f79bbf6 - React-Core: d377a770bb13aa5120a6ce553f75f0e1cbc1aafe - React-CoreModules: f38b671f8df4c1c744ed69f00264539a7c4024b4 - React-cxxreact: de6de17eac6bbaa4f9fad46b66e7f0c4aaaf863d - React-jsi: 652ad7cb7ff8c87e0e9fb11e9ebcbbc70cdfe865 - React-jsiexecutor: f20d2b5986dbe3d0e94ccbf2d8da24e0d9c42cc9 - React-jsinspector: 7fbf9b42b58b02943a0d89b0ba9fff0070f2de98 - React-perflogger: 1f668f3e4d1adef1fafb3b95e7d6cf922113fe31 - React-RCTActionSheet: 51c43beeb74ef41189e87fe9823e53ebf6210359 - React-RCTAnimation: 62f271148b71d0200773b4959e99a80f624182d4 - React-RCTBlob: b81d69c4dc7f7891a6a3ec969bba9b0a9801b062 - React-RCTImage: 37646ebc761e9f68781867e9e802afdadd18a3dc - React-RCTLinking: b5c261eb3befe7d5c62a4706ae904943e73f9c82 - React-RCTNetwork: 2f6c4ba283c9c2ea768fecc6c681d3ab9448b5f5 - React-RCTPushNotification: a4f86ef3d7c0cb3ee570108a62e39fcd296a5030 - React-RCTSettings: 5a76683d9cf7408b5f8c3306cda3eaf4db191fce - React-RCTTest: 090e9816044220c39462be109dab6d473d94b1c9 - React-RCTText: 6c01963d3e562109f5548262b09b1b2bc260dd60 - React-RCTVibration: 0997fcaf753c7ac0a341177db120eebc438484cf - React-runtimeexecutor: 60dd6204a13f68a1aa1118870edcc604a791df2b - ReactCommon: 1f231b4fbed866032aa084ca23973063bbb51927 - Yoga: f7fa200d8c49f97b54c9421079e781fb900b5cae + RCT-Folly: 0039f155eba2e17778f9a1f82f09f05534eb6bca + RCTRequired: e76acf4b1cb7d52cf44073c5e188fea6c444ad62 + RCTTypeSafety: 51b83e8b893ce9f745a82f2b4c40f3d74bf15d1b + React: 48d355deb8f4b49f19c9cd90307bd7e69d470389 + React-callinvoker: d3b98dab5eb0c0027e04ae0d957134d5e96f8ed0 + React-Core: 4c3f6131e59a5b93388413e8ce84840e64547219 + React-CoreModules: ffd2835a7e01200fc9441235e6fbc846bf057f0e + React-cxxreact: 59e4466f636f21f8eaa5d84135a6198100a8c63d + React-jsi: 793bd16dd6643ca4ae27f045856acb313755a830 + React-jsiexecutor: d5d7c440c962c4a5bddec639fa738f998b57163f + React-jsinspector: 1a3054d8cbaaeed06ff5407606d312fc907cb87d + React-perflogger: 0e1e8275b3316a543aa5722402406cb909b713c6 + React-RCTActionSheet: 2bce31955fc8bec0a01585376805feaee8fc2fac + React-RCTAnimation: 3a0218b32cea46bf90b4609b1360f9e72310dc02 + React-RCTBlob: b0a7fa90ec9391911581d95a8eb2459e232bf60c + React-RCTImage: 461292bb164f1571cecd593ee5c4aea9de01d43b + React-RCTLinking: 0649a8169dbdf027d7c6f508297b31e1b8e9a27b + React-RCTNetwork: 799515eb61a1d8a372ef3bcb85e0c090b60ff5eb + React-RCTPushNotification: 07ca0a50616a98009170a0de35a983c073ebf78b + React-RCTSettings: 935548505ead7968b17e3767ca51c5ef42205133 + React-RCTTest: 7bbe5100ef69cc0f58d965350d65e7487f142d5d + React-RCTText: 9720bd7e288e97d3261d8acdbfb8ccd673e56ade + React-RCTVibration: fb01cb9bca35f3ed8c8a974fff16ba537d7d62c5 + React-runtimeexecutor: 4a8a170e300916a7f4dbf9abf3c1652bb266f3a9 + ReactCommon: 718fec5e1d2fe08464a8a5ffcb5e7429a7a12d89 + Yoga: 33055d49e2a310d04fc5ac2263db2849672a8df1 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: 3045d3456f0f2268f15db9a527839e6a19e6071c +PODFILE CHECKSUM: 7bdc31b746ec6c1684a9a8287ed8962d28a1a4ab -COCOAPODS: 1.8.4 +COCOAPODS: 1.9.3 diff --git a/packages/rn-tester/RNTester/AppDelegate.mm b/packages/rn-tester/RNTester/AppDelegate.mm index 4eb217c9704efa..0b9b534cd68f37 100644 --- a/packages/rn-tester/RNTester/AppDelegate.mm +++ b/packages/rn-tester/RNTester/AppDelegate.mm @@ -7,7 +7,15 @@ #import "AppDelegate.h" +#if __has_include() +#define RCT_USE_HERMES 1 +#endif +#if RCT_USE_HERMES +#import +#else #import +#endif + #import #import #import @@ -165,7 +173,11 @@ - (void)loadSourceForBridge:(RCTBridge *)bridge #endif __weak __typeof(self) weakSelf = self; +#if RCT_USE_HERMES + return std::make_unique( +#else return std::make_unique( +#endif facebook::react::RCTJSIExecutorRuntimeInstaller([weakSelf, bridge](facebook::jsi::Runtime &runtime) { if (!bridge) { return; diff --git a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj index 04b79666cd32d1..2f830027f888cb 100644 --- a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj +++ b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj @@ -399,6 +399,7 @@ 68CD48B71D2BCB2C007E06A9 /* Build JS Bundle */, 5CF0FD27207FC6EC00C13D65 /* Start Metro */, C1C7A9D58CE1D09515F20577 /* [CP] Copy Pods Resources */, + 8CE34A8AABFD09C8B3A00B1D /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -418,6 +419,7 @@ E7DB209C22B2BA84005AC45F /* Frameworks */, E7DB209D22B2BA84005AC45F /* Resources */, D45F7C4830D42738CAAC9684 /* [CP] Copy Pods Resources */, + 7A5E3C3F59BF3EA884A39149 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -437,6 +439,7 @@ E7DB215022B2F332005AC45F /* Frameworks */, E7DB215122B2F332005AC45F /* Resources */, CD1D70F24AD74F4E13B7435D /* [CP] Copy Pods Resources */, + A934FCF321A9F192FD849C8A /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -588,6 +591,57 @@ shellPath = /bin/sh; shellScript = "export NODE_BINARY=node\nexport PROJECT_ROOT=$SRCROOT/..\nexport SOURCEMAP_FILE=../sourcemap.ios.map\n# export FORCE_BUNDLING=true\n\"$SRCROOT/../../scripts/react-native-xcode.sh\" $SRCROOT/../../packages/rn-tester/js/RNTesterApp.ios.js\n"; }; + 7A5E3C3F59BF3EA884A39149 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 8CE34A8AABFD09C8B3A00B1D /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + A934FCF321A9F192FD849C8A /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; C1C7A9D58CE1D09515F20577 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/third-party-podspecs/RCT-Folly.podspec b/third-party-podspecs/RCT-Folly.podspec index ae1d4f471b69dd..903cb048d4f420 100644 --- a/third-party-podspecs/RCT-Folly.podspec +++ b/third-party-podspecs/RCT-Folly.podspec @@ -97,20 +97,21 @@ Pod::Spec.new do |spec| 'folly/futures/detail/*.{h,cpp}', 'folly/executors/*.{h,cpp}', 'folly/executors/thread_factory/{NamedThreadFactory,ThreadFactory}.{h,cpp}', - 'folly/executors/task_queue/{BlockingQueue,LifoSemMPMCQueue,PriorityLifoSemMPMCQueue}.{h,cpp}', + 'folly/executors/task_queue/{BlockingQueue,UnboundedBlockingQueue,LifoSemMPMCQueue,PriorityUnboundedBlockingQueue,PriorityLifoSemMPMCQueue}.{h,cpp}', 'folly/concurrency/*.{h,cpp}', - 'folly/system/{ThreadId,ThreadName}.{h,cpp}', + 'folly/system/{ThreadId,ThreadName,HardwareConcurrency}.{h,cpp}', 'folly/synchronization/*.{h,cpp}', 'folly/synchronization/detail/*.{h,cpp}', - 'folly/experimental/{ExecutionObserver,ReadMostlySharedPtr,TLRefCount}.{h,cpp}', - 'folly/io/async/{AsyncTimeout,DelayedDestruction,DelayedDestructionBase,EventBase,EventBaseManager,EventHandler,EventUtil,HHWheelTimer,NotificationQueue,Request,TimeoutManager,VirtualEventBase}.{h,cpp}', + 'folly/experimental/{ExecutionObserver,ReadMostlySharedPtr,SingleWriterFixedHashMap,TLRefCount}.{h,cpp}', + 'folly/io/async/{AsyncTimeout,DelayedDestruction,DelayedDestructionBase,EventBase,EventBaseManager,EventBaseBackendBase,EventHandler,EventUtil,HHWheelTimer,HHWheelTimer-fwd,NotificationQueue,Request,TimeoutManager,VirtualEventBase}.{h,cpp}', 'folly/io/{Cursor,Cursor-inl,IOBuf,IOBufQueue}.{h,cpp}', 'folly/tracing/StaticTracepoint.{h,cpp}', 'folly/{Executor,ExceptionWrapper,ExceptionWrapper-inl,FileUtil,Singleton,SharedMutex}.{h,cpp}', 'folly/detail/{AtFork,Futex,Futex-inl,MemoryIdler,StaticSingletonManager,ThreadLocalDetail}.{h,cpp}', 'folly/lang/SafeAssert.{h,cpp}', 'folly/memory/MallctlHelper.{h,cpp}', - 'folly/portability/SysUio.{h,cpp}' + 'folly/portability/{GFlags,SysUio}.{h,cpp}', + 'folly/chrono/Hardware.{h,cpp}' # TODO: Perhaps some of the wildcards above can be further trimmed down with some of these: # # 'folly/executors/{DrivableExecutor,InlineExecutor,QueuedImmediateExecutor,TimedDrivableExecutor}.{h,cpp}', diff --git a/third-party-podspecs/libevent.podspec b/third-party-podspecs/libevent.podspec index 000e39e50d7d3a..90209dbd74dc85 100644 --- a/third-party-podspecs/libevent.podspec +++ b/third-party-podspecs/libevent.podspec @@ -549,7 +549,7 @@ Pod::Spec.new do |spec| spec.homepage = "https://libevent.org" spec.license = { :type => "BSD 3-Clause", :file => "LICENSE" } spec.author = "Niels Provos and Nick Mathewson" - spec.platforms = { :osx => "10.13" } + spec.platforms = { :osx => "10.13", :ios => "10.0" } spec.source = { :git => "https://github.com/libevent/libevent.git", :tag => "release-#{spec.version}-stable" } spec.default_subspec = "core" spec.prepare_command = "touch evconfig-private.h; echo -e #{Shellwords.escape(CONFIG_WITHOUT_OPENSSL)} > include/event2/event-config.h" diff --git a/yarn.lock b/yarn.lock index f3f8342890bd62..70a3d365c506d4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3604,6 +3604,11 @@ has@^1.0.1, has@^1.0.3: dependencies: function-bind "^1.1.1" +hermes-engine-darwin@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/hermes-engine-darwin/-/hermes-engine-darwin-0.6.0.tgz#e27bd650846cf633d4efae79b1c4db6968c0d5f0" + integrity sha512-znPoqvRPiVJb94SJF6PyNIopp/EGXX9fjkKMKvp7QH5sW83Ly7togoSbqON6wTtTCyhVIOT/dF2RQMYvkl20uw== + hermes-engine@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/hermes-engine/-/hermes-engine-0.6.0.tgz#82c0738b89afb3253dcc4b322888a8bf0f52930b" From 1f3598d15dc9d0083da51db787e4d628ab2d5ebc Mon Sep 17 00:00:00 2001 From: grabbou Date: Wed, 9 Sep 2020 19:16:56 +0200 Subject: [PATCH 02/45] chore: update version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 865554ea14b73e..18f16d092d2991 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "event-target-shim": "^5.0.1", "fbjs-scripts": "^1.1.0", "hermes-engine": "~0.6.0", - "hermes-engine-darwin": "0.6.0", + "hermes-engine-darwin": "~0.6.0", "invariant": "^2.2.4", "jsc-android": "^245459.0.0", "metro-babel-register": "0.63.0", From 3aa3d951a10fbc743437adee5626e72a524d99ba Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Wed, 9 Sep 2020 19:21:29 +0200 Subject: [PATCH 03/45] Update gradlew.bat From 52bc83ae5f9be42ab0d93746f7ff8a65c935d5d2 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Tue, 15 Sep 2020 00:06:41 +0200 Subject: [PATCH 04/45] chore: release script tweaks --- .../RNTesterPods.xcodeproj/project.pbxproj | 2 +- scripts/hermes-binary.sh | 17 +++++++++++++++++ scripts/react-native-xcode.sh | 12 ++++-------- 3 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 scripts/hermes-binary.sh diff --git a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj index 2f830027f888cb..d7ab7703284981 100644 --- a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj +++ b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj @@ -589,7 +589,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export NODE_BINARY=node\nexport PROJECT_ROOT=$SRCROOT/..\nexport SOURCEMAP_FILE=../sourcemap.ios.map\n# export FORCE_BUNDLING=true\n\"$SRCROOT/../../scripts/react-native-xcode.sh\" $SRCROOT/../../packages/rn-tester/js/RNTesterApp.ios.js\n"; + shellScript = "export NODE_BINARY=node\nexport SOURCEMAP_FILE=../sourcemap.ios.map\n# export FORCE_BUNDLING=true\n\"$SRCROOT/../../scripts/react-native-xcode.sh\" $SRCROOT/../../packages/rn-tester/js/RNTesterApp.ios.js\n"; }; 7A5E3C3F59BF3EA884A39149 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; diff --git a/scripts/hermes-binary.sh b/scripts/hermes-binary.sh new file mode 100644 index 00000000000000..20ae8b679d2cf6 --- /dev/null +++ b/scripts/hermes-binary.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright (c) Facebook, Inc. and its affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +[ -z "$HERMES_PATH" ] && export HERMES_PATH="$REACT_NATIVE_DIR/../hermes-engine-darwin" + +export HERMES_CLI = "$HERMES_PATH/destroot/bin/hermesc" + +if [[ $USE_HERMES == true && ! -d "$HERMES_PATH" ]]; then + echo "error: Can't find Hermes executable - directory `$HERMES_PATH` doesn't exist. " \ + "If you have a non-standard project structure, select your project in Xcode, find " \ + "'Build Phases' - 'Bundle React Native code and images' and set `HERMES_PATH` to an " \ + "absolute path to a `hermes-engine-darwin` package inside your `node_modules`" >&2 + exit 2 +fi diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index 98743b168b6183..41a080b0898edf 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -116,14 +116,15 @@ REACT_NATIVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # shellcheck source=/dev/null source "$REACT_NATIVE_DIR/scripts/node-binary.sh" +# check and assign HERMES_CLI env +source "$REACT_NATIVE_DIR/scripts/hermes-binary.sh" + [ -z "$NODE_ARGS" ] && export NODE_ARGS="" [ -z "$CLI_PATH" ] && export CLI_PATH="$REACT_NATIVE_DIR/cli.js" [ -z "$BUNDLE_COMMAND" ] && BUNDLE_COMMAND="bundle" -[ -z "$HERMES_PATH" ] && HERMES_PATH="$PROJECT_ROOT/node_modules/hermes-engine-darwin/destroot/bin/hermesc" - [ -z "$COMPOSE_SOURCEMAP_PATH" ] && COMPOSE_SOURCEMAP_PATH="$REACT_NATIVE_DIR/scripts/compose-source-maps.js" if [[ -z "$BUNDLE_CONFIG" ]]; then @@ -145,11 +146,6 @@ case "$PLATFORM_NAME" in ;; esac -USE_HERMES= -if [[ "$BUNDLE_PLATFORM" == "macos" && -f "$HERMES_PATH" ]]; then - USE_HERMES=true -fi - EMIT_SOURCEMAP= if [[ ! -z "$SOURCEMAP_FILE" ]]; then EMIT_SOURCEMAP=true @@ -190,7 +186,7 @@ else EXTRA_COMPILER_ARGS="$EXTRA_COMPILER_ARGS -output-source-map" fi HBC_FILE="$CONFIGURATION_BUILD_DIR/$(basename $BUNDLE_FILE)" - "$HERMES_PATH" -emit-binary $EXTRA_COMPILER_ARGS -out "$HBC_FILE" "$BUNDLE_FILE" + "$HERMES_CLI" -emit-binary $EXTRA_COMPILER_ARGS -out "$HBC_FILE" "$BUNDLE_FILE" mv "$HBC_FILE" "$DEST/" BUNDLE_FILE="$DEST/main.jsbundle" if [[ $EMIT_SOURCEMAP == true ]]; then From 11112f6553d29fa698d369f7325785b83c78dc1a Mon Sep 17 00:00:00 2001 From: Frieder Bluemle Date: Fri, 4 Sep 2020 13:42:03 -0700 Subject: [PATCH 05/45] Remove .gitattributes and normalize line endings (#29792) Summary: The nested `.gitattributes` file in `packages/react-native-codegen/android/` caused some confusion on Linux and macOS, causing Git to show `packages/react-native-codegen/android/gradlew.bat` as modified (CRLF removed, LF added). Instead of relying on repo-local `.gitattributes` files to convert endings in the working directory, the files should be committed to source control with the correct line endings in the first place. There is no reason to convert LF endings in .sh and many other file to CRLF on Windows (maybe this was an issue a long time ago, but unless Notepad is used this won't be a problem for practically all modern editors). Also fixed the line endings of `scripts/launchPackager.bat` which was incorrectly committed as LF. ## Changelog [Internal] [Fixed] - Line endings and .gitattributes Pull Request resolved: https://github.com/facebook/react-native/pull/29792 Test Plan: Clone repo on Linux, macOS, and Windows, and make sure no modified files show up. Reviewed By: fkgozali Differential Revision: D23546135 Pulled By: mdvacca fbshipit-source-id: 1572fcb959212f212b137066f1aa66f0bb6e86c3 --- .gitattributes | 6 ----- .../android/.gitattributes | 6 ----- .../react-native-codegen/android/.gitignore | 5 ---- scripts/launchPackager.bat | 24 +++++++++---------- template/_gitattributes | 1 - 5 files changed, 12 insertions(+), 30 deletions(-) delete mode 100644 .gitattributes delete mode 100644 packages/react-native-codegen/android/.gitattributes delete mode 100644 packages/react-native-codegen/android/.gitignore delete mode 100644 template/_gitattributes diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 8f9372e008985a..00000000000000 --- a/.gitattributes +++ /dev/null @@ -1,6 +0,0 @@ -# Force LF line endings for Bash scripts. On Windows the rest of the source -# files will typically have CR+LF endings (Git default on Windows), but Bash -# scripts need to have LF endings to work (under Cygwin), thus override to force -# that. -gradlew text eol=lf -*.sh text eol=lf diff --git a/packages/react-native-codegen/android/.gitattributes b/packages/react-native-codegen/android/.gitattributes deleted file mode 100644 index 00a51aff5e5a83..00000000000000 --- a/packages/react-native-codegen/android/.gitattributes +++ /dev/null @@ -1,6 +0,0 @@ -# -# https://help.github.com/articles/dealing-with-line-endings/ -# -# These are explicitly windows files and should use crlf -*.bat text eol=crlf - diff --git a/packages/react-native-codegen/android/.gitignore b/packages/react-native-codegen/android/.gitignore deleted file mode 100644 index 1b6985c0094c8e..00000000000000 --- a/packages/react-native-codegen/android/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# Ignore Gradle project-specific cache directory -.gradle - -# Ignore Gradle build output directory -build diff --git a/scripts/launchPackager.bat b/scripts/launchPackager.bat index ce71959a16d046..aed322d7c530ce 100644 --- a/scripts/launchPackager.bat +++ b/scripts/launchPackager.bat @@ -1,12 +1,12 @@ -:: Copyright (c) Facebook, Inc. and its affiliates. -:: -:: This source code is licensed under the MIT license found in the -:: LICENSE file in the root directory of this source tree. - -@echo off -title Metro -call .packager.bat -cd ../../../ -node "%~dp0..\cli.js" start -pause -exit +:: Copyright (c) Facebook, Inc. and its affiliates. +:: +:: This source code is licensed under the MIT license found in the +:: LICENSE file in the root directory of this source tree. + +@echo off +title Metro +call .packager.bat +cd ../../../ +node "%~dp0..\cli.js" start +pause +exit diff --git a/template/_gitattributes b/template/_gitattributes deleted file mode 100644 index d42ff18354df61..00000000000000 --- a/template/_gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.pbxproj -text From f7592b080f392e90669ab68ae47e76c8880b5af7 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Tue, 15 Sep 2020 00:20:14 +0200 Subject: [PATCH 06/45] chore: update line endings after cherry-picking fix --- .../react-native-codegen/android/gradlew.bat | 178 +++++++++--------- 1 file changed, 89 insertions(+), 89 deletions(-) diff --git a/packages/react-native-codegen/android/gradlew.bat b/packages/react-native-codegen/android/gradlew.bat index 107acd32c4e687..ac1b06f93825db 100644 --- a/packages/react-native-codegen/android/gradlew.bat +++ b/packages/react-native-codegen/android/gradlew.bat @@ -1,89 +1,89 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega From 4b0920b3bc22dcae384fb1ec2b555d6515916df6 Mon Sep 17 00:00:00 2001 From: grabbou Date: Tue, 15 Sep 2020 17:32:45 +0200 Subject: [PATCH 07/45] chore: remove `hermes-binary.sh` file --- scripts/hermes-binary.sh | 17 ----------------- scripts/react-native-xcode.sh | 13 +++++++++++-- 2 files changed, 11 insertions(+), 19 deletions(-) delete mode 100644 scripts/hermes-binary.sh diff --git a/scripts/hermes-binary.sh b/scripts/hermes-binary.sh deleted file mode 100644 index 20ae8b679d2cf6..00000000000000 --- a/scripts/hermes-binary.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# Copyright (c) Facebook, Inc. and its affiliates. -# -# This source code is licensed under the MIT license found in the -# LICENSE file in the root directory of this source tree. - -[ -z "$HERMES_PATH" ] && export HERMES_PATH="$REACT_NATIVE_DIR/../hermes-engine-darwin" - -export HERMES_CLI = "$HERMES_PATH/destroot/bin/hermesc" - -if [[ $USE_HERMES == true && ! -d "$HERMES_PATH" ]]; then - echo "error: Can't find Hermes executable - directory `$HERMES_PATH` doesn't exist. " \ - "If you have a non-standard project structure, select your project in Xcode, find " \ - "'Build Phases' - 'Bundle React Native code and images' and set `HERMES_PATH` to an " \ - "absolute path to a `hermes-engine-darwin` package inside your `node_modules`" >&2 - exit 2 -fi diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index 41a080b0898edf..a148a055ae74e1 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -116,8 +116,17 @@ REACT_NATIVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # shellcheck source=/dev/null source "$REACT_NATIVE_DIR/scripts/node-binary.sh" -# check and assign HERMES_CLI env -source "$REACT_NATIVE_DIR/scripts/hermes-binary.sh" +[ -z "$HERMES_PATH" ] && export HERMES_PATH="$REACT_NATIVE_DIR/../hermes-engine-darwin" + +export HERMES_CLI = "$HERMES_PATH/destroot/bin/hermesc" + +if [[ $USE_HERMES == true && ! -d "$HERMES_PATH" ]]; then + echo "error: Can't find Hermes executable - directory `$HERMES_PATH` doesn't exist. " \ + "If you have a non-standard project structure, select your project in Xcode, find " \ + "'Build Phases' - 'Bundle React Native code and images' and set `HERMES_PATH` to " \ + "a `hermes-engine-darwin` package inside your `node_modules`" >&2 + exit 2 +fi [ -z "$NODE_ARGS" ] && export NODE_ARGS="" From cb01604e09403e0738311060a26375333dca5b39 Mon Sep 17 00:00:00 2001 From: grabbou Date: Tue, 15 Sep 2020 18:06:05 +0200 Subject: [PATCH 08/45] fix: bundling RNTester in release mode --- .../rn-tester/RNTesterPods.xcodeproj/project.pbxproj | 4 ++-- scripts/react-native-xcode.sh | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj index d016225e43ac48..8799a570beb51e 100644 --- a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj +++ b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj @@ -164,7 +164,7 @@ E7DB215F22B2F3EC005AC45F /* RCTUIManagerScenarioTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUIManagerScenarioTests.m; sourceTree = ""; }; E7DB216022B2F3EC005AC45F /* RNTesterSnapshotTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNTesterSnapshotTests.m; sourceTree = ""; }; E7DB216122B2F3EC005AC45F /* RCTRootViewIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRootViewIntegrationTests.m; sourceTree = ""; }; - E7DB218B22B41FCD005AC45F /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = XCTest.framework; sourceTree = DEVELOPER_DIR; }; + E7DB218B22B41FCD005AC45F /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = XCTest.framework; sourceTree = DEVELOPER_DIR; }; E9618482EC8608D4872A6E28 /* Pods-RNTesterUnitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterUnitTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -589,7 +589,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export NODE_BINARY=node\nexport SOURCEMAP_FILE=../sourcemap.ios.map\n# export FORCE_BUNDLING=true\n\"$SRCROOT/../../scripts/react-native-xcode.sh\" $SRCROOT/../../packages/rn-tester/js/RNTesterApp.ios.js\n"; + shellScript = "export NODE_BINARY=node\nexport SOURCEMAP_FILE=../sourcemap.ios.map\nexport FORCE_BUNDLING=true\nexport USE_HERMES=true\nexport PROJECT_ROOT=\"$SRCROOT/../../\"\nexport HERMES_PATH=\"$SRCROOT/../../node_modules/hermes-engine-darwin\"\n\"$SRCROOT/../../scripts/react-native-xcode.sh\" $SRCROOT/../../packages/rn-tester/js/RNTesterApp.ios.js\n"; }; 7A5E3C3F59BF3EA884A39149 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index a148a055ae74e1..bba04d66e8b0c2 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -118,10 +118,10 @@ source "$REACT_NATIVE_DIR/scripts/node-binary.sh" [ -z "$HERMES_PATH" ] && export HERMES_PATH="$REACT_NATIVE_DIR/../hermes-engine-darwin" -export HERMES_CLI = "$HERMES_PATH/destroot/bin/hermesc" +export HERMES_CLI="$HERMES_PATH/destroot/bin/hermesc" if [[ $USE_HERMES == true && ! -d "$HERMES_PATH" ]]; then - echo "error: Can't find Hermes executable - directory `$HERMES_PATH` doesn't exist. " \ + echo "error: Can't find Hermes executable - directory $HERMES_PATH doesn't exist. " \ "If you have a non-standard project structure, select your project in Xcode, find " \ "'Build Phases' - 'Bundle React Native code and images' and set `HERMES_PATH` to " \ "a `hermes-engine-darwin` package inside your `node_modules`" >&2 @@ -194,14 +194,12 @@ else if [[ $EMIT_SOURCEMAP == true ]]; then EXTRA_COMPILER_ARGS="$EXTRA_COMPILER_ARGS -output-source-map" fi - HBC_FILE="$CONFIGURATION_BUILD_DIR/$(basename $BUNDLE_FILE)" - "$HERMES_CLI" -emit-binary $EXTRA_COMPILER_ARGS -out "$HBC_FILE" "$BUNDLE_FILE" - mv "$HBC_FILE" "$DEST/" - BUNDLE_FILE="$DEST/main.jsbundle" + "$HERMES_CLI" -emit-binary $EXTRA_COMPILER_ARGS -out "$DEST/main.jsbundle" "$BUNDLE_FILE" if [[ $EMIT_SOURCEMAP == true ]]; then - HBC_SOURCEMAP_FILE="$HBC_FILE.map" + HBC_SOURCEMAP_FILE="$BUNDLE_FILE.map" "$NODE_BINARY" "$COMPOSE_SOURCEMAP_PATH" "$PACKAGER_SOURCEMAP_FILE" "$HBC_SOURCEMAP_FILE" -o "$SOURCEMAP_FILE" fi + BUNDLE_FILE="$DEST/main.jsbundle" fi if [[ $DEV != true && ! -f "$BUNDLE_FILE" ]]; then From 942d009fb236b2b28c0f13fe9123623e54002f81 Mon Sep 17 00:00:00 2001 From: grabbou Date: Tue, 15 Sep 2020 18:22:48 +0200 Subject: [PATCH 09/45] chore: updating wording --- scripts/react-native-xcode.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index bba04d66e8b0c2..b07ff4a33fe82c 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -122,9 +122,9 @@ export HERMES_CLI="$HERMES_PATH/destroot/bin/hermesc" if [[ $USE_HERMES == true && ! -d "$HERMES_PATH" ]]; then echo "error: Can't find Hermes executable - directory $HERMES_PATH doesn't exist. " \ - "If you have a non-standard project structure, select your project in Xcode, find " \ - "'Build Phases' - 'Bundle React Native code and images' and set `HERMES_PATH` to " \ - "a `hermes-engine-darwin` package inside your `node_modules`" >&2 + "If you have a non-standard project structure, locate the 'Bundle React Native code and images' " \ + "build phase in your Xcode project and set the `$HERMES_PATH` variable to the location of the " \ + "hermes-engine-darwin package. For example: `$SRCROOT/../../node_modules/hermes-engine-darwin` " >&2 exit 2 fi From 52c8c2f5213d44c9cfef06d315c5535252b69d2b Mon Sep 17 00:00:00 2001 From: grabbou Date: Tue, 15 Sep 2020 18:27:11 +0200 Subject: [PATCH 10/45] chore: do not force bundling, reverting previous changes meant for testing --- packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj index 8799a570beb51e..2c1f16798b6bed 100644 --- a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj +++ b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj @@ -589,7 +589,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export NODE_BINARY=node\nexport SOURCEMAP_FILE=../sourcemap.ios.map\nexport FORCE_BUNDLING=true\nexport USE_HERMES=true\nexport PROJECT_ROOT=\"$SRCROOT/../../\"\nexport HERMES_PATH=\"$SRCROOT/../../node_modules/hermes-engine-darwin\"\n\"$SRCROOT/../../scripts/react-native-xcode.sh\" $SRCROOT/../../packages/rn-tester/js/RNTesterApp.ios.js\n"; + shellScript = "export NODE_BINARY=node\nexport SOURCEMAP_FILE=../sourcemap.ios.map\nexport USE_HERMES=true\nexport PROJECT_ROOT=\"$SRCROOT/../../\"\nexport HERMES_PATH=\"$SRCROOT/../../node_modules/hermes-engine-darwin\"\n\"$SRCROOT/../../scripts/react-native-xcode.sh\" $SRCROOT/../../packages/rn-tester/js/RNTesterApp.ios.js\n"; }; 7A5E3C3F59BF3EA884A39149 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; From 6afacda2fdf16dafb2ea652d7064dfcd7f09258c Mon Sep 17 00:00:00 2001 From: grabbou Date: Thu, 17 Sep 2020 12:04:54 +0200 Subject: [PATCH 11/45] Revert "feat: improve monorepo support by removing redundant PROJECT_ROOT (#28354)" This reverts commit a8e85026cfa60056b1bcbcd39cde789e4d65f9cb. --- scripts/react-native-xcode.sh | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index b07ff4a33fe82c..d4905e7790a41e 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -56,17 +56,11 @@ case "$CONFIGURATION" in ;; esac -# Setting up a project root was a workaround to enable support for non-standard -# structures, including monorepos. Today, CLI supports that out of the box -# and setting custom `PROJECT_ROOT` only makes it confusing. -# -# As a backwards-compatible change, I am leaving "PROJECT_ROOT" support for those -# who already use it - it is likely a non-breaking removal. -# -# For new users, we default to $PWD - not changing things all. -# -# For context: https://github.com/facebook/react-native/commit/9ccde378b6e6379df61f9d968be6346ca6be7ead#commitcomment-37914902 -PROJECT_ROOT=${PROJECT_ROOT:-$PWD} +# Path to react-native folder inside node_modules +REACT_NATIVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +# The project should be located next to where react-native is installed +# in node_modules. +PROJECT_ROOT=${PROJECT_ROOT:-"$REACT_NATIVE_DIR/../.."} cd "$PROJECT_ROOT" || exit @@ -109,9 +103,6 @@ if [[ ! -x node && -d ${HOME}/.anyenv/bin ]]; then fi fi -# Path to react-native folder inside node_modules -REACT_NATIVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" - # check and assign NODE_BINARY env # shellcheck source=/dev/null source "$REACT_NATIVE_DIR/scripts/node-binary.sh" From 15a2b9c9ecd7fc8d448dbf21c0d1f71f11dedb0e Mon Sep 17 00:00:00 2001 From: grabbou Date: Thu, 17 Sep 2020 15:19:44 +0200 Subject: [PATCH 12/45] fix: running RNTester and other apps in RELEASE --- third-party-podspecs/RCT-Folly.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party-podspecs/RCT-Folly.podspec b/third-party-podspecs/RCT-Folly.podspec index 903cb048d4f420..de7f5bca547897 100644 --- a/third-party-podspecs/RCT-Folly.podspec +++ b/third-party-podspecs/RCT-Folly.podspec @@ -107,7 +107,7 @@ Pod::Spec.new do |spec| 'folly/io/{Cursor,Cursor-inl,IOBuf,IOBufQueue}.{h,cpp}', 'folly/tracing/StaticTracepoint.{h,cpp}', 'folly/{Executor,ExceptionWrapper,ExceptionWrapper-inl,FileUtil,Singleton,SharedMutex}.{h,cpp}', - 'folly/detail/{AtFork,Futex,Futex-inl,MemoryIdler,StaticSingletonManager,ThreadLocalDetail}.{h,cpp}', + 'folly/detail/{AsyncTrace,AtFork,Futex,Futex-inl,MemoryIdler,StaticSingletonManager,ThreadLocalDetail}.{h,cpp}', 'folly/lang/SafeAssert.{h,cpp}', 'folly/memory/MallctlHelper.{h,cpp}', 'folly/portability/{GFlags,SysUio}.{h,cpp}', From 16452d0c7509a839a3887a8e26a6147a0060e132 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Wed, 7 Oct 2020 13:02:03 +0200 Subject: [PATCH 13/45] fix folly errors --- third-party-podspecs/RCT-Folly.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party-podspecs/RCT-Folly.podspec b/third-party-podspecs/RCT-Folly.podspec index de7f5bca547897..eb3eeb8f59f9af 100644 --- a/third-party-podspecs/RCT-Folly.podspec +++ b/third-party-podspecs/RCT-Folly.podspec @@ -124,5 +124,5 @@ Pod::Spec.new do |spec| end # Pinning to the same version as React.podspec. - spec.platforms = { :ios => "10.0", :tvos => "10.0" } + spec.platforms = { :ios => "9.0", :tvos => "9.0" } end From 8c86ae74b94a1628796f1e9c6c4596afd2b282d0 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Wed, 7 Oct 2020 13:05:29 +0200 Subject: [PATCH 14/45] chore: remove comment --- third-party-podspecs/RCT-Folly.podspec | 1 - 1 file changed, 1 deletion(-) diff --git a/third-party-podspecs/RCT-Folly.podspec b/third-party-podspecs/RCT-Folly.podspec index eb3eeb8f59f9af..45fdcf47d24348 100644 --- a/third-party-podspecs/RCT-Folly.podspec +++ b/third-party-podspecs/RCT-Folly.podspec @@ -123,6 +123,5 @@ Pod::Spec.new do |spec| # 'folly/experimental/{ReadMostlySharedPtr,TLRefCount}.h', end - # Pinning to the same version as React.podspec. spec.platforms = { :ios => "9.0", :tvos => "9.0" } end From e2b296856b6261946c6b80ac4004a8ce8bbba54f Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Tue, 13 Oct 2020 12:57:56 +0200 Subject: [PATCH 15/45] feat: use CocoaPods hermes-engine instead of npm package --- React-Core.podspec | 2 +- packages/rn-tester/Podfile | 2 +- packages/rn-tester/Podfile.lock | 69 ++++++++++++++++----------------- scripts/react_native_pods.rb | 3 +- 4 files changed, 37 insertions(+), 39 deletions(-) diff --git a/React-Core.podspec b/React-Core.podspec index a06a7258eb2216..fe5a7a43dc23ff 100644 --- a/React-Core.podspec +++ b/React-Core.podspec @@ -77,7 +77,7 @@ Pod::Spec.new do |s| "ReactCommon/hermes/inspector/detail/*.{cpp,h}" ss.pod_target_xcconfig = { "GCC_PREPROCESSOR_DEFINITIONS" => "HERMES_ENABLE_DEBUGGER=1" } ss.dependency "RCT-Folly/Futures" - ss.dependency "hermes" + ss.dependency "hermes-engine" end s.subspec "DevSupport" do |ss| diff --git a/packages/rn-tester/Podfile b/packages/rn-tester/Podfile index 1e9f5f8708148b..5e9f666979dd14 100644 --- a/packages/rn-tester/Podfile +++ b/packages/rn-tester/Podfile @@ -13,7 +13,7 @@ def pods() # Enable TurboModule prefix_path = "../.." - use_react_native!(path: prefix_path, hermes_enabled: true, hermes_path: "#{prefix_path}/../hermes") + use_react_native!(path: prefix_path, hermes_enabled: true) pod 'ReactCommon/turbomodule/samples', :path => "#{prefix_path}/ReactCommon" # Additional Pods which aren't included in the default Podfile diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index 4b75a89221aede..d119d185571c1a 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -58,7 +58,7 @@ PODS: - FlipperKit/Core - FlipperKit/FlipperKitNetworkPlugin - glog (0.3.5) - - hermes (0.6.0) + - hermes-engine (0.7.1) - libevent (2.1.11): - libevent/core (= 2.1.11) - libevent/core (2.1.11): @@ -140,7 +140,7 @@ PODS: - Yoga - React-Core/Hermes (1000.0.0): - glog - - hermes (= 0.6.0) + - hermes-engine - RCT-Folly (= 2020.01.13.00) - RCT-Folly/Futures - React-cxxreact (= 1000.0.0) @@ -398,7 +398,7 @@ DEPENDENCIES: - FlipperKit/FlipperKitUserDefaultsPlugin (~> 0.41.1) - FlipperKit/SKIOSNetworkPlugin (~> 0.41.1) - glog (from `../../third-party-podspecs/glog.podspec`) - - hermes (from `../../../hermes`) + - hermes-engine - libevent (from `../../third-party-podspecs/libevent.podspec`) - RCT-Folly (from `../../third-party-podspecs/RCT-Folly.podspec`) - RCTRequired (from `../../Libraries/RCTRequired`) @@ -443,6 +443,7 @@ SPEC REPOS: - Flipper-PeerTalk - Flipper-RSocket - FlipperKit + - hermes-engine - OpenSSL-Universal - YogaKit @@ -455,8 +456,6 @@ EXTERNAL SOURCES: :path: "../../Libraries/FBReactNativeSpec" glog: :podspec: "../../third-party-podspecs/glog.podspec" - hermes: - :path: "../../../hermes" libevent: :podspec: "../../third-party-podspecs/libevent.podspec" RCT-Folly: @@ -517,8 +516,8 @@ SPEC CHECKSUMS: CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845 CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f DoubleConversion: cde416483dac037923206447da6e1454df403714 - FBLazyVector: d8559264d893d9f9025342901fb5e2062a374326 - FBReactNativeSpec: 36ff6fbd846ad7af3093cad662419850a00a87d6 + FBLazyVector: 305e57cb1b2b8afa163782a3bb98daaabb2296d2 + FBReactNativeSpec: c292982ec50a7da6c88f7ed99efd45f8e951525d Flipper: 33585e2d9810fe5528346be33bcf71b37bb7ae13 Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41 Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3 @@ -527,37 +526,37 @@ SPEC CHECKSUMS: Flipper-RSocket: 64e7431a55835eb953b0bf984ef3b90ae9fdddd7 FlipperKit: bc68102cd4952a258a23c9c1b316c7bec1fecf83 glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3 - hermes: 247372059d167f28c6fe29c2e106d71524fd8ca6 + hermes-engine: 2d25059126292d4375a46b65704767b3b0f529aa libevent: f1c51c1e883112c92d1247a63c1c4c0f4a56618e OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355 - RCT-Folly: 0039f155eba2e17778f9a1f82f09f05534eb6bca - RCTRequired: e76acf4b1cb7d52cf44073c5e188fea6c444ad62 - RCTTypeSafety: 51b83e8b893ce9f745a82f2b4c40f3d74bf15d1b - React: 48d355deb8f4b49f19c9cd90307bd7e69d470389 - React-callinvoker: d3b98dab5eb0c0027e04ae0d957134d5e96f8ed0 - React-Core: 4c3f6131e59a5b93388413e8ce84840e64547219 - React-CoreModules: ffd2835a7e01200fc9441235e6fbc846bf057f0e - React-cxxreact: 59e4466f636f21f8eaa5d84135a6198100a8c63d - React-jsi: 793bd16dd6643ca4ae27f045856acb313755a830 - React-jsiexecutor: d5d7c440c962c4a5bddec639fa738f998b57163f - React-jsinspector: 1a3054d8cbaaeed06ff5407606d312fc907cb87d - React-perflogger: 0e1e8275b3316a543aa5722402406cb909b713c6 - React-RCTActionSheet: 2bce31955fc8bec0a01585376805feaee8fc2fac - React-RCTAnimation: 3a0218b32cea46bf90b4609b1360f9e72310dc02 - React-RCTBlob: b0a7fa90ec9391911581d95a8eb2459e232bf60c - React-RCTImage: 461292bb164f1571cecd593ee5c4aea9de01d43b - React-RCTLinking: 0649a8169dbdf027d7c6f508297b31e1b8e9a27b - React-RCTNetwork: 799515eb61a1d8a372ef3bcb85e0c090b60ff5eb - React-RCTPushNotification: 07ca0a50616a98009170a0de35a983c073ebf78b - React-RCTSettings: 935548505ead7968b17e3767ca51c5ef42205133 - React-RCTTest: 7bbe5100ef69cc0f58d965350d65e7487f142d5d - React-RCTText: 9720bd7e288e97d3261d8acdbfb8ccd673e56ade - React-RCTVibration: fb01cb9bca35f3ed8c8a974fff16ba537d7d62c5 - React-runtimeexecutor: 4a8a170e300916a7f4dbf9abf3c1652bb266f3a9 - ReactCommon: 718fec5e1d2fe08464a8a5ffcb5e7429a7a12d89 - Yoga: 33055d49e2a310d04fc5ac2263db2849672a8df1 + RCT-Folly: 5e30358ace2d9ed239e59155e177d684b29e2fb3 + RCTRequired: 89ac436c12682f7e872e54cc0f54fac81da9f242 + RCTTypeSafety: ac74d4545bf878b01b688cfdc75647de5ab28db9 + React: e1de6f94a62f0f21099a802fe83117713ba2189d + React-callinvoker: e4b349e7b85996cb4e959f07680964dd94d84e3f + React-Core: 4d0bc8856464e5ed14d2a32e9a6ac8f52d3d37f4 + React-CoreModules: 3e85dd381bc15d87f76d26037783950f1374f288 + React-cxxreact: d0eeedbd36b2160a8ca5e0c6746b7db1abc313d1 + React-jsi: 87b55b4d41e4cca4aca008f20530966b3e84ac21 + React-jsiexecutor: e25fd61c7a45a3ba74f5ec69709a4597c5f8d1b2 + React-jsinspector: 9a8503d9abf340a1590b9677252f8147029fd197 + React-perflogger: 1a21841547e264ebc7cef0cce9b7f6ddacb61e50 + React-RCTActionSheet: 47765c64772fd17588f5a13e33da854ee30f7f42 + React-RCTAnimation: a17b6321df7ddab673a19a96096fa978ea0aa965 + React-RCTBlob: f9cfe08bb7b2c6fbde71a69c20a80ad49aaa4fdf + React-RCTImage: b15f21189ec8f8f0e8411d5697829d7d6b77926e + React-RCTLinking: 7b1179c86cb356159f7e0e67de85fa0874ff7c1e + React-RCTNetwork: 218a37f03fd4e6d00be1110d9aec9cd30499baf5 + React-RCTPushNotification: 506482be3fe6fda0e4f088424e5a85ad8b1d0ee6 + React-RCTSettings: c30a64e46eda9359cf49145a9f9488efd6720824 + React-RCTTest: b862b8da8119ac425ace083353dde7900f3934d7 + React-RCTText: e40b940fff7a72f4e3169211e85877d3dc332529 + React-RCTVibration: 5a02290cd56473b24295c539c7552d0c77c22ca5 + React-runtimeexecutor: 9535bb4dfa37d322e957ad9b20a55c02b03624c3 + ReactCommon: 1c096140e4810339a11143e2e29289782a0b7ffa + Yoga: 46372d29b2e4aa37781fc57aba5dca155facbf58 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: 7bdc31b746ec6c1684a9a8287ed8962d28a1a4ab +PODFILE CHECKSUM: 3da6fbc4e0b6365a0c74d0730e1e4a2873d505b0 COCOAPODS: 1.9.3 diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index ffdbfee75bfe1a..1ecce02eb590e7 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -6,7 +6,6 @@ def use_react_native! (options={}) # The prefix to the react-native prefix = options[:path] ||= "../node_modules/react-native" - hermes_engine_prefix = options[:hermes_path] ||= "../node_modules/hermes-engine-darwin" # Include Fabric dependencies fabric_enabled = options[:fabric_enabled] ||= false @@ -64,7 +63,7 @@ def use_react_native! (options={}) if hermes_enabled pod 'React-Core/Hermes', :path => "#{prefix}/" - pod 'hermes', :path => hermes_engine_prefix + pod 'hermes-engine' pod 'libevent', :podspec => "#{prefix}/third-party-podspecs/libevent.podspec" end end From 7310c8a47043178a504ebc5f16083bc4bebead25 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Fri, 23 Oct 2020 10:55:18 +0200 Subject: [PATCH 16/45] chore: remove all occurences of `hermes-engine-darwin` --- package.json | 1 - packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj | 2 +- scripts/react-native-xcode.sh | 6 +++--- yarn.lock | 5 ----- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index bc5dd1363ed009..34260b816a895d 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,6 @@ "event-target-shim": "^5.0.1", "fbjs-scripts": "^1.1.0", "hermes-engine": "~0.6.0", - "hermes-engine-darwin": "~0.6.0", "invariant": "^2.2.4", "jsc-android": "^245459.0.0", "metro-babel-register": "0.63.0", diff --git a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj index 2c1f16798b6bed..805ef0a07569e0 100644 --- a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj +++ b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj @@ -589,7 +589,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export NODE_BINARY=node\nexport SOURCEMAP_FILE=../sourcemap.ios.map\nexport USE_HERMES=true\nexport PROJECT_ROOT=\"$SRCROOT/../../\"\nexport HERMES_PATH=\"$SRCROOT/../../node_modules/hermes-engine-darwin\"\n\"$SRCROOT/../../scripts/react-native-xcode.sh\" $SRCROOT/../../packages/rn-tester/js/RNTesterApp.ios.js\n"; + shellScript = "export NODE_BINARY=node\nexport SOURCEMAP_FILE=../sourcemap.ios.map\nexport USE_HERMES=true\nexport PROJECT_ROOT=\"$SRCROOT/../../\"\nexport HERMES_PATH=\"$SRCROOT/../../node_modules/hermes-engine\"\n\"$SRCROOT/../../scripts/react-native-xcode.sh\" $SRCROOT/../../packages/rn-tester/js/RNTesterApp.ios.js\n"; }; 7A5E3C3F59BF3EA884A39149 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index d4905e7790a41e..ee4aef09f5ebef 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -107,15 +107,15 @@ fi # shellcheck source=/dev/null source "$REACT_NATIVE_DIR/scripts/node-binary.sh" -[ -z "$HERMES_PATH" ] && export HERMES_PATH="$REACT_NATIVE_DIR/../hermes-engine-darwin" +[ -z "$HERMES_PATH" ] && export HERMES_PATH="$REACT_NATIVE_DIR/../hermes-engine" -export HERMES_CLI="$HERMES_PATH/destroot/bin/hermesc" +export HERMES_CLI="$HERMES_PATH/osx-bin/hermesc" if [[ $USE_HERMES == true && ! -d "$HERMES_PATH" ]]; then echo "error: Can't find Hermes executable - directory $HERMES_PATH doesn't exist. " \ "If you have a non-standard project structure, locate the 'Bundle React Native code and images' " \ "build phase in your Xcode project and set the `$HERMES_PATH` variable to the location of the " \ - "hermes-engine-darwin package. For example: `$SRCROOT/../../node_modules/hermes-engine-darwin` " >&2 + "hermes-engine package. For example: `$SRCROOT/../../node_modules/hermes-engine` " >&2 exit 2 fi diff --git a/yarn.lock b/yarn.lock index 19dd23ad8a49a6..0d013d0483564c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3604,11 +3604,6 @@ has@^1.0.1, has@^1.0.3: dependencies: function-bind "^1.1.1" -hermes-engine-darwin@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/hermes-engine-darwin/-/hermes-engine-darwin-0.6.0.tgz#e27bd650846cf633d4efae79b1c4db6968c0d5f0" - integrity sha512-znPoqvRPiVJb94SJF6PyNIopp/EGXX9fjkKMKvp7QH5sW83Ly7togoSbqON6wTtTCyhVIOT/dF2RQMYvkl20uw== - hermes-engine@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/hermes-engine/-/hermes-engine-0.6.0.tgz#82c0738b89afb3253dcc4b322888a8bf0f52930b" From c2adc846bbe59d8a5ceff166437d80311b8c3682 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Fri, 23 Oct 2020 11:03:34 +0200 Subject: [PATCH 17/45] chore: lock updates --- packages/rn-tester/Podfile.lock | 56 ++++++++++++++++----------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index d119d185571c1a..285d01b9450eda 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -516,8 +516,8 @@ SPEC CHECKSUMS: CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845 CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f DoubleConversion: cde416483dac037923206447da6e1454df403714 - FBLazyVector: 305e57cb1b2b8afa163782a3bb98daaabb2296d2 - FBReactNativeSpec: c292982ec50a7da6c88f7ed99efd45f8e951525d + FBLazyVector: e924d1711aa99fb5bd365c78872f4ec7df28bbd0 + FBReactNativeSpec: 93cbe1bf6e56e2546b6d3980352ac84d1f3af88f Flipper: 33585e2d9810fe5528346be33bcf71b37bb7ae13 Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41 Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3 @@ -530,33 +530,33 @@ SPEC CHECKSUMS: libevent: f1c51c1e883112c92d1247a63c1c4c0f4a56618e OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355 RCT-Folly: 5e30358ace2d9ed239e59155e177d684b29e2fb3 - RCTRequired: 89ac436c12682f7e872e54cc0f54fac81da9f242 - RCTTypeSafety: ac74d4545bf878b01b688cfdc75647de5ab28db9 - React: e1de6f94a62f0f21099a802fe83117713ba2189d - React-callinvoker: e4b349e7b85996cb4e959f07680964dd94d84e3f - React-Core: 4d0bc8856464e5ed14d2a32e9a6ac8f52d3d37f4 - React-CoreModules: 3e85dd381bc15d87f76d26037783950f1374f288 - React-cxxreact: d0eeedbd36b2160a8ca5e0c6746b7db1abc313d1 - React-jsi: 87b55b4d41e4cca4aca008f20530966b3e84ac21 - React-jsiexecutor: e25fd61c7a45a3ba74f5ec69709a4597c5f8d1b2 - React-jsinspector: 9a8503d9abf340a1590b9677252f8147029fd197 - React-perflogger: 1a21841547e264ebc7cef0cce9b7f6ddacb61e50 - React-RCTActionSheet: 47765c64772fd17588f5a13e33da854ee30f7f42 - React-RCTAnimation: a17b6321df7ddab673a19a96096fa978ea0aa965 - React-RCTBlob: f9cfe08bb7b2c6fbde71a69c20a80ad49aaa4fdf - React-RCTImage: b15f21189ec8f8f0e8411d5697829d7d6b77926e - React-RCTLinking: 7b1179c86cb356159f7e0e67de85fa0874ff7c1e - React-RCTNetwork: 218a37f03fd4e6d00be1110d9aec9cd30499baf5 - React-RCTPushNotification: 506482be3fe6fda0e4f088424e5a85ad8b1d0ee6 - React-RCTSettings: c30a64e46eda9359cf49145a9f9488efd6720824 - React-RCTTest: b862b8da8119ac425ace083353dde7900f3934d7 - React-RCTText: e40b940fff7a72f4e3169211e85877d3dc332529 - React-RCTVibration: 5a02290cd56473b24295c539c7552d0c77c22ca5 - React-runtimeexecutor: 9535bb4dfa37d322e957ad9b20a55c02b03624c3 - ReactCommon: 1c096140e4810339a11143e2e29289782a0b7ffa - Yoga: 46372d29b2e4aa37781fc57aba5dca155facbf58 + RCTRequired: 0357886559c3268e012bc9632b5b91d1315e82d2 + RCTTypeSafety: 0bf552be67442eb1e6acb8073f4f09eef7305cdb + React: a8fce3d43a07cb0a4305a09eee5a0b07f6e2c2d3 + React-callinvoker: e1a329e08106730e9c3a88b622f94ecfa6ff7366 + React-Core: fc9a2720e0a303d49b2b81e69cabf68d7de77da2 + React-CoreModules: 07a9ef171b449517951fd4ecf3493537cadbce95 + React-cxxreact: 41806ffcbae8dcf1c0d8177aeebd65f20cadb5c0 + React-jsi: 942ab492c4d7037234496849bd1f19221098aee0 + React-jsiexecutor: 082ec309f5966c4355f1a28834fe5b1cf87066cf + React-jsinspector: a0f8a3c0ff517bab1a0d1676653dbcb7bc28ffcf + React-perflogger: a55eb5a43ffcc71dad54198dfc46bca92ec603b8 + React-RCTActionSheet: 4a6d637bd7c8bcabe5c25d5eb53fd345bb521a6b + React-RCTAnimation: 5a9e2816bbb055c744459407f5f139499ac4a457 + React-RCTBlob: 67969651171f120a67c1ef2e29c032575121ac11 + React-RCTImage: 3da6160ff6eac0a7254f516877835a3a392a2e6f + React-RCTLinking: ca06c70eb0b2c6739913d26e0da61ce4e4b21d6e + React-RCTNetwork: db32941c3d23ca0e74e0ec55b93a871285ae225b + React-RCTPushNotification: 7ee92fa3956e8ac0632d481e690977bb67d36b03 + React-RCTSettings: f66a4cd3b5261c6f21da1da748f964cdb703a33b + React-RCTTest: b45120c05cf0e3a8e7c5fac94c2e996cf9073e64 + React-RCTText: 55d044f93276c82fd4e72c6bc30686f27566ab8a + React-RCTVibration: e5549af2fbffad14d25d68f41ca90e38dcebba98 + React-runtimeexecutor: ed4291b9f76d6dbed6d758759bde6303a9e357ad + ReactCommon: dd19690749952f0818ecf85363b916423f8a62de + Yoga: 300b6ed9ce71fad32c7c2a3e0a3d94c3ed9a9c53 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: 3da6fbc4e0b6365a0c74d0730e1e4a2873d505b0 +PODFILE CHECKSUM: 62736d272a364609e2128a3f2710122588b5012e COCOAPODS: 1.9.3 From bb6c4561180e72c6910e295e1e928b6f8741c4f2 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Fri, 23 Oct 2020 11:10:22 +0200 Subject: [PATCH 18/45] chore: update comment on a wkroarund --- third-party-podspecs/RCT-Folly.podspec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/third-party-podspecs/RCT-Folly.podspec b/third-party-podspecs/RCT-Folly.podspec index 45fdcf47d24348..06cb31c76cdf70 100644 --- a/third-party-podspecs/RCT-Folly.podspec +++ b/third-party-podspecs/RCT-Folly.podspec @@ -123,5 +123,7 @@ Pod::Spec.new do |spec| # 'folly/experimental/{ReadMostlySharedPtr,TLRefCount}.h', end + # Folly has issues when compiled with iOS 10 set as deployment target + # See https://github.com/facebook/folly/issues/1470 for details spec.platforms = { :ios => "9.0", :tvos => "9.0" } end From a76043838041e898a120dd6517b240ed44d860a3 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Fri, 23 Oct 2020 11:15:04 +0200 Subject: [PATCH 19/45] Revert "Revert "feat: improve monorepo support by removing redundant PROJECT_ROOT (#28354)"" This reverts commit 6afacda2fdf16dafb2ea652d7064dfcd7f09258c. --- scripts/react-native-xcode.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index ee4aef09f5ebef..699fa5651d16f6 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -56,11 +56,17 @@ case "$CONFIGURATION" in ;; esac -# Path to react-native folder inside node_modules -REACT_NATIVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" -# The project should be located next to where react-native is installed -# in node_modules. -PROJECT_ROOT=${PROJECT_ROOT:-"$REACT_NATIVE_DIR/../.."} +# Setting up a project root was a workaround to enable support for non-standard +# structures, including monorepos. Today, CLI supports that out of the box +# and setting custom `PROJECT_ROOT` only makes it confusing. +# +# As a backwards-compatible change, I am leaving "PROJECT_ROOT" support for those +# who already use it - it is likely a non-breaking removal. +# +# For new users, we default to $PWD - not changing things all. +# +# For context: https://github.com/facebook/react-native/commit/9ccde378b6e6379df61f9d968be6346ca6be7ead#commitcomment-37914902 +PROJECT_ROOT=${PROJECT_ROOT:-$PWD} cd "$PROJECT_ROOT" || exit @@ -103,6 +109,9 @@ if [[ ! -x node && -d ${HOME}/.anyenv/bin ]]; then fi fi +# Path to react-native folder inside node_modules +REACT_NATIVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" + # check and assign NODE_BINARY env # shellcheck source=/dev/null source "$REACT_NATIVE_DIR/scripts/node-binary.sh" From 31c782ff9345251eaf22f0deb8f0cca68b09c36b Mon Sep 17 00:00:00 2001 From: Makar Kotlov Date: Tue, 22 Sep 2020 06:14:20 -0700 Subject: [PATCH 20/45] Fix Xcode bundler in staging and release (#29477) Summary: Revert "feat: improve monorepo support by removing redundant PROJECT_ROOT (https://github.com/facebook/react-native/issues/28354)" This reverts commit a8e85026cfa60056b1bcbcd39cde789e4d65f9cb. This commit a8e85026cfa60056b1bcbcd39cde789e4d65f9cb somehow broke the bundler when making a staging or release build in Xcode that results in unresolved files and main.jsbundle nonexistance issue. I figured this out by replacing react-native-xcode.sh from RN v0.63.2 by the one from v0.62.2 where everything works just fine and then reverting the changes line by line. It seems like this pr will fix similar issues stated here https://stackoverflow.com/questions/62806319/main-jsbundle-does-not-exist-this-must-be-a-bug-with-main-jsbundle-issue-afte/62829256#62829256 and here https://github.com/facebook/react-native/issues/29205 ## Changelog [iOS] [Fixed] - fix "main.jsbundle does not exist" issue Pull Request resolved: https://github.com/facebook/react-native/pull/29477 Test Plan: With react-native-xcode.sh from RN v0.63.2 ![image](https://user-images.githubusercontent.com/32848434/88342113-7ce55d80-cd47-11ea-9dab-bf41ec6d6ab5.png) With my changes ![image](https://user-images.githubusercontent.com/32848434/88342376-f0876a80-cd47-11ea-9c08-96b892784da1.png) Reviewed By: sammy-SC Differential Revision: D23817847 Pulled By: hramos fbshipit-source-id: 4b729c1231d30e89073b2520aeadee944c84421c --- scripts/react-native-xcode.sh | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index 699fa5651d16f6..ee4aef09f5ebef 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -56,17 +56,11 @@ case "$CONFIGURATION" in ;; esac -# Setting up a project root was a workaround to enable support for non-standard -# structures, including monorepos. Today, CLI supports that out of the box -# and setting custom `PROJECT_ROOT` only makes it confusing. -# -# As a backwards-compatible change, I am leaving "PROJECT_ROOT" support for those -# who already use it - it is likely a non-breaking removal. -# -# For new users, we default to $PWD - not changing things all. -# -# For context: https://github.com/facebook/react-native/commit/9ccde378b6e6379df61f9d968be6346ca6be7ead#commitcomment-37914902 -PROJECT_ROOT=${PROJECT_ROOT:-$PWD} +# Path to react-native folder inside node_modules +REACT_NATIVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +# The project should be located next to where react-native is installed +# in node_modules. +PROJECT_ROOT=${PROJECT_ROOT:-"$REACT_NATIVE_DIR/../.."} cd "$PROJECT_ROOT" || exit @@ -109,9 +103,6 @@ if [[ ! -x node && -d ${HOME}/.anyenv/bin ]]; then fi fi -# Path to react-native folder inside node_modules -REACT_NATIVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" - # check and assign NODE_BINARY env # shellcheck source=/dev/null source "$REACT_NATIVE_DIR/scripts/node-binary.sh" From 0f73afb8c7b700878fd8dbd0a227f4d27fbb6a9a Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Fri, 23 Oct 2020 11:53:07 +0200 Subject: [PATCH 21/45] feat: run Hermes from CocoaPods and automatically enable --- scripts/react-native-xcode.sh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index ee4aef09f5ebef..75c7fd1e2464dc 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -107,16 +107,11 @@ fi # shellcheck source=/dev/null source "$REACT_NATIVE_DIR/scripts/node-binary.sh" -[ -z "$HERMES_PATH" ] && export HERMES_PATH="$REACT_NATIVE_DIR/../hermes-engine" +[ -z "$HERMES_CLI_PATH" ] && HERMES_CLI_PATH="$PODS_ROOT/hermes-engine/destroot/bin/hermesc" -export HERMES_CLI="$HERMES_PATH/osx-bin/hermesc" - -if [[ $USE_HERMES == true && ! -d "$HERMES_PATH" ]]; then - echo "error: Can't find Hermes executable - directory $HERMES_PATH doesn't exist. " \ - "If you have a non-standard project structure, locate the 'Bundle React Native code and images' " \ - "build phase in your Xcode project and set the `$HERMES_PATH` variable to the location of the " \ - "hermes-engine package. For example: `$SRCROOT/../../node_modules/hermes-engine` " >&2 - exit 2 +if [[ -z "$USE_HERMES" && -f "$HERMES_CLI_PATH" ]]; then + echo "Enabling Hermes byte-code compilation. Disable with USE_HERMES=false if needed." + USE_HERMES=true fi [ -z "$NODE_ARGS" ] && export NODE_ARGS="" @@ -185,7 +180,7 @@ else if [[ $EMIT_SOURCEMAP == true ]]; then EXTRA_COMPILER_ARGS="$EXTRA_COMPILER_ARGS -output-source-map" fi - "$HERMES_CLI" -emit-binary $EXTRA_COMPILER_ARGS -out "$DEST/main.jsbundle" "$BUNDLE_FILE" + "$HERMES_CLI_PATH" -emit-binary $EXTRA_COMPILER_ARGS -out "$DEST/main.jsbundle" "$BUNDLE_FILE" if [[ $EMIT_SOURCEMAP == true ]]; then HBC_SOURCEMAP_FILE="$BUNDLE_FILE.map" "$NODE_BINARY" "$COMPOSE_SOURCEMAP_PATH" "$PACKAGER_SOURCEMAP_FILE" "$HBC_SOURCEMAP_FILE" -o "$SOURCEMAP_FILE" From 278f33f57ebd9b36d2825e6bb48c04097bcb3abe Mon Sep 17 00:00:00 2001 From: grabbou Date: Mon, 26 Oct 2020 07:13:04 +0100 Subject: [PATCH 22/45] feat: warn about wrong path to Hermes CLI --- scripts/react-native-xcode.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index 75c7fd1e2464dc..8588bb355f147c 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -114,6 +114,13 @@ if [[ -z "$USE_HERMES" && -f "$HERMES_CLI_PATH" ]]; then USE_HERMES=true fi +if [[ $USE_HERMES == true && ! -f "$HERMES_CLI_PATH" ]]; then + echo "error: USE_HERMES is set to true but the hermesc binary could not be " \ + "found at ${HERMES_CLI_PATH}. Perhaps you need to run pod install or otherwise " \ + "point the HERMES_CLI_PATH variable to your custom location." >&2 + exit 2 +fi + [ -z "$NODE_ARGS" ] && export NODE_ARGS="" [ -z "$CLI_PATH" ] && export CLI_PATH="$REACT_NATIVE_DIR/cli.js" From 62d5619a7d61db8310ead25a33e5d0a37dc5bd25 Mon Sep 17 00:00:00 2001 From: grabbou Date: Mon, 26 Oct 2020 07:13:32 +0100 Subject: [PATCH 23/45] chore: remove extra args to Bundle JS and Assets phase --- packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/RNTester.xcscheme | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj index 805ef0a07569e0..82483abc6c6e35 100644 --- a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj +++ b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj @@ -589,7 +589,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export NODE_BINARY=node\nexport SOURCEMAP_FILE=../sourcemap.ios.map\nexport USE_HERMES=true\nexport PROJECT_ROOT=\"$SRCROOT/../../\"\nexport HERMES_PATH=\"$SRCROOT/../../node_modules/hermes-engine\"\n\"$SRCROOT/../../scripts/react-native-xcode.sh\" $SRCROOT/../../packages/rn-tester/js/RNTesterApp.ios.js\n"; + shellScript = "export NODE_BINARY=node\nexport SOURCEMAP_FILE=../sourcemap.ios.map\nexport PROJECT_ROOT=\"$SRCROOT/../../\"\n\"$SRCROOT/../../scripts/react-native-xcode.sh\" $SRCROOT/../../packages/rn-tester/js/RNTesterApp.ios.js\n"; }; 7A5E3C3F59BF3EA884A39149 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; diff --git a/packages/rn-tester/RNTesterPods.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme b/packages/rn-tester/RNTesterPods.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme index 7342976848dd0d..92c27e7355ecb2 100644 --- a/packages/rn-tester/RNTesterPods.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme +++ b/packages/rn-tester/RNTesterPods.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme @@ -67,7 +67,7 @@ Date: Mon, 26 Oct 2020 10:11:20 +0100 Subject: [PATCH 24/45] chore: revert some changes to xcodeproj --- packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj | 4 +++- .../xcshareddata/xcschemes/RNTester.xcscheme | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj index 82483abc6c6e35..2a7e4fc0af119d 100644 --- a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj +++ b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj @@ -589,7 +589,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export NODE_BINARY=node\nexport SOURCEMAP_FILE=../sourcemap.ios.map\nexport PROJECT_ROOT=\"$SRCROOT/../../\"\n\"$SRCROOT/../../scripts/react-native-xcode.sh\" $SRCROOT/../../packages/rn-tester/js/RNTesterApp.ios.js\n"; + shellScript = "export NODE_BINARY=node\nexport PROJECT_ROOT=\"$SRCROOT/../../\"\nexport SOURCEMAP_FILE=../sourcemap.ios.map\nexport FORCE_BUNDLING=true\n\"$SRCROOT/../../scripts/react-native-xcode.sh\" $SRCROOT/../../packages/rn-tester/js/RNTesterApp.ios.js\n"; }; 7A5E3C3F59BF3EA884A39149 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; @@ -793,6 +793,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_CXX_LANGUAGE_STANDARD = "c++14"; DEVELOPMENT_TEAM = ""; + EXCLUDED_ARCHS = arm64; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", "FB_SONARKIT_ENABLED=1", @@ -835,6 +836,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_CXX_LANGUAGE_STANDARD = "c++14"; DEVELOPMENT_TEAM = ""; + EXCLUDED_ARCHS = arm64; INFOPLIST_FILE = "$(SRCROOT)/RNTester/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( diff --git a/packages/rn-tester/RNTesterPods.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme b/packages/rn-tester/RNTesterPods.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme index 92c27e7355ecb2..7342976848dd0d 100644 --- a/packages/rn-tester/RNTesterPods.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme +++ b/packages/rn-tester/RNTesterPods.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme @@ -67,7 +67,7 @@ Date: Mon, 26 Oct 2020 10:13:58 +0100 Subject: [PATCH 25/45] chore: temporary fix for running on a simulator in debug mode --- packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj index 2a7e4fc0af119d..9cfdfe69d43081 100644 --- a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj +++ b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj @@ -836,7 +836,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_CXX_LANGUAGE_STANDARD = "c++14"; DEVELOPMENT_TEAM = ""; - EXCLUDED_ARCHS = arm64; + EXCLUDED_ARCHS = ""; INFOPLIST_FILE = "$(SRCROOT)/RNTester/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( From 4183b20e6f98823516dc68a2f80799d4eb01e4d4 Mon Sep 17 00:00:00 2001 From: grabbou Date: Mon, 26 Oct 2020 10:26:17 +0100 Subject: [PATCH 26/45] chore: clean up after merge --- packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj index 64fd545550b0d4..a9482b63c0dcfe 100644 --- a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj +++ b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj @@ -399,7 +399,6 @@ 68CD48B71D2BCB2C007E06A9 /* Build JS Bundle */, 5CF0FD27207FC6EC00C13D65 /* Start Metro */, C1C7A9D58CE1D09515F20577 /* [CP] Copy Pods Resources */, - 8CE34A8AABFD09C8B3A00B1D /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -419,7 +418,6 @@ E7DB209C22B2BA84005AC45F /* Frameworks */, E7DB209D22B2BA84005AC45F /* Resources */, D45F7C4830D42738CAAC9684 /* [CP] Copy Pods Resources */, - 7A5E3C3F59BF3EA884A39149 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -439,7 +437,6 @@ E7DB215022B2F332005AC45F /* Frameworks */, E7DB215122B2F332005AC45F /* Resources */, CD1D70F24AD74F4E13B7435D /* [CP] Copy Pods Resources */, - A934FCF321A9F192FD849C8A /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); From fe7cbefd76075e8ada8b528831d007659ac77fc0 Mon Sep 17 00:00:00 2001 From: grabbou Date: Mon, 26 Oct 2020 11:28:15 +0100 Subject: [PATCH 27/45] Invalidate cache --- .circleci/config.yml | 20 +++++------- packages/rn-tester/Podfile.lock | 58 ++++++++++++++++----------------- 2 files changed, 38 insertions(+), 40 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 93ec94d0462fc9..685f42d28d633f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,7 +20,6 @@ defaults: &defaults - PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A: &github_token_a "78a72af35445ca3f8180" - PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B: &github_token_b "b1a98e0bbd56ff1ccba1" - # ------------------------- # EXECUTORS # ------------------------- @@ -152,13 +151,13 @@ commands: command: cp packages/rn-tester/Podfile.lock packages/rn-tester/Podfile.lock.bak - restore_cache: keys: - - v1-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }} - - v1-pods-{{ .Environment.CIRCLE_JOB }}- + - v2-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }} + - v2-pods-{{ .Environment.CIRCLE_JOB }}- - steps: << parameters.steps >> - save_cache: paths: - packages/rn-tester/Pods - key: v1-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }} + key: v2-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }} download_gradle_dependencies: steps: @@ -216,12 +215,12 @@ commands: jobs: setup: parameters: - executor: - type: executor - default: nodelts - checkout_type: - type: string - default: node + executor: + type: executor + default: nodelts + checkout_type: + type: string + default: node executor: << parameters.executor >> steps: - checkout @@ -261,7 +260,6 @@ jobs: DANGER_GITHUB_API_TOKEN="$PUBLIC_PULLBOT_GITHUB_TOKEN_A""$PUBLIC_PULLBOT_GITHUB_TOKEN_B" yarn danger ci --use-github-checks when: always - # ------------------------- # JOBS: Analyze Code # ------------------------- diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index 849dc3a05b8354..de5fd77a1dff90 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -516,8 +516,8 @@ SPEC CHECKSUMS: CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845 CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f DoubleConversion: cde416483dac037923206447da6e1454df403714 - FBLazyVector: fe973c09b2299b5e8154186ecf1f6554b4f70987 - FBReactNativeSpec: 20a9345af9157362b51ab0258d842cb7bb347d19 + FBLazyVector: 1c1a1eb29e7e60bf84062587a8ba888fc04621f3 + FBReactNativeSpec: c1b2ef3b9fd3c0d1b17d70251e47e4c060200e11 Flipper: be611d4b742d8c87fbae2ca5f44603a02539e365 Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41 Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3 @@ -529,34 +529,34 @@ SPEC CHECKSUMS: hermes-engine: 2d25059126292d4375a46b65704767b3b0f529aa libevent: f1c51c1e883112c92d1247a63c1c4c0f4a56618e OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355 - RCT-Folly: b39288cedafe50da43317ec7d91bcc8cc0abbf33 - RCTRequired: d3d4ce60e1e2282864d7560340690a3c8c646de1 - RCTTypeSafety: 4da4f9f218727257c50fd3bf2683a06cdb4fede3 - React: 87b3271d925336a94620915db5845c67c5dbbd77 - React-callinvoker: e9524d75cf0b7ae108868f8d34c0b8d7dc08ec03 - React-Core: f4eeb7ca3d6a7c2879d1d5b093800f23da9be617 - React-CoreModules: 87f011fa87190ffe979e443ce578ec93ec6ff4d4 - React-cxxreact: de6de17eac6bbaa4f9fad46b66e7f0c4aaaf863d - React-jsi: 790da16b69a61adc36829eed43c44187c1488d10 - React-jsiexecutor: 17a3e26806bc19d8be7b6c83792bffc46df796be - React-jsinspector: 01db8cd098c7ab72bd09abdda522a08c9acd3af9 - React-perflogger: 37913fce32026582ad0244b585d1e52652fd01c0 - React-RCTActionSheet: e6562ea4df7099af4023d1bd0e9716e43b45a5c9 - React-RCTAnimation: fc2f655a64f0791879ab03843cca90c53737d1cb - React-RCTBlob: 5f82467e5d3bef65d05cdd900df6e12b0849744a - React-RCTImage: f3a98834281555ce1bbbe1af0306aaf40ac70fc7 - React-RCTLinking: 801d05ad5e6d1636e977f4dfeab21f87358a02a5 - React-RCTNetwork: b5e2f27a098ca52d98426328640314a499da6d00 - React-RCTPushNotification: ce60993f816f917a6495227e16978b5fd550d73b - React-RCTSettings: 3cb638230af06ba769edc0bc4ed4123040b1b4e2 - React-RCTTest: 090e9816044220c39462be109dab6d473d94b1c9 - React-RCTText: 51a41bf9d18a91b2437b833ed4246754baf830d0 - React-RCTVibration: a1cce36dd452eb88296d99d80d66f2c5bd50aad4 - React-runtimeexecutor: 53867815d0a01e53a2c901cb7f01076216c5c799 - ReactCommon: d101410fc55088c91dc24595715c7b26ec760adf - Yoga: 69ef0b2bba5387523f793957a9f80dbd61e89631 + RCT-Folly: 5e30358ace2d9ed239e59155e177d684b29e2fb3 + RCTRequired: 8a3281271a2de7f37948d284a304e1d407e3914b + RCTTypeSafety: ccbb395db223034ed0a474f9a5094e02cb39e228 + React: 4207963edf311ed8b416fdf32cc8bb3bb3e42fc0 + React-callinvoker: c97be9d29788b880adcaa7b645a77f4e6a3f84fa + React-Core: 4a84666c7e7e36fdd6bc984ff3f171ff636212e6 + React-CoreModules: d6b69cf7b1bdae52f0b156a3b7883c91be53bae9 + React-cxxreact: 2750493c93306c967327052b224c989aa4f0bfe4 + React-jsi: e5235c8a51a4d8b8477341f122652220d09cab97 + React-jsiexecutor: 65e5027f6413381c0a29a12062eb862ea44b4084 + React-jsinspector: 2cad08b208cdd6fe4afb8648d4cff3fccf891f69 + React-perflogger: 0a0cc97d26b8522f6681a0b90210f145b0c39d40 + React-RCTActionSheet: f5342f7f45584f573c0a30504b3925f93e763dd3 + React-RCTAnimation: 2bd2cca0df35fad85bdb2cd947d7349d40092e90 + React-RCTBlob: 0279de42388b653228e85188a2b36b7b038e456d + React-RCTImage: c911e43b55961f5192f55110a82bfd1ef65d595a + React-RCTLinking: b435cf3e3948fef274f718ec4d9964893137deae + React-RCTNetwork: b6b6e83093ba1184833cdd6ba814583fc734ec1e + React-RCTPushNotification: d05b81f5ffeb4135d836158445fb8140eac6a1e7 + React-RCTSettings: e8cccc297fda27dd5489d45af4f2b37e34e773da + React-RCTTest: edde317dc3cdcc4161280a1a93c74fa1259f126a + React-RCTText: 55bdf47d3325f9d1da1deedfa5159b2722719c76 + React-RCTVibration: cc66aa8dcdf637a13b86daa996b94a4a449fcc8a + React-runtimeexecutor: d1b966025393eb50c4f3ae67ce158d3aabbc2bc3 + ReactCommon: c540dfa10841fb985370a011043422cd87525f3e + Yoga: a453f92e4cf8f35a35f65b298a172581a538107d YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: e8fcdfe0cd22ad16c23d87ada51a7afb492b2ff1 +PODFILE CHECKSUM: 61a728bd5977bfe7c77ca1724760ed495da8d9e3 COCOAPODS: 1.9.3 From 7fee4934e5f875ff361db08132aa2cd84b8fbcc9 Mon Sep 17 00:00:00 2001 From: grabbou Date: Mon, 26 Oct 2020 12:36:09 +0100 Subject: [PATCH 28/45] chore: do not pull CP repo, its using CDN anyway --- .circleci/config.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 685f42d28d633f..3bb0e778389cdb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -405,10 +405,6 @@ jobs: name: Set USE_FRAMEWORKS=1 command: echo "export USE_FRAMEWORKS=1" >> $BASH_ENV - - run: - name: Fetch CocoaPods Specs - command: | - curl https://cocoapods-specs.circleci.com/fetch-cocoapods-repo-from-s3.sh | bash -s cf - run: name: Setup the CocoaPods environment command: pod setup From 5f92caa09e9e7bbf0f02125c5ad733bda93933f5 Mon Sep 17 00:00:00 2001 From: grabbou Date: Mon, 26 Oct 2020 13:32:34 +0100 Subject: [PATCH 29/45] fix: upgrade CocoaPods to fix Xcode 12 and other issues --- packages/rn-tester/Gemfile | 2 +- packages/rn-tester/Podfile.lock | 60 ++++++++-------- .../RNTesterPods.xcodeproj/project.pbxproj | 68 ++++++++++++++++++- 3 files changed, 98 insertions(+), 32 deletions(-) diff --git a/packages/rn-tester/Gemfile b/packages/rn-tester/Gemfile index b3234140e54d42..03d842220cfb0e 100644 --- a/packages/rn-tester/Gemfile +++ b/packages/rn-tester/Gemfile @@ -1,4 +1,4 @@ # Gemfile source 'https://rubygems.org' -gem 'cocoapods', '= 1.9.3' +gem 'cocoapods', '= 1.10.0' diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index de5fd77a1dff90..3e70cc57efcf4a 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -515,9 +515,9 @@ SPEC CHECKSUMS: boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845 CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f - DoubleConversion: cde416483dac037923206447da6e1454df403714 - FBLazyVector: 1c1a1eb29e7e60bf84062587a8ba888fc04621f3 - FBReactNativeSpec: c1b2ef3b9fd3c0d1b17d70251e47e4c060200e11 + DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de + FBLazyVector: d7210313bf3a4a84a3b140b468c4ffed536aea70 + FBReactNativeSpec: c25a0bdae5fad1a8006aac6891e250285d6fd4ac Flipper: be611d4b742d8c87fbae2ca5f44603a02539e365 Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41 Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3 @@ -525,38 +525,38 @@ SPEC CHECKSUMS: Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 Flipper-RSocket: 64e7431a55835eb953b0bf984ef3b90ae9fdddd7 FlipperKit: ab353d41aea8aae2ea6daaf813e67496642f3d7d - glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3 + glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62 hermes-engine: 2d25059126292d4375a46b65704767b3b0f529aa libevent: f1c51c1e883112c92d1247a63c1c4c0f4a56618e OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355 RCT-Folly: 5e30358ace2d9ed239e59155e177d684b29e2fb3 - RCTRequired: 8a3281271a2de7f37948d284a304e1d407e3914b - RCTTypeSafety: ccbb395db223034ed0a474f9a5094e02cb39e228 - React: 4207963edf311ed8b416fdf32cc8bb3bb3e42fc0 - React-callinvoker: c97be9d29788b880adcaa7b645a77f4e6a3f84fa - React-Core: 4a84666c7e7e36fdd6bc984ff3f171ff636212e6 - React-CoreModules: d6b69cf7b1bdae52f0b156a3b7883c91be53bae9 - React-cxxreact: 2750493c93306c967327052b224c989aa4f0bfe4 - React-jsi: e5235c8a51a4d8b8477341f122652220d09cab97 - React-jsiexecutor: 65e5027f6413381c0a29a12062eb862ea44b4084 - React-jsinspector: 2cad08b208cdd6fe4afb8648d4cff3fccf891f69 - React-perflogger: 0a0cc97d26b8522f6681a0b90210f145b0c39d40 - React-RCTActionSheet: f5342f7f45584f573c0a30504b3925f93e763dd3 - React-RCTAnimation: 2bd2cca0df35fad85bdb2cd947d7349d40092e90 - React-RCTBlob: 0279de42388b653228e85188a2b36b7b038e456d - React-RCTImage: c911e43b55961f5192f55110a82bfd1ef65d595a - React-RCTLinking: b435cf3e3948fef274f718ec4d9964893137deae - React-RCTNetwork: b6b6e83093ba1184833cdd6ba814583fc734ec1e - React-RCTPushNotification: d05b81f5ffeb4135d836158445fb8140eac6a1e7 - React-RCTSettings: e8cccc297fda27dd5489d45af4f2b37e34e773da - React-RCTTest: edde317dc3cdcc4161280a1a93c74fa1259f126a - React-RCTText: 55bdf47d3325f9d1da1deedfa5159b2722719c76 - React-RCTVibration: cc66aa8dcdf637a13b86daa996b94a4a449fcc8a - React-runtimeexecutor: d1b966025393eb50c4f3ae67ce158d3aabbc2bc3 - ReactCommon: c540dfa10841fb985370a011043422cd87525f3e - Yoga: a453f92e4cf8f35a35f65b298a172581a538107d + RCTRequired: ec0746bb24967e24136c74fb2f478fcc601f0352 + RCTTypeSafety: e23de78ad9c96e0c4c4a155b94c7b79bc11a9c2f + React: ff7ce1b5133523aa19a0bf02d2e86ddf64ef29e9 + React-callinvoker: c977888d41d77eba145410f200a9aba52d1d3ce1 + React-Core: b785aa8d59927307daae382be86b61e183a10b5d + React-CoreModules: 4a7a8040931e74fa26e8b36579c33365f97a12bb + React-cxxreact: c3f9e904cd2c3094df22bc044f41611eadfbbec4 + React-jsi: 5f93825068145c128572fec5070dc5525ee6501a + React-jsiexecutor: a631b1c3baf7e008b5419ae45ae2a1fe240780f7 + React-jsinspector: 1cf4d53f34fbefc7916862ff933b4ce4daede412 + React-perflogger: 0587fe1520568961a9a936e6bb5966777685682b + React-RCTActionSheet: 5797184b904a625b097ba38908ad63e31bd585e8 + React-RCTAnimation: 38c842da22994d7752af92caee37ebb5ccdbe50c + React-RCTBlob: 29e739d618c82de597c55d032cbd1d11cadb443e + React-RCTImage: 64d4adeb00fb8d2e25047c43a85fee46f328f7bb + React-RCTLinking: 93a52cd26684da8f7752bdc36a0554052feef772 + React-RCTNetwork: 2953159861cada2a3f84e2642061695ba04fa5c6 + React-RCTPushNotification: 7f53b13eed4d222dd1dafd3593a9529110408420 + React-RCTSettings: dfb24fd6bb01587da286717f0502ba8032665805 + React-RCTTest: d45e671a22ed4557f104bbc201ad3a0093e83a41 + React-RCTText: c373571a33a90643df8eb4ac78c6866e47bfada0 + React-RCTVibration: d66287ff96c511c324cbfcdd6d2d9cdf1f899810 + React-runtimeexecutor: 0781888afff03863d9aecd6acd28a40282ca7620 + ReactCommon: f9e2bd20b4a1c61ea5ae8da5bb9d6c9213e85d4e + Yoga: 5f0afcdf1d7e11c0f0c851f9688964e22d79060b YogaKit: f782866e155069a2cca2517aafea43200b01fd5a PODFILE CHECKSUM: 61a728bd5977bfe7c77ca1724760ed495da8d9e3 -COCOAPODS: 1.9.3 +COCOAPODS: 1.10.0 diff --git a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj index a9482b63c0dcfe..d5b044060f1fd8 100644 --- a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj +++ b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj @@ -60,6 +60,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + ADA4EF572546F3F8000B7E75 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 13B07F861A680F5B00A75B9A; + remoteInfo = RNTester; + }; E7DB215822B2F332005AC45F /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; @@ -399,6 +406,7 @@ 68CD48B71D2BCB2C007E06A9 /* Build JS Bundle */, 5CF0FD27207FC6EC00C13D65 /* Start Metro */, C1C7A9D58CE1D09515F20577 /* [CP] Copy Pods Resources */, + 1FBC81357AE903DE578716B1 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -418,10 +426,12 @@ E7DB209C22B2BA84005AC45F /* Frameworks */, E7DB209D22B2BA84005AC45F /* Resources */, D45F7C4830D42738CAAC9684 /* [CP] Copy Pods Resources */, + 05A8BE11026FB5DBCC2D66D6 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); dependencies = ( + ADA4EF582546F3F8000B7E75 /* PBXTargetDependency */, ); name = RNTesterUnitTests; productName = RNTesterUnitTests; @@ -437,6 +447,7 @@ E7DB215022B2F332005AC45F /* Frameworks */, E7DB215122B2F332005AC45F /* Resources */, CD1D70F24AD74F4E13B7435D /* [CP] Copy Pods Resources */, + EE8E566CD59E43F57B8CEA59 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -515,6 +526,40 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 05A8BE11026FB5DBCC2D66D6 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 1FBC81357AE903DE578716B1 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 56D84768A7BBB2750D674CF3 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -639,6 +684,23 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; + EE8E566CD59E43F57B8CEA59 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; F9CB97B0D9633939D43E75E0 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -723,6 +785,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + ADA4EF582546F3F8000B7E75 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 13B07F861A680F5B00A75B9A /* RNTester */; + targetProxy = ADA4EF572546F3F8000B7E75 /* PBXContainerItemProxy */; + }; E7DB215922B2F332005AC45F /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 13B07F861A680F5B00A75B9A /* RNTester */; @@ -739,7 +806,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_CXX_LANGUAGE_STANDARD = "c++14"; DEVELOPMENT_TEAM = ""; - EXCLUDED_ARCHS = arm64; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", "FB_SONARKIT_ENABLED=1", From ec5f23b05b94e180f3de05411786de382f348245 Mon Sep 17 00:00:00 2001 From: grabbou Date: Mon, 26 Oct 2020 13:56:19 +0100 Subject: [PATCH 30/45] invalidate the cache once again --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3bb0e778389cdb..b4e0eed30fe540 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -151,13 +151,13 @@ commands: command: cp packages/rn-tester/Podfile.lock packages/rn-tester/Podfile.lock.bak - restore_cache: keys: - - v2-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }} - - v2-pods-{{ .Environment.CIRCLE_JOB }}- + - v3-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }} + - v3-pods-{{ .Environment.CIRCLE_JOB }}- - steps: << parameters.steps >> - save_cache: paths: - packages/rn-tester/Pods - key: v2-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }} + key: v3-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }} download_gradle_dependencies: steps: From 82253cfe1cf6c1c4a9c79b12ab365ffdb14aee06 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Thu, 29 Oct 2020 16:57:33 +0100 Subject: [PATCH 31/45] chore: use CocoaPods from Gemfile --- .circleci/config.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9f469a546236e7..e7b09114391466 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -419,11 +419,7 @@ jobs: steps: - run: name: Generate RNTesterPods Workspace - command: cd packages/rn-tester && pod install --verbose - - - run: - name: Generate RNTesterPods Xcode Workspace - command: pushd packages/rn-tester && pod install --verbose && popd + command: cd packages/rn-tester && bundle exec pod install --verbose # ------------------------- # Runs iOS unit tests From 80142fb95b8dbfd631e09a3edd403242deb33ed7 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Thu, 29 Oct 2020 20:42:53 +0100 Subject: [PATCH 32/45] chore: bump xcode to see if it helps --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f7521a5dde6903..a03f3e57e4228a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,7 +49,7 @@ executors: reactnativeios: <<: *defaults macos: - xcode: &_XCODE_VERSION "11.6.0" + xcode: &_XCODE_VERSION "12.1.0" # ------------------------- # COMMANDS From 579d03ff6ddcdf4645fdeedb4947e549d71d2177 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Thu, 29 Oct 2020 21:00:54 +0100 Subject: [PATCH 33/45] chore: bump os --- scripts/.tests.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/.tests.env b/scripts/.tests.env index 4335501729d3f7..4af33b82c7ef57 100644 --- a/scripts/.tests.env +++ b/scripts/.tests.env @@ -17,7 +17,7 @@ export AVD_NAME="testAVD" export AVD_ABI=x86 ## IOS ## -export IOS_TARGET_OS="13.6" +export IOS_TARGET_OS="14.1" export IOS_DEVICE="iPhone 8" export SDK_IOS="iphonesimulator" From e08d0d06f31b74e3ab551996cf25b7a8b02bf94c Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Thu, 29 Oct 2020 21:41:03 +0100 Subject: [PATCH 34/45] fix: some unit tests --- packages/rn-tester/RNTesterIntegrationTests/RCTLoggingTests.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/rn-tester/RNTesterIntegrationTests/RCTLoggingTests.m b/packages/rn-tester/RNTesterIntegrationTests/RCTLoggingTests.m index 3c04e32fe1bc7b..36b47a79b7e846 100644 --- a/packages/rn-tester/RNTesterIntegrationTests/RCTLoggingTests.m +++ b/packages/rn-tester/RNTesterIntegrationTests/RCTLoggingTests.m @@ -90,7 +90,7 @@ - (void)testLogging XCTAssertEqual(_lastLogLevel, RCTLogLevelError); XCTAssertEqual(_lastLogSource, RCTLogSourceJavaScript); - XCTAssertEqualObjects(_lastLogMessage, @"Invariant Violation: Invariant failed"); + XCTAssertTrue([_lastLogMessage containsString:@"Invariant Violation: Invariant failed"]); [_bridge enqueueJSCall:@"LoggingTestModule.logErrorToConsole" args:@[@"Invoking console.error"]]; dispatch_semaphore_wait(_logSem, DISPATCH_TIME_FOREVER); @@ -114,7 +114,7 @@ - (void)testLogging XCTAssertEqual(_lastLogLevel, RCTLogLevelError); XCTAssertEqual(_lastLogSource, RCTLogSourceJavaScript); - XCTAssertEqualObjects(_lastLogMessage, @"Error: Throwing an error"); + XCTAssertTrue([_lastLogMessage containsString:@"Error: Throwing an error"]); } @end From 5351d6825d5407f1e0b5cbc02283dd999644e37e Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Fri, 30 Oct 2020 08:59:24 +0100 Subject: [PATCH 35/45] fix: unit tests --- IntegrationTests/GlobalEvalWithSourceUrlTest.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/IntegrationTests/GlobalEvalWithSourceUrlTest.js b/IntegrationTests/GlobalEvalWithSourceUrlTest.js index a30bfeec12df1a..a3348e8f598a4f 100644 --- a/IntegrationTests/GlobalEvalWithSourceUrlTest.js +++ b/IntegrationTests/GlobalEvalWithSourceUrlTest.js @@ -42,7 +42,8 @@ class GlobalEvalWithSourceUrlTest extends React.Component<{...}> { 'Expected globalEvalWithSourceUrl to throw on a syntax error', ); } - if (!(syntaxError instanceof SyntaxError)) { + // Hermes throws an Error, not a SyntaxError + if (syntaxError.jsEngine !== 'hermes' && !(syntaxError instanceof SyntaxError)) { throw new Error( 'Expected globalEvalWithSourceUrl to throw SyntaxError on a syntax error', ); From 48eeaa55929740b363e359b1940be0f9c84abb5f Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Fri, 30 Oct 2020 09:49:36 +0100 Subject: [PATCH 36/45] fix: build failure of libevent in use_frameworks mode --- third-party-podspecs/libevent.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party-podspecs/libevent.podspec b/third-party-podspecs/libevent.podspec index 90209dbd74dc85..f2062269c0f03d 100644 --- a/third-party-podspecs/libevent.podspec +++ b/third-party-podspecs/libevent.podspec @@ -564,7 +564,7 @@ Pod::Spec.new do |spec| spec.subspec "core" do |ss| ss.dependency "libevent/event2-headers" ss.source_files = - "include/*.h", "*-{internal,private}.h", + "include/{evdns,event,evhttp,evrpc,evutil}.h", "*-{internal,private}.h", "buffer.c", "bufferevent.c", "bufferevent_filter.c", "bufferevent_pair.c", "bufferevent_ratelim.c", "bufferevent_sock.c", "event.c", "evmap.c", "evthread.c", "evutil.c", "evutil_rand.c", "evutil_time.c", "kqueue.c", "listener.c", "log.c", "poll.c", "select.c", "signal.c", "strlcpy.c", "watch.c", From e131e10e98c6b7499f788d420ec2a8d4c67e91a9 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Fri, 30 Oct 2020 09:58:27 +0100 Subject: [PATCH 37/45] fix: eslint issue --- IntegrationTests/GlobalEvalWithSourceUrlTest.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/IntegrationTests/GlobalEvalWithSourceUrlTest.js b/IntegrationTests/GlobalEvalWithSourceUrlTest.js index a3348e8f598a4f..50133312e89e14 100644 --- a/IntegrationTests/GlobalEvalWithSourceUrlTest.js +++ b/IntegrationTests/GlobalEvalWithSourceUrlTest.js @@ -43,7 +43,10 @@ class GlobalEvalWithSourceUrlTest extends React.Component<{...}> { ); } // Hermes throws an Error, not a SyntaxError - if (syntaxError.jsEngine !== 'hermes' && !(syntaxError instanceof SyntaxError)) { + if ( + syntaxError.jsEngine !== 'hermes' && + !(syntaxError instanceof SyntaxError) + ) { throw new Error( 'Expected globalEvalWithSourceUrl to throw SyntaxError on a syntax error', ); From 7379157b314e3c44c5c0115a66ee865649890790 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Fri, 30 Oct 2020 10:07:07 +0100 Subject: [PATCH 38/45] Revert changes to libevent for now --- third-party-podspecs/libevent.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party-podspecs/libevent.podspec b/third-party-podspecs/libevent.podspec index f2062269c0f03d..90209dbd74dc85 100644 --- a/third-party-podspecs/libevent.podspec +++ b/third-party-podspecs/libevent.podspec @@ -564,7 +564,7 @@ Pod::Spec.new do |spec| spec.subspec "core" do |ss| ss.dependency "libevent/event2-headers" ss.source_files = - "include/{evdns,event,evhttp,evrpc,evutil}.h", "*-{internal,private}.h", + "include/*.h", "*-{internal,private}.h", "buffer.c", "bufferevent.c", "bufferevent_filter.c", "bufferevent_pair.c", "bufferevent_ratelim.c", "bufferevent_sock.c", "event.c", "evmap.c", "evthread.c", "evutil.c", "evutil_rand.c", "evutil_time.c", "kqueue.c", "listener.c", "log.c", "poll.c", "select.c", "signal.c", "strlcpy.c", "watch.c", From e1b79c0cc3179a03659fb13ec48d9201baccea49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Fri, 30 Oct 2020 14:56:24 +0100 Subject: [PATCH 39/45] Make libevent work for static and framework builds --- packages/rn-tester/Podfile.lock | 68 ++++++++++++-------------- third-party-podspecs/RCT-Folly.podspec | 4 +- third-party-podspecs/libevent.podspec | 30 ++++-------- 3 files changed, 44 insertions(+), 58 deletions(-) diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index c177ba14061e77..7dfd23ee07ccb8 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -59,11 +59,7 @@ PODS: - FlipperKit/FlipperKitNetworkPlugin - glog (0.3.5) - hermes-engine (0.7.1) - - libevent (2.1.11): - - libevent/core (= 2.1.11) - - libevent/core (2.1.11): - - libevent/event2-headers - - libevent/event2-headers (2.1.11) + - libevent (2.1.11) - OpenSSL-Universal (1.0.2.19): - OpenSSL-Universal/Static (= 1.0.2.19) - OpenSSL-Universal/Static (1.0.2.19) @@ -432,7 +428,7 @@ DEPENDENCIES: - Yoga (from `../../ReactCommon/yoga`) SPEC REPOS: - trunk: + https://cdn.cocoapods.org/: - boost-for-react-native - CocoaAsyncSocket - CocoaLibEvent @@ -516,8 +512,8 @@ SPEC CHECKSUMS: CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845 CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de - FBLazyVector: d7210313bf3a4a84a3b140b468c4ffed536aea70 - FBReactNativeSpec: c25a0bdae5fad1a8006aac6891e250285d6fd4ac + FBLazyVector: 41b9b20a04ec7d992469c3c0100df42bd5bba9ba + FBReactNativeSpec: 1d4c3a5b3b08575ef17b566bfb41604adf854c7a Flipper: be611d4b742d8c87fbae2ca5f44603a02539e365 Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41 Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3 @@ -527,36 +523,36 @@ SPEC CHECKSUMS: FlipperKit: ab353d41aea8aae2ea6daaf813e67496642f3d7d glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62 hermes-engine: 2d25059126292d4375a46b65704767b3b0f529aa - libevent: f1c51c1e883112c92d1247a63c1c4c0f4a56618e + libevent: 867cc03e654415675bcacf9726871a37c4b56b8a OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355 - RCT-Folly: 5e30358ace2d9ed239e59155e177d684b29e2fb3 - RCTRequired: ec0746bb24967e24136c74fb2f478fcc601f0352 - RCTTypeSafety: e23de78ad9c96e0c4c4a155b94c7b79bc11a9c2f - React: ff7ce1b5133523aa19a0bf02d2e86ddf64ef29e9 - React-callinvoker: c977888d41d77eba145410f200a9aba52d1d3ce1 - React-Core: b785aa8d59927307daae382be86b61e183a10b5d - React-CoreModules: 4a7a8040931e74fa26e8b36579c33365f97a12bb - React-cxxreact: c3f9e904cd2c3094df22bc044f41611eadfbbec4 - React-jsi: 5f93825068145c128572fec5070dc5525ee6501a - React-jsiexecutor: a631b1c3baf7e008b5419ae45ae2a1fe240780f7 - React-jsinspector: 1cf4d53f34fbefc7916862ff933b4ce4daede412 - React-perflogger: 0587fe1520568961a9a936e6bb5966777685682b - React-RCTActionSheet: 5797184b904a625b097ba38908ad63e31bd585e8 - React-RCTAnimation: 38c842da22994d7752af92caee37ebb5ccdbe50c - React-RCTBlob: 29e739d618c82de597c55d032cbd1d11cadb443e - React-RCTImage: 64d4adeb00fb8d2e25047c43a85fee46f328f7bb - React-RCTLinking: 93a52cd26684da8f7752bdc36a0554052feef772 - React-RCTNetwork: 2953159861cada2a3f84e2642061695ba04fa5c6 - React-RCTPushNotification: 7f53b13eed4d222dd1dafd3593a9529110408420 - React-RCTSettings: dfb24fd6bb01587da286717f0502ba8032665805 - React-RCTTest: d45e671a22ed4557f104bbc201ad3a0093e83a41 - React-RCTText: c373571a33a90643df8eb4ac78c6866e47bfada0 - React-RCTVibration: d66287ff96c511c324cbfcdd6d2d9cdf1f899810 - React-runtimeexecutor: 0781888afff03863d9aecd6acd28a40282ca7620 - ReactCommon: f9e2bd20b4a1c61ea5ae8da5bb9d6c9213e85d4e - Yoga: 5f0afcdf1d7e11c0f0c851f9688964e22d79060b + RCT-Folly: ec7a233ccc97cc556cf7237f0db1ff65b986f27c + RCTRequired: 08a7ff32dfcf3d2a0d5975d8936aa461e751c94f + RCTTypeSafety: 6c06b6212c260279dceadfb492cc071b6ccaa94b + React: 11446588a4415be9685faa772f51617aedd42c53 + React-callinvoker: 91bb3d26e1bc03956a04f2fc4dfd18fa201c2116 + React-Core: 7cf15c7da07872c4eddda7e60fc782b5c90c3ec4 + React-CoreModules: fa38f1a0095cb23221f6e1ace508e002ab0859b5 + React-cxxreact: aaf9d64527d2ce9beb3c80167adde72c79fbd1d9 + React-jsi: e71179690ee4deb4bdb76f2e10023c22f0c0bafd + React-jsiexecutor: 260ee4bd8d0c5eab950d7222c88cdb71c4dd4a98 + React-jsinspector: 1a013b2751ebe53792abfaa9967058248c5586a8 + React-perflogger: 13cc0c550c30110ed2a661d081e649a9fb87cee8 + React-RCTActionSheet: 8d7c7f5f5df20a60f92ac04dd43c14a444fad7b1 + React-RCTAnimation: 153673bb315d67cbb5e107bc7fbdb07e67566690 + React-RCTBlob: 92e03c3a61cda7e3d745a04eb792d564bcdb9b52 + React-RCTImage: b7d345c55df0dd17b180e7f598a2db599d1a1dc7 + React-RCTLinking: 711815a70272557f3740621c00e69ffef1131f50 + React-RCTNetwork: 2fb0b1d61d12475b7decfbf728b8a4892f24efb6 + React-RCTPushNotification: 7f1fcd788b630b0ffee8ea2d3de4ad0260b6301d + React-RCTSettings: 41eee0ff18d317265f2f401da66c0e4cbe1a026d + React-RCTTest: de5b8af1586d82622e95a6ddf04ca2c78579c655 + React-RCTText: db9001d0d20425e5e50fe6d0a57ef4a8e8d1dc74 + React-RCTVibration: 2059c6d5fa254390e1f3874c55d026b282ebd579 + React-runtimeexecutor: 08bf2f4079793909fbece520244bc2b855607e36 + ReactCommon: fbf1cc0fe30d2442614975cb59515c12069c2054 + Yoga: 331a94ed76c4d00b4b5b0458296b8850c9b53ff2 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: 7e23479b52619cbbd3aa612f09f0e4bd0c2ed208 +PODFILE CHECKSUM: b7291ba95c2e06e414d49a93264f5ee198245f68 COCOAPODS: 1.10.0 diff --git a/third-party-podspecs/RCT-Folly.podspec b/third-party-podspecs/RCT-Folly.podspec index 06cb31c76cdf70..cacafb825d3fa3 100644 --- a/third-party-podspecs/RCT-Folly.podspec +++ b/third-party-podspecs/RCT-Folly.podspec @@ -67,7 +67,7 @@ Pod::Spec.new do |spec| spec.libraries = "stdc++" spec.pod_target_xcconfig = { "USE_HEADERMAP" => "NO", "CLANG_CXX_LANGUAGE_STANDARD" => "c++14", - "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\"" } + "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/libevent/include/\"" } # TODO: The boost spec should really be selecting these files so that dependents of Folly can also access the required headers. spec.user_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\"" } @@ -107,7 +107,7 @@ Pod::Spec.new do |spec| 'folly/io/{Cursor,Cursor-inl,IOBuf,IOBufQueue}.{h,cpp}', 'folly/tracing/StaticTracepoint.{h,cpp}', 'folly/{Executor,ExceptionWrapper,ExceptionWrapper-inl,FileUtil,Singleton,SharedMutex}.{h,cpp}', - 'folly/detail/{AsyncTrace,AtFork,Futex,Futex-inl,MemoryIdler,StaticSingletonManager,ThreadLocalDetail}.{h,cpp}', + 'folly/detail/{AsyncTrace,AtFork,Futex,Futex-inl,MemoryIdler,SingletonStackTrace,StaticSingletonManager,ThreadLocalDetail}.{h,cpp}', 'folly/lang/SafeAssert.{h,cpp}', 'folly/memory/MallctlHelper.{h,cpp}', 'folly/portability/{GFlags,SysUio}.{h,cpp}', diff --git a/third-party-podspecs/libevent.podspec b/third-party-podspecs/libevent.podspec index 90209dbd74dc85..ca7fb852f398ef 100644 --- a/third-party-podspecs/libevent.podspec +++ b/third-party-podspecs/libevent.podspec @@ -551,25 +551,15 @@ Pod::Spec.new do |spec| spec.author = "Niels Provos and Nick Mathewson" spec.platforms = { :osx => "10.13", :ios => "10.0" } spec.source = { :git => "https://github.com/libevent/libevent.git", :tag => "release-#{spec.version}-stable" } - spec.default_subspec = "core" spec.prepare_command = "touch evconfig-private.h; echo -e #{Shellwords.escape(CONFIG_WITHOUT_OPENSSL)} > include/event2/event-config.h" - - # This subspec only exists so we can namespace these headers. - spec.subspec "event2-headers" do |ss| - ss.source_files = "include/event2/*.h" - ss.public_header_files = "include/event2/*.h" - ss.header_dir = "event2" - end - - spec.subspec "core" do |ss| - ss.dependency "libevent/event2-headers" - ss.source_files = - "include/*.h", "*-{internal,private}.h", - "buffer.c", "bufferevent.c", "bufferevent_filter.c", "bufferevent_pair.c", "bufferevent_ratelim.c", "bufferevent_sock.c", - "event.c", "evmap.c", "evthread.c", "evutil.c", "evutil_rand.c", "evutil_time.c", - "kqueue.c", "listener.c", "log.c", "poll.c", "select.c", "signal.c", "strlcpy.c", "watch.c", - "evdns.c", "event_tagging.c", "evrpc.c", "http.c" - ss.private_header_files = "*-{internal,private}.h" - ss.public_header_files = "include/*.h" - end + spec.source_files = + "include/*.h", "*-{internal,private}.h", + "buffer.c", "bufferevent.c", "bufferevent_filter.c", "bufferevent_pair.c", "bufferevent_ratelim.c", "bufferevent_sock.c", + "event.c", "evmap.c", "evthread.c", "evutil.c", "evutil_rand.c", "evutil_time.c", + "kqueue.c", "listener.c", "log.c", "poll.c", "select.c", "signal.c", "strlcpy.c", "watch.c", + "evdns.c", "event_tagging.c", "evrpc.c", "http.c" + spec.private_header_files = "*-{internal,private}.h" + spec.public_header_files = "include/*.h" + spec.preserve_paths = "include/event2/*.h" + spec.xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/include/\"" } end From 59a92a28d2b279f8e79c8a870cccd2ebaa471e7c Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Mon, 2 Nov 2020 10:37:29 +0100 Subject: [PATCH 40/45] fix: flow issue in test --- IntegrationTests/GlobalEvalWithSourceUrlTest.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/IntegrationTests/GlobalEvalWithSourceUrlTest.js b/IntegrationTests/GlobalEvalWithSourceUrlTest.js index 50133312e89e14..8791140c1b33f9 100644 --- a/IntegrationTests/GlobalEvalWithSourceUrlTest.js +++ b/IntegrationTests/GlobalEvalWithSourceUrlTest.js @@ -10,6 +10,8 @@ 'use strict'; +import type {ExtendedError} from 'react-native/Libraries/Core/Devtools/parseErrorStack'; + const React = require('react'); const ReactNative = require('react-native'); const parseErrorStack = require('react-native/Libraries/Core/Devtools/parseErrorStack'); @@ -31,7 +33,7 @@ class GlobalEvalWithSourceUrlTest extends React.Component<{...}> { 'Expected globalEvalWithSourceUrl(expression) to return a value', ); } - let syntaxError; + let syntaxError: ?ExtendedError; try { global.globalEvalWithSourceUrl('{'); } catch (e) { From 637a5a8ea6ac183aebadc257705c4156258cabf2 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Mon, 2 Nov 2020 10:43:00 +0100 Subject: [PATCH 41/45] chore: point out to Hermes issue --- IntegrationTests/GlobalEvalWithSourceUrlTest.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/IntegrationTests/GlobalEvalWithSourceUrlTest.js b/IntegrationTests/GlobalEvalWithSourceUrlTest.js index 8791140c1b33f9..fca7bfbc2170c7 100644 --- a/IntegrationTests/GlobalEvalWithSourceUrlTest.js +++ b/IntegrationTests/GlobalEvalWithSourceUrlTest.js @@ -44,7 +44,8 @@ class GlobalEvalWithSourceUrlTest extends React.Component<{...}> { 'Expected globalEvalWithSourceUrl to throw on a syntax error', ); } - // Hermes throws an Error, not a SyntaxError + // Hermes throws an Error instead of a SyntaxError + // https://github.com/facebook/hermes/issues/400 if ( syntaxError.jsEngine !== 'hermes' && !(syntaxError instanceof SyntaxError) From 9f924c0244760b00e7397db3f2d3fbc997520838 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Mon, 2 Nov 2020 11:14:57 +0100 Subject: [PATCH 42/45] feat: test jsc/hermes separate --- .circleci/config.yml | 29 +++++++++++++++++++++++++++-- packages/rn-tester/Podfile | 6 +++++- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a03f3e57e4228a..e927be11bffaa4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -349,6 +349,9 @@ jobs: use_frameworks: type: boolean default: false + use_hermes: + type: boolean + default: false run_unit_tests: description: Specifies whether unit tests should run. type: boolean @@ -405,6 +408,13 @@ jobs: name: Set USE_FRAMEWORKS=1 command: echo "export USE_FRAMEWORKS=1" >> $BASH_ENV + - when: + condition: << parameters.use_hermes >> + steps: + - run: + name: Set USE_HERMES=1 + command: echo "export USE_HERMES=1" >> $BASH_ENV + - run: name: Setup the CocoaPods environment command: pod setup @@ -762,17 +772,32 @@ workflows: requires: - setup_android - test_ios: - name: test_ios_unit + name: test_ios_unit_jsc + run_disabled_tests: false + run_unit_tests: true + requires: + - setup_ios + - test_ios: + name: test_ios_unit_frameworks_jsc + use_frameworks: true + run_unit_tests: true + requires: + - setup_ios + - test_ios: + name: test_ios_unit_hermes + use_hermes: true run_disabled_tests: false run_unit_tests: true requires: - setup_ios - test_ios: - name: test_ios_unit_frameworks + name: test_ios_unit_frameworks_hermes + use_hermes: true use_frameworks: true run_unit_tests: true requires: - setup_ios + # - test_ios: # name: test_ios_detox # run_disabled_tests: false diff --git a/packages/rn-tester/Podfile b/packages/rn-tester/Podfile index dbf7270b4db03a..a157ca253924dd 100644 --- a/packages/rn-tester/Podfile +++ b/packages/rn-tester/Podfile @@ -8,12 +8,16 @@ if ENV['USE_FRAMEWORKS'] == '1' use_frameworks! end +if ENV['USE_HERMES'] == '1' + puts "Using Hermes engine" +end + def pods() project 'RNTesterPods.xcodeproj' # Enable TurboModule prefix_path = "../.." - use_react_native!(path: prefix_path, hermes_enabled: true) + use_react_native!(path: prefix_path, hermes_enabled: ENV['USE_HERMES']) pod 'ReactCommon/turbomodule/samples', :path => "#{prefix_path}/ReactCommon" # Additional Pods which aren't included in the default Podfile From d26d9007fa1896add149ef934f2d73a57eeb8fe9 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Mon, 2 Nov 2020 11:22:55 +0100 Subject: [PATCH 43/45] chore: remove unused params --- .circleci/config.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e927be11bffaa4..fcb496d71f4039 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -773,7 +773,6 @@ workflows: - setup_android - test_ios: name: test_ios_unit_jsc - run_disabled_tests: false run_unit_tests: true requires: - setup_ios @@ -786,7 +785,6 @@ workflows: - test_ios: name: test_ios_unit_hermes use_hermes: true - run_disabled_tests: false run_unit_tests: true requires: - setup_ios @@ -797,10 +795,8 @@ workflows: run_unit_tests: true requires: - setup_ios - # - test_ios: # name: test_ios_detox - # run_disabled_tests: false # run_detox_tests: true # requires: # - setup_ios From b400e6c0adca41bcb6ec2e2358602e357b3af0fd Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Mon, 2 Nov 2020 11:27:46 +0100 Subject: [PATCH 44/45] chore: small docs on enabling Hermes --- packages/rn-tester/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rn-tester/README.md b/packages/rn-tester/README.md index e1d52db22883a7..98027009b6fd47 100644 --- a/packages/rn-tester/README.md +++ b/packages/rn-tester/README.md @@ -15,7 +15,7 @@ Before running the app, make sure you ran: Both macOS and Xcode are required. - `cd packages/rn-tester` - Install [Bundler](https://bundler.io/): `gem install bundler`. We use bundler to install the right version of [CocoaPods](https://cocoapods.org/) locally. -- Install Bundler and CocoaPods dependencies: `bundle install && bundle exec pod install` +- Install Bundler and CocoaPods dependencies: `bundle install && bundle exec pod install`. In order to use Hermes engine instead of JSC, run: `USE_HERMES=1 bundle exec pod install` instead. - Open the generated `RNTesterPods.xcworkspace`. This is not checked in, as it is generated by CocoaPods. Do not open `RNTesterPods.xcodeproj` directly. ### Running on Android From 9ec3e29bbf51055d53041ba06d088c1d1df578de Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Mon, 2 Nov 2020 13:51:56 +0100 Subject: [PATCH 45/45] Update packages/rn-tester/Podfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Eloy DurĂ¡n --- packages/rn-tester/Podfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rn-tester/Podfile b/packages/rn-tester/Podfile index a157ca253924dd..feb884bd0b84a8 100644 --- a/packages/rn-tester/Podfile +++ b/packages/rn-tester/Podfile @@ -17,7 +17,7 @@ def pods() # Enable TurboModule prefix_path = "../.." - use_react_native!(path: prefix_path, hermes_enabled: ENV['USE_HERMES']) + use_react_native!(path: prefix_path, hermes_enabled: ENV['USE_HERMES'] == '1') pod 'ReactCommon/turbomodule/samples', :path => "#{prefix_path}/ReactCommon" # Additional Pods which aren't included in the default Podfile