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 1 commit
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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";
grabbou marked this conversation as resolved.
Show resolved Hide resolved
};
7A5E3C3F59BF3EA884A39149 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
Expand Down
17 changes: 17 additions & 0 deletions scripts/hermes-binary.sh
Original file line number Diff line number Diff line change
@@ -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"
grabbou marked this conversation as resolved.
Show resolved Hide resolved

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
grabbou marked this conversation as resolved.
Show resolved Hide resolved
exit 2
fi
12 changes: 4 additions & 8 deletions scripts/react-native-xcode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -145,11 +146,6 @@ case "$PLATFORM_NAME" in
;;
esac

USE_HERMES=
if [[ "$BUNDLE_PLATFORM" == "macos" && -f "$HERMES_PATH" ]]; then
USE_HERMES=true
fi
grabbou marked this conversation as resolved.
Show resolved Hide resolved

EMIT_SOURCEMAP=
if [[ ! -z "$SOURCEMAP_FILE" ]]; then
EMIT_SOURCEMAP=true
Expand Down Expand Up @@ -190,7 +186,7 @@ else
EXTRA_COMPILER_ARGS="$EXTRA_COMPILER_ARGS -output-source-map"
fi
HBC_FILE="$CONFIGURATION_BUILD_DIR/$(basename $BUNDLE_FILE)"
grabbou marked this conversation as resolved.
Show resolved Hide resolved
"$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
Expand Down