-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: CSS extraction #58
Comments
I've been doing a spike around the creation of a webpack plugin. Current thoughts:
|
@Madou would this be an option? It would be nice to have additional options. However, there may be users who don't want the default behavior to change. |
what option are we talking about? |
I'm wondering if it'll be necessary to extract CSS using the bundler plugin Or can users keep using this library without the css extraction?. Context: I know extracted CSS works more efficiently in the browser, but in some cases is not, such as code--splitting and streaming. (And I think this is one of the main reasons Atomic CSS become necessary) However, most of "(Near) Zero-runtime" CSS libs supports only pre-extracted ones but it has less advantages in React apps. |
ah okay you can keep using the library without CSS extraction 👍 - my advice is if you're publishing a design system or component library to NPM - don't extract to CSS yet in an app that is consuming the design system, or component library, or even just writing their own components - turn on the CSS extraction so you get great performance gains, but still having the same developer experience and behaviour you're used to when writing CSS-in-JS it is purely an additive thing however - again completely optional. |
Excited about this library, nice work 🎉 In terms of code-splitting and SSR, will this support exporting to multiple CSS files that get loaded alongside their relevant async js chunk? I'm thinking about scenarios like nextjs. |
Hi @cloudkite, Currently it's planned to only extract to a single, atomic CSS file, with a critical CSS api available for initial SSR. The need for CSS chunks might not be needed - but it's something we're open to evaluate down the track 😄. |
Main point is to do a pass over their own components + node modules dependencies that are using compiled components and then to extract them to a single, atomic, css sheet.
This would need to be a bundler plugin. Webpack & Parcel.
The idea:
@catlaskit
Gira
Gira
uses compiled components from@catlaskit
Gira
also defines its own compiled components@catlaskit
andGira
, and really anywhere) so whenGira
builds their bundle - it extracts ALL compiled components to a CSS fileCool right?
The text was updated successfully, but these errors were encountered: