kirillzyusko / react-native-bundle-splitter

HOC for lazy components loading

Home Page:https://kirillzyusko.github.io/react-native-bundle-splitter/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it an add-on over inline requires + ram bundles ?

tarun-khanna opened this issue · comments

Hi @kirillzyusko,
Thank you for the library.

My project has RN 0.63.4
I have already added inline requires everywhere in my project for the heavy component screens as per RN docs (https://reactnative.dev/docs/ram-bundles-inline-requires).
I have also enabled RAM bundling for android.

Upon investigating the loaded modules, I observed the total number of loaded modules fell from around 3.3k to 350.
But still I don't see significant reduction in app start time.

I wanted to know if this library is an add-on over inline requires and ram bundles and can it help me reduce more start time of the app ?

Hi @tarun-khanna
This library is a simple wrapper around RAM bundles functionality with unified API and some useful functions (such as preloading, caching etc.)

That's strange, that startup time wasn't decreased. Because 350 modules ~ hello world RN app. So startup time should be really fast!

From my experience, I can say, that decreasing ~1000 modules led to 1s improvement. These values are rough, but can give an approximate result. I don't know, why it didn't give you any benefits😔

Hey @kirillzyusko
Thank you for your quick response :)

Can you tell me if replacing inline requires with your library's register api will help in any case or it won't bring much difference ?
I haven't added this lib yet and thus want to know will it be really worth the effort or not. :|

@tarun-khanna I don't think you will get any benefits. You can try, but if you are sure, that you properly implemented inline requires in your app, then it doesn't make sense.

The main purpose of this library was to provide preloading API to deliver best UX to end user. Because if you will load additional 0.5Mb of bundle during the app runtime, it may slightly freeze the app. With preloading API you can do it in invisible mode (in parallel with data fetching from internet, for example). That was the main purpose.

Alright, thanks a lot @kirillzyusko for your inputs! 😄