-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): transform based on engine (#24672)
# Why - Reduce the amount of Babel transformations based on the jsEngine for a particular platform. - Hermes supports more modern language features than the default React Native target, so we don't have to transpile as much. This is an unstable feature that seems reasonable enough to turn on by default. - Users can overwrite the default by using the same `unstable_transformProfile` as before. - Web will also use this newer transform as the majority of modern browsers support more features than Hermes. The following will now be disabled when using Hermes: ``` @babel/plugin-transform-computed-properties @babel/plugin-transform-parameters @babel/plugin-transform-shorthand-properties @babel/plugin-proposal-optional-catch-binding @babel/plugin-transform-function-name @babel/plugin-transform-literals @babel/plugin-proposal-numeric-separator @babel/plugin-transform-sticky-regex @babel/plugin-transform-spread @babel/plugin-proposal-object-rest-spread @babel/plugin-proposal-optional-chaining @babel/plugin-proposal-nullish-coalescing-operator @babel/plugin-transform-runtime -> regenerator ``` And `@babel/plugin-transform-named-capturing-groups-regex` will be enabled. Expressed as a diff: <img width="862" alt="Screenshot 2023-09-28 at 6 03 17 PM" src="https://github.com/expo/expo/assets/9664363/d90f0d9c-5b14-4e4e-9820-b88de9bbd6c8"> <!-- Please describe the motivation for this PR, and link to relevant GitHub issues, forums posts, or feature requests. --> # How - Add an engine flag to the URL to trigger a cache invalidation per-platform if the app.json settings change. - Pass the flag to babel where we can toggle on Hermes mode. # Test Plan - Tested in sandbox, also wrote unit tests for the syntax. --------- Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
- Loading branch information
Showing
15 changed files
with
259 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.