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

Conversation

grabbou
Copy link
Contributor

@grabbou grabbou commented Sep 9, 2020

Summary

This PR makes it possible to build iOS applications with Hermes. Note that it doesn't work with use_frameworks! just yet.

Fixes #27845 (by downgrading iOS deployment target for RCT-Folly to 9.0)
Fixes #28810 (as above)

Checklist:

Changelog

[IOS] [FEATURE] - Enable Hermes on iOS
[INTERNAL] - Upgrade to CocoaPods 1.10.0 to resolve Xcode 12.0 issues
[INTERNAL] - Upgrade to Xcode 12.0 on the CircleCI
[INTERNAL] - Fix building RNTester in Release mode
[INTERNAL] - Fix build-time errors of libevent with use_frameworks!
[INTERNAL] - Introduce USE_HERMES variable and test all RNTester configurations on the CI
[INTERNAL] - Do not fetch CocoaPods repository since we're using CDN anyway

Test Plan

Turn on hermes_enabled to true in your Podfile, install pods, and run the iOS application. Your app should be running Hermes now.

Preview: (note "Engine: Hermes")

Screenshot 2020-09-09 at 19 22 32

React-Core.podspec Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Callstack Partner: Callstack Partner labels Sep 9, 2020
package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@alloy alloy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is amazing! Great stuff as always, @grabbou 👏

Thus far the changes are looking good to me, but will review again when it's no longer marked as WIP.

@analysis-bot
Copy link

analysis-bot commented Sep 9, 2020

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,211,837 -182,156
android hermes armeabi-v7a 6,861,013 -156,200
android hermes x86 7,646,477 -185,632
android hermes x86_64 7,537,421 -188,270
android jsc arm64-v8a 9,370,806 -165,392
android jsc armeabi-v7a 9,012,102 -139,124
android jsc x86 9,233,530 -167,344
android jsc x86_64 9,810,678 -171,906

Base commit: 36b0f7d

@grabbou

This comment has been minimized.

@TheSavior

This comment has been minimized.

@mrousavy

This comment has been minimized.

@sunnylqm

This comment has been minimized.

scripts/hermes-binary.sh Outdated Show resolved Hide resolved
@grabbou

This comment has been minimized.

friederbluemle and others added 3 commits September 15, 2020 00:18
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: facebook#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
@grabbou

This comment has been minimized.

@denissb
Copy link

denissb commented Mar 8, 2021

Just out of curiosity - has anyone done any benchmarks on hermes for iOS?
E.g what is the impact on bundle size and startup performance.

This was referenced Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. p: Callstack Partner: Callstack Partner
Projects
None yet