inlineRequires and experimentalImportSupport
See original GitHub issueDo 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
and experimentalImportSupport
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?
let VeryExpensive = null;
if (VeryExpensive == null) {
VeryExpensive = require('./VeryExpensive').default;
}
Or steel need to write that?
Is inlineRequires
working for native modules?
How it detecting when need to import file/init native module?
Issue Analytics
- State:
- Created 3 years ago
- Comments:11
Top Results From Across the Web
Metro: Also enable `disableImportExportTransform ... - GitHub
When enabling experimentalImportSupport in metro.config.js: module.exports ... transform: { experimentalImportSupport: true, inlineRequires: true, } ...
Read more >Configuring Metro - Meta Open Source
If inlineRequires is an object, inline requires are enabled in all modules, except ones whose absolute paths appear as keys of ...
Read more >Karan on Twitter: "@Burrewoo @Baconbrix You can also give ...
You can use the `experimentalImportSupport` option: https://t.co/5zdnYoSVJn to avoid doing writing inline requires manually." / Twitter ...
Read more >How to import files from outside of root directory with React ...
A simple solution could be to create a symlink inside the root directory but metro bundler doesn't support symlink. So we're going to...
Read more >RAM Bundles and Inline Requires - React Native
If you have a large app you may want to consider the Random Access Modules (RAM) bundle format, and using inline requires.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub 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.
inlineRequires
described here: https://reactnative.dev/blog/2021/03/12/version-0.64#inline-requires-enabled-by-default