Skip to content

feat: Enable Hermes to work on iOS - #29914

Closed
grabbou wants to merge 52 commits into
react:masterfrom
callstack:feat/ios-hermes-try
Closed

feat: Enable Hermes to work on iOS#29914
grabbou wants to merge 52 commits into
react:masterfrom
callstack:feat/ios-hermes-try

Conversation

@grabbou

@grabbougrabbou commented Sep 9, 2020

Copy link
Copy Markdown
Contributor

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

Comment threadReact-Core.podspec Outdated
Comment threadpackage.json Outdated
Comment threadthird-party-podspecs/RCT-Folly.podspec
@facebook-github-botfacebook-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
Comment threadpackage.json Outdated
Comment threadpackages/react-native-codegen/android/gradlew.bat Outdated

@alloyalloy left a comment

Copy link
Copy Markdown
Contributor

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

analysis-bot commented Sep 9, 2020

Copy link
Copy Markdown
PlatformEngineArchSize (bytes)Diff
androidhermesarm64-v8a7,211,837-182,156
androidhermesarmeabi-v7a6,861,013-156,200
androidhermesx867,646,477-185,632
androidhermesx86_647,537,421-188,270
androidjscarm64-v8a9,370,806-165,392
androidjscarmeabi-v7a9,012,102-139,124
androidjscx869,233,530-167,344
androidjscx86_649,810,678-171,906

Base commit: 36b0f7d

@grabbou

This comment has been minimized.

@elicwhite

This comment has been minimized.

@mrousavy

This comment has been minimized.

@sunnylqm

This comment has been minimized.

Comment threadpackages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj Outdated
Comment threadscripts/hermes-binary.sh Outdated
Comment threadscripts/react-native-xcode.sh
@grabbou

This comment has been minimized.

friederbluemleand 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: react#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
Copy Markdown

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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedThis label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.MergedThis PR has been merged.p: CallstackPartner: CallstackPartner

Projects

None yet

17 participants

@grabbou@analysis-bot@elicwhite@mrousavy@sunnylqm@Huxpro@thymikee@alloy@hramos@yungsters@react-native-bot@denissb@appden@mhorowitz@empyrical@facebook-github-bot@friederbluemle