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
Named and default exports have different resolving strategies/behaviors #1093
Comments
|
1 similar comment
|
Hi, when building a RN app, I am moving this issue to React Native. |
Facing the same issue. Because of this inline requires does not work, and entire project has to be parsed just to run app. After switching to named exports, problem solved itself. But logically there should be no difference |
Problem
Hello! Lately I've been working on optimizing the startup time of our application. I learned a lot about how hermes works and how it incrementally resolves imports as we use the values.
I followed this snippet to analyze how many modules were loaded at the Home page of our page and realized it was way too high (5300, which is crazy).
After many attempts at understanding why it would resolve flows and components that were not required in the Home page, I found that Hermes resolves default export by default.
Plus the fact that it will initialize data and allocate to memory currently unwanted stuff and execute top level code.
Explanation:
Whereas
has a completely different behavior.
Is this behavior wanted or not? I feel like I should rewrite all the imports to named imports to work this around. But would be happy to know if there is any other way and if not why it's technically not possible.
Thanks for your answers.
The text was updated successfully, but these errors were encountered: