Code Monkey home page Code Monkey logo

Comments (1)

faceyspacey avatar faceyspacey commented on July 29, 2024

yea, that's a yet-to-be-solved problem in all of the React game. The only solution is looking like we're gonna have to push things back to the route level, which is the plan for Redux-First Router. I.e. code-splitting coupled to your routing tools.

For now, you're just gonna have to make a hash of routes to chunk names and manually serve the correct chunks (their css + js) based on the route.

I'm gonna close this as I have things in the works for this as part of the Rudy rollout.

ps. styled-components et al are currently grappling with this as well. Most of these packages don't even want to deal with this, as it means a major refactoring, and it's unclear if it's even going to work glitch-free to send style tags at the end of each component. It will work technically, but while streaming, my guess is it might look glitchy on first load on the client, especially on slower connections. If that turns out to be the case, then static route-level-disocvered sheets will be the only solution for real, which is unfortunate since those new css components are otherwise the "right" way for react. That said, you'll still be able to use those components, just not with render-time css. They'll have to make a version of their packages geared towards a more static approach, similar to extractStatic in emotion.

from webpack-flush-chunks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.