faceyspacey / react-universal-component

🚀 The final answer to a React Universal Component: simultaneous SSR + Code Splitting
MIT License
1.7k stars 80 forks source link

Question: What's the future of that library with the development react lazy/suspense #202

Open jaybe78 opened 4 years ago

jaybe78 commented 4 years ago

Hi @ScriptedAlchemy,

Just wanted your input regarding the future of the library knowing the recent works that have been done in the react library.

React Lazy provides now a way to do code splitting but does not support SSR yet. From what I've heard there's no plan to make react lazy supports SSR.

So I guess for now external libs like Loadable components or react universal will remain the best choices to take advantage of code splitting in isomorphic applications.

Knowing that, are you gonna keep investing time in the library, making upgrades and fixing bugs ?

What about react suspense ? I have not used it yet. Do you guys know whether it fits well into react universal ?

Cheers

revelt commented 4 years ago

are you gonna keep investing time in the library, making upgrades and fixing bugs ?

The last commit was 6 days ago, it seems authors are dedicated and still maintaining this.

ScriptedAlchemy commented 4 years ago

It’s needs a update. For sure. What I’m considering is incorporating the I built on webpack-external-import. Which is moving to suspense as well. While It’s interleaving isn’t meant to ssr - I’ll look at lifting the capabilities up to newer implementations. If I can, I’d like to incorporate its universal functionality into that. There’s alternatives more dedicated to just ssr and code splitting which is why it’s not been a big priority. But now that I’ve designed a new way to analyze the codebases. I’m thinking I could create something more sophisticated than the classic chunk flushing tactics that everyone still uses on the other competing projects.

Suspense mostly doesn’t work because of the promise issues. But you could make it work if the known async items ere preloaded into require cache. Using the code I write for this project. There’s a good chance I can pre require the code split chunks and make suspense work on a server.

Formidable made a try catch ssr render which kept retrying till all promises loaded and the app would SSR. Webpack knows what the chunks are already. Adding something to the runtime would enable me to introduce a slick solution.