You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, prerender_multi_page_bundled() is somewhat suboptimal in generating bundled CSS. Every page declares some CSS files it needs, each of which imports its own graph of dependencies. However, all the CSS modules for every page are combined into a single entry point, which is then bundled by PostCSS. That singular bundle is then used for all generated HTML pages.
This means that if a single page imports module A, and no other page uses A, they will all still bundle A, download it, and apply it. This is additional bundle size which is not desirable or useful to users. It also means devs need to write their CSS to be conservative about content on the page, as it may be applied to unrelated pages. If styles are appropriately isolated, this won't have too much impact, but generic styles like p could totally break other pages they should never have been included with.
I believe this is a limitation of postcss_binary(), but I'll need to do some research to confirm. If so, we will likely need to make a FR to add support for accepting execution-time entry points.
The text was updated successfully, but these errors were encountered:
I believe this is now obsolete given that global styles have been removed and all styles are inlined (#47). Since inlined styles are bundled at the component level, they are known at analysis time. There may be some build time benefit to delaying this work until the page is fully rendered and would run into this problem again, but I don't think this is an immediate problem to worry about.
Spin off from #1.
Currently,
prerender_multi_page_bundled()
is somewhat suboptimal in generating bundled CSS. Every page declares some CSS files it needs, each of which imports its own graph of dependencies. However, all the CSS modules for every page are combined into a single entry point, which is then bundled by PostCSS. That singular bundle is then used for all generated HTML pages.This means that if a single page imports module A, and no other page uses A, they will all still bundle A, download it, and apply it. This is additional bundle size which is not desirable or useful to users. It also means devs need to write their CSS to be conservative about content on the page, as it may be applied to unrelated pages. If styles are appropriately isolated, this won't have too much impact, but generic styles like
p
could totally break other pages they should never have been included with.I believe this is a limitation of
postcss_binary()
, but I'll need to do some research to confirm. If so, we will likely need to make a FR to add support for accepting execution-time entry points.The text was updated successfully, but these errors were encountered: