-
Notifications
You must be signed in to change notification settings - Fork 637
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
lazily import metro-hermes-compiler
#856
Conversation
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Incidentally, the root cause of the gnarly error handling is the arguments we (used to) pass to Emscripten - we fixed that over in facebook/hermes#698 but haven't actually updated Metro's Hermes build since. For the moment it's mostly unused even internally, and requiring it lazily is the best option. |
Interesting, thanks for the additional info @robhogan! |
# Why Most of the [Exotic mode](https://blog.expo.dev/drastically-faster-bundling-in-react-native-a54f268e0ed1) performance benefits have been integrated in the default Expo CLI bundling pipeline (e.g. [less AST cloning](facebook/metro#854), [faster worker creation](facebook/metro#856)), and as such, the feature no longer needs to be enabled/disabled. Setting `mode: "exotic"` will no longer have any additional effects over the default. # Checklist <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). --------- Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
# Why Most of the [Exotic mode](https://blog.expo.dev/drastically-faster-bundling-in-react-native-a54f268e0ed1) performance benefits have been integrated in the default Expo CLI bundling pipeline (e.g. [less AST cloning](facebook/metro#854), [faster worker creation](facebook/metro#856)), and as such, the feature no longer needs to be enabled/disabled. Setting `mode: "exotic"` will no longer have any additional effects over the default. # Checklist <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). --------- Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
Summary
metro-hermes-compiler
is doing some gnarly error handling that makes debugging Metro quite painful.If you get an error in Metro after
metro-hermes-compiler
has been loaded, it will look something like:This PR doesn't fix the core issue but it does alleviate Metro web and JSC development where Hermes is not used:
Test plan
Throw an error somewhere in the resolver, Metro will throw a reasonable Node error instead of the Hermes error.