Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Enable Hermes to work on iOS #29914

Closed
wants to merge 52 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
4c21abe
feat: initial commit Hermes on iOS
grabbou Sep 9, 2020
1f3598d
chore: update version
grabbou Sep 9, 2020
3aa3d95
Update gradlew.bat
grabbou Sep 9, 2020
52bc83a
chore: release script tweaks
grabbou Sep 14, 2020
11112f6
Remove .gitattributes and normalize line endings (#29792)
friederbluemle Sep 4, 2020
f7592b0
chore: update line endings after cherry-picking fix
grabbou Sep 14, 2020
6921e6b
Merge branch 'master' into feat/ios-hermes-try
grabbou Sep 14, 2020
4b0920b
chore: remove `hermes-binary.sh` file
grabbou Sep 15, 2020
cb01604
fix: bundling RNTester in release mode
grabbou Sep 15, 2020
942d009
chore: updating wording
grabbou Sep 15, 2020
52c8c2f
chore: do not force bundling, reverting previous changes meant for te…
grabbou Sep 15, 2020
6afacda
Revert "feat: improve monorepo support by removing redundant PROJECT_…
grabbou Sep 17, 2020
15a2b9c
fix: running RNTester and other apps in RELEASE
grabbou Sep 17, 2020
16452d0
fix folly errors
grabbou Oct 7, 2020
8c86ae7
chore: remove comment
grabbou Oct 7, 2020
e2b2968
feat: use CocoaPods hermes-engine instead of npm package
grabbou Oct 13, 2020
7310c8a
chore: remove all occurences of `hermes-engine-darwin`
grabbou Oct 23, 2020
c2adc84
chore: lock updates
grabbou Oct 23, 2020
bb6c456
chore: update comment on a wkroarund
grabbou Oct 23, 2020
a760438
Revert "Revert "feat: improve monorepo support by removing redundant …
grabbou Oct 23, 2020
31c782f
Fix Xcode bundler in staging and release (#29477)
Sep 22, 2020
0f73afb
feat: run Hermes from CocoaPods and automatically enable
grabbou Oct 23, 2020
278f33f
feat: warn about wrong path to Hermes CLI
grabbou Oct 26, 2020
62d5619
chore: remove extra args to Bundle JS and Assets phase
grabbou Oct 26, 2020
4fbb834
chore: revert some changes to xcodeproj
grabbou Oct 26, 2020
68f1c31
chore: temporary fix for running on a simulator in debug mode
grabbou Oct 26, 2020
3fe22f8
Merge branch 'master' into feat/ios-hermes-try
grabbou Oct 26, 2020
4183b20
chore: clean up after merge
grabbou Oct 26, 2020
fe7cbef
Invalidate cache
grabbou Oct 26, 2020
7fee493
chore: do not pull CP repo, its using CDN anyway
grabbou Oct 26, 2020
5f92caa
fix: upgrade CocoaPods to fix Xcode 12 and other issues
grabbou Oct 26, 2020
ec5f23b
invalidate the cache once again
grabbou Oct 26, 2020
82253cf
chore: use CocoaPods from Gemfile
grabbou Oct 29, 2020
a1da047
Merge branch 'feat/ios-hermes-try' of github.com:callstack/react-nati…
grabbou Oct 29, 2020
9aa5815
Merge branch 'master' into feat/ios-hermes-try
grabbou Oct 29, 2020
80142fb
chore: bump xcode to see if it helps
grabbou Oct 29, 2020
579d03f
chore: bump os
grabbou Oct 29, 2020
e08d0d0
fix: some unit tests
grabbou Oct 29, 2020
5351d68
fix: unit tests
grabbou Oct 30, 2020
48eeaa5
fix: build failure of libevent in use_frameworks mode
grabbou Oct 30, 2020
e131e10
fix: eslint issue
grabbou Oct 30, 2020
7379157
Revert changes to libevent for now
grabbou Oct 30, 2020
e1b79c0
Make libevent work for static and framework builds
alloy Oct 30, 2020
170838a
Merge pull request #26 from alloy/feat/ios-hermes-try
grabbou Nov 2, 2020
59a92a2
fix: flow issue in test
grabbou Nov 2, 2020
637a5a8
chore: point out to Hermes issue
grabbou Nov 2, 2020
9f924c0
feat: test jsc/hermes separate
grabbou Nov 2, 2020
2dff0ce
Merge branch 'master' into feat/ios-hermes-try
grabbou Nov 2, 2020
d26d900
chore: remove unused params
grabbou Nov 2, 2020
ff9d5ec
Merge branch 'feat/ios-hermes-try' of github.com:callstack/react-nati…
grabbou Nov 2, 2020
b400e6c
chore: small docs on enabling Hermes
grabbou Nov 2, 2020
9ec3e29
Update packages/rn-tester/Podfile
grabbou Nov 2, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions React-Core.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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"
grabbou marked this conversation as resolved.
Show resolved Hide resolved
end

s.subspec "DevSupport" do |ss|
Expand Down
2 changes: 1 addition & 1 deletion React/CxxBridge/RCTCxxBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#import <jsireact/JSIExecutor.h>
#import <reactperflogger/BridgeNativeModulePerfLogger.h>

#if TARGET_OS_OSX && __has_include(<hermes/hermes.h>)
#if __has_include(<hermes/hermes.h>)
#define RCT_USE_HERMES 1
#endif
#if RCT_USE_HERMES
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
grabbou marked this conversation as resolved.
Show resolved Hide resolved
"invariant": "^2.2.4",
"jsc-android": "^245459.0.0",
"metro-babel-register": "0.63.0",
Expand Down
178 changes: 89 additions & 89 deletions packages/react-native-codegen/android/gradlew.bat
Original file line number Diff line number Diff line change
@@ -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
grabbou marked this conversation as resolved.
Show resolved Hide resolved
@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
4 changes: 2 additions & 2 deletions packages/rn-tester/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -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")
grabbou marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down
90 changes: 60 additions & 30 deletions packages/rn-tester/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -377,13 +398,16 @@ 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`)
- React (from `../../`)
- 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`)
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Loading