Open kof opened 5 years ago
@kof Do you need help with this one ? This is something I miss for long time.
To add on this. This behavior breaks prerendering any html page (e.g. for crawlers). As the CSS wont be included the actual HTML file. Maybe we could just set a global variable (which could be set beforehand by any kind of prerenderer) to decide wether or not to use DOM API or CSSOM insertRule.
@FabianSellmann I dont' think insertRule API has any impact on SSR critical css extraction or any other way crowlers are downloading the page.
In cases where style rules are linked, we use CSSOM insertRule API. This happens automatically when using rule and value functions in react-jss or link:true option from the core.
Negative aspect of insertRule API is
Positive aspects of insertRule
To improve DX, we can use a slow way to render in DEV mode only over DOM API.