-
Notifications
You must be signed in to change notification settings - Fork 620
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lazily import
metro-hermes-compiler
(#856)
Summary: - There are [general performance improvements](#855) from conditionally importing Hermes. - `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: <img width="1900" alt="Screen Shot 2022-08-23 at 1 28 43 PM" src="https://user-images.githubusercontent.com/9664363/186146899-57817ce9-9cef-439b-a421-98b9aec216fb.png"> This PR doesn't fix the core issue but it does alleviate Metro web and JSC development where Hermes is not used: ``` TypeError [ERR_INVALID_ARG_TYPE]: The "to" argument must be of type string. Received undefined at new NodeError (node:internal/errors:371:5) at validateString (node:internal/validators:119:11) at Object.relative (node:path:1192:5) at MetroTerminalReporter._getBundleStatusMessage (/Users/evanbacon/Documents/GitHub/expo/packages/expo/cli/build/src/start/server/metro/MetroTerminalReporter.js:44:41) at /Users/evanbacon/Documents/GitHub/expo/node_modules/metro/src/lib/TerminalReporter.js:393:14 at Array.map (<anonymous>) at MetroTerminalReporter._getStatusMessage (/Users/evanbacon/Documents/GitHub/expo/node_modules/metro/src/lib/TerminalReporter.js:392:8) at MetroTerminalReporter.update (/Users/evanbacon/Documents/GitHub/expo/node_modules/metro/src/lib/TerminalReporter.js:423:31) at Object.update (/Users/evanbacon/Documents/GitHub/expo/packages/expo/cli/build/src/start/server/metro/instantiateMetro.js:21:30) at Server.requestProcessor [as _processBundleRequest] (/Users/evanbacon/Documents/GitHub/metro/packages/metro/src/Server.js:653:22) at async Server._processRequest (/Users/evanbacon/Documents/GitHub/metro/packages/metro/src/Server.js:504:9) ``` Pull Request resolved: #856 Test Plan: Throw an error somewhere in the resolver, Metro will throw a reasonable Node error instead of the Hermes error. Reviewed By: motiz88 Differential Revision: D38940701 Pulled By: cipolleschi fbshipit-source-id: 472fa775c5ae6a39acb6d0195f926a1013a4b425
- Loading branch information
1 parent
a028507
commit 71846a4
Showing
7 changed files
with
21 additions
and
11 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
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