Skip to content

Commit 0008afb

Browse files
committed
Refactor <style> Resource implementation to group on flush
There is a problem with <style> as resource. For css-in-js libs there may be an very large number of these hoistables being created. The number of style tags can grow quickly and to help reduce the prevalence of this FIzz now aggregates all style tags for a given precedence into a single tag. The client can 'hydrate' against these componund tags but currently on the client insertions are done individually.
1 parent b2ae9dd commit 0008afb

File tree

11 files changed

+669
-373
lines changed

11 files changed

+669
-373
lines changed

packages/react-dom-bindings/src/client/ReactDOMFloatClient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ function styleTagPropsFromRawProps(
663663
function getStyleKey(href: string) {
664664
const limitedEscapedHref =
665665
escapeSelectorAttributeValueInsideDoubleQuotes(href);
666-
return `href="${limitedEscapedHref}"`;
666+
return `href~="${limitedEscapedHref}"`;
667667
}
668668

669669
function getStyleTagSelectorFromKey(key: string) {

0 commit comments

Comments
 (0)