More clear documentation on Dynamic Imports
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, react, react-native
- Domain
- build-system, documentation
Research direction
Start with the Metro module API documentation section on dynamic import and verify how import() behaves in development versus release builds. Clarify whether release builds preserve lazy loading or fall back to eager loading, and update the documentation so the startup-loading behavior is unambiguous.
Written by the indexing model from the issue text.
Description
Currently, I'm exchanging some lazy loaded routes, that uses functions wrapping "require" in favor of dynamic imports in combination of React.lazy and Suspense.
The problem is, although in development I see in the docs Metro will indeed lazy evaluate the lazy loaded modules, isn't clear that this will actually happen on production too:
"import() calls are supported out of the box. In React Native, using import() automatically splits your application code so that it loads faster during development, without affecting release builds."
from https://facebook.github.io/metro/docs/module-api/#import-dynamic-import
So, it will not affect release builds because is retro compatible to require, or because instead of lazy loading it will statically load for production (in contrast to development)? The docs seems not much clear about it :/
I just need to ensure that the whole app will not be loaded at once on startup and change the current behaviour I'm achieving by using () => require() functions on my navigations.
Thanks in advance! :)
- Dominant language
- JavaScript
- Stars
- 5.6k
- Forks
- 699
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 33
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from react/metro
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
react/metro#1927 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Async chunk URLs drop the file extension, so .cjs async imports fail with "Requiring unknown module"Open
Difficulty 3/5 1-2 days Newbie friendliness 74/100
react/metro#1959 · 2 comments · 2 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
react/metro#1928 · 2 comments · 2 reactions ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 3 days
-
Add: Atlas TVOpenchannels:add check:passed
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 4 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
jaegertracing/jaeger-ui#4547 · 3 comments ·
Maintainers usually reply within 1 day
-
feedback simulation workshop
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
githubnext/gh-aw-workshop#4090 ·
Maintainers usually reply within 1 day
-
bug deck: add to staging level: missing p-feature: Manage Submissions p-feature: Submissions and process priority: MUST HAVE ready for dev lead role: missing size: missing time sensitive
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
hackforla/tdm-calculator#3581 ·
Maintainers usually reply within 2 days