question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

inlineRequires and experimentalImportSupport

See original GitHub issue

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 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:closed
  • Created 3 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
raajnadarcommented, Mar 2, 2021

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.

0reactions
Bardiamistcommented, Mar 15, 2021
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found