Remove @babel/plugin-transform-async-to-generator from @react-native/babel-preset #873
Closed
jzaefferer started this conversation in Ideas
Replies: 2 comments 1 reply
-
| Hey @jzaefferer - yes in principle we're open to updating these, there are almost certainly a few redundant ones. A few things to bear in mind:
For native |
Beta Was this translation helpful? Give feedback.
1 reply
-
| I'll close this |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Here's an idea to make RN apps slightly smaller and easier to debug, by making stacktraces involving async/await easier to read: Remove @babel/plugin-transform-async-to-generator from the @react-native/babel-preset This transform is no longer needed, since hermes supports async/await natively.
For our app, we've used
yarn expo export --no-minify --no-bytecode --platform android -cto check if the transformed bundle contains_asyncToGeneratorfunctions. This unminified bundle was 21.5 MB. After removing @babel/plugin-transform-async-to-generator from react-native-babel-preset/src/configs/main.js, this dropped to 21.3 MB.For now we're using patch-package to patch @react-native/babel-preset
Looking at all the plugins listed in the preset ( https://github.com/facebook/react-native/blob/main/packages/react-native-babel-preset/package.json#L18-L56 ), I wonder which of these are actually needed these days. There might be more opportunities for smaller and faster bundles.
Is this something that could get accepted as a pull request?
Beta Was this translation helpful? Give feedback.
All reactions