0

I'm working on implementing dynamic bundle loading for React Native. Currently, ReactInstanceManager.Builder only supports asset:// and file:// protocols for loading JavaScript bundles.

I need to support in-memory cached bundles that are fetched and loaded into memory and passed directly to ReactInstanceManager without writing to the file system first.

Is this possible?

Something like

// Custom loader
public class PackageJSBundleLoader extends JSBundleLoader {
...
}

// and Application can pass it in RIM as:
            return ReactInstanceManager.builder()
                    .setApplication(getApplication())
                    .setJSBundleLoader(bundleLoader)  // Use Custom PackageLoader
                    .setJSMainModulePath(getJSMainModuleName())
                    .addPackages(getPackages())
                    .build();
2
  • i think you will still want to write your remote bundle to disk. Specially if you consider memory pressure, you don't know how big the bundle will get over time. Stream into disk and serve it to the React Instance. Commented Nov 19 at 12:37
  • Right. But is in memory option even feasible? Looking at RIM delegate loadscript, we can’t pass content stream directly. Commented Nov 19 at 15:12

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.