PSA: embedding/applying CSS in JS is the surefire way to be on every slow path. Bloats memory, slows parsing & use, hurts caching. Avoid.
-
-
-
Replying to @iamstarkov
Please don't do that. It bloats your memory and slows parse. CSS belongs in CSS files for deployment.
3 replies 0 retweets 4 likes -
-
Replying to @iamstarkov
It blows a lot more memory than ordinary CSS. And yes, if it's strings in JS that you then assign to DOM, it's different to "regular" JS
1 reply 0 retweets 0 likes -
Replying to @slightlylate
I do not assign those objects to ordinary DOM nodes, but rather inject those objects into Style tags in the head
3 replies 0 retweets 0 likes -
Replying to @iamstarkov @slightlylate
I agree with you that cacheability is fine (with chunk splitting), but performance-wise it's still obviously worse than normal CSS.
2 replies 0 retweets 0 likes -
Because now it can't load it progressively, has to parse entire JS first, execute, and only then parse as CSS, and keep in multiple places.
1 reply 0 retweets 1 like -
We can parallelize parse of CSS and JS if they are separate. Can't if CSS is in JS.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
& Web Standards TL; Blink API OWNER
Named PWAs w/
DMs open. Tweets my own; press@google.com for official comms.