-
Notifications
You must be signed in to change notification settings - Fork 143
RFC: lean core JSC #836
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
RFC: lean core JSC #836
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| --- | ||
| title: Extract JSC (JavaScriptCore) from React Native Core | ||
| author: | ||
| - Kudo Chien <[email protected]> | ||
| date: 2024-11-28 | ||
| --- | ||
|
|
||
| # RFC0836: Extract JSC (JavaScriptCore) from React Native Core | ||
|
|
||
| ## Summary | ||
|
|
||
| This RFC proposes a Lean Core effort to extract JSC (JavaScriptCore) from React Native's core. | ||
|
|
||
| ## Proposed Changes and Timeline | ||
|
|
||
| - Version 0.77: Remove the [`jsc-android` npm dependency](https://github.com/facebook/react-native/blob/2d337efc23c662143b3f39a6c994d80fec047054/packages/react-native/package.json#L132) from React Native and instead download the artifact from Maven Central. When using Hermes, downloading the unused npm dependency is unnecessary and removing it saves about 32 MB of uncompressed size. | ||
| - Version 0.78 or 0.79: Introduce a new `react-native-javascriptcore` npm package with a newer version of JavaScriptCore for Android. In this version, we will only provide the [Intl variant](https://github.com/react-native-community/jsc-android-buildscripts/blob/9c61fece4753902a2cd6d29dfa46b7b521f0c821/README.md#international-variant), as newer JavaScriptCore versions do not support disabling Intl. The existing JSCRuntime from the core should still function with this version but will display a deprecation warning during build time. A challenge will be managing the core JSCRuntime alongside the third-party JSCRuntime from `react-native-javascriptcore`; further study is required. | ||
| - Version 0.80: Completely remove JavaScriptCore from the core: | ||
| - Eliminate `JSCRuntime` code. | ||
| - Deprecate Gradle's `hermesEnabled` and Podfile's `hermes_enabled`, making them no-ops. | ||
Kudo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - Update documentation at https://reactnative.dev/docs/hermes. | ||
|
|
||
cortinico marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ## Motivation | ||
|
|
||
| Since Hermes has become the dominant JavaScript engine in the React Native ecosystem, it is inefficient to include unused JavaScriptCore code and binaries in the core. By extracting JavaScriptCore to a separate, third-party maintained library, we can streamline the core and reduce unnecessary bloat. | ||
|
|
||
| ## Adoption strategy | ||
Kudo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| We will offer a drop-in replacement with the `react-native-javascriptcore` npm package while maintaining JSC support in the core for two additional React Native releases to ensure a smooth transition. | ||
|
||
|
|
||
| ## How we teach this | ||
|
|
||
| We will announce the upcoming changes in the version 0.77 release notes and provide guidance for developers on migrating to the new `react-native-javascriptcore` package. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed in 0.77 for 16KB page support?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but if there's concern to cherry-pick facebook/react-native#47972 to 0.77. we can postpone the mavenCentral migration to 0.78. on 0.77 we still use jsc-android npm package for a newer version with android 16kb page support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather go with 0.78.
Our take on 16K support is that it's Hermes first. Originally we were not even planning to include JSC for 16K support.