react-imported-component icon indicating copy to clipboard operation
react-imported-component copied to clipboard

Cooperation with lazy/Suspense

Open wmertens opened this issue 6 years ago • 3 comments

I'm wondering if there is a way to use Suspense and lazy on the browser side in some way together with react-imported-component. Are all the functionalities overlapping, or is RIC basically what l+S will be later when it supports SSR?

What will be the future of RIC and l+S?

wmertens avatar Jun 08 '19 12:06 wmertens

The future for client side is #77, or another way to prefetch the data, making code splitting more "predictable", and, honestly, removing the original idea about Suspense - death by thousands spinners. The same logic could be used to load React.lazy, as long as it's more about pure import, than anything else.

Plus I dont think l+S would ever "support" SSR, as long as it requires integration with a bundler(like loadable-components), or injection to the code(like RIC) - "React" should not be able to afford it.

theKashey avatar Jun 08 '19 12:06 theKashey

What about the integration with Concurrent React, where lazy() helps React know when to pause rendering? Can that be integrated client-side while the import promise is resolving?

wmertens avatar Jun 08 '19 12:06 wmertens

I am looking forward to use React.lazy(with custom thenable) underneath, thus RIP would only orchestrate chunks loading.

theKashey avatar Jun 08 '19 23:06 theKashey