-
Notifications
You must be signed in to change notification settings - Fork 629
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
inlineRequires and experimentalImportSupport #640
Comments
Hey the concept is pretty much straight forward. You import modules inline in simple terms load data on demand. This will help to cut the size of the main bundle and load the very less used code on demand or only when required. I believe this is only for Js files & Js bundle. Because metro can bundle only Js files and not the native code. |
But how metro detecting when need to load some file? On some component render or when? |
https://reactnative.dev/docs/ram-bundles-inline-requires#inline-requires this will answer all the question with a simple use case. |
I read that before create that issue. Did you read my questions?:) I got next code from your link
I can do it even with Now I got only one answer: Metro working only with JS and no effect to native modules. Still have next questions: |
Why I want to understand it?Because I want to control flow. src/initialImports/reactotron.ts
src/initialImports/index.ts
src/index.tsx
index.js
Another reasonIt is importent to undestand how it works for require polifils for example. I need to be sure that that will work:
|
Another related issue I faced previously brix/crypto-js#259 (comment) |
You are not getting the simple concept if the If the flag is eg: - Let's say your final bundle size is |
@raajnadar You talking about result. Your answer contains only general obvious things. Do you read my questions exactly?
How metro detecting that is need to load a part or the bundle? @raajnadar Thanks for answers buy I get the impression that you do not know the answer. Did you developed |
The code base of metro is open source you can dig into the source code to know how inline require works. And IDK how you concluded that inline require false is not loading the whole bundle. Did you even try to check if the file you imported is bundled properly. |
https://reactnative.dev/docs/ram-bundles-inline-requires#investigating-the-loaded-modules |
|
Do you want to request a feature or report a bug?
Question
What is the current behavior?
Mystery
What is the expected behavior?
It should be well documented
Hello, I really need to understund how
inlineRequires
andexperimentalImportSupport
works but can't find documentation abount it. Where I can read about it? Or can somebode to describe how it works?Is
inlineRequires
automatically doing next?Or steel need to write that?
Is
inlineRequires
working for native modules?How it detecting when need to import file/init native module?
The text was updated successfully, but these errors were encountered: