Closed robinheghan closed 2 years ago
Some questions:
classnameStandin
value? It should preferably be short, but it also has to be unique so that we don't replace something important.Cool! For the stand-in class name, how about a single unprintable control character like the bell character "\a"? It's as short as it gets and it's probably invalid CSS, or at least unlikely to be used by a sane person.
New commits produce even less whitespace in generated css for faster hashing and dict lookups. Also took Brian's suggestion to use '\a' as the standin classname.
@robinheghan Looks like there are some merge conflicts since I merged your other PR. 😅
I’ll fix it :)
All tests pass, ready to merge :)
This PR makes a big change to how classNames are generated.
Previously the flow worked something like this:
There are some potential performance improvements to this flow:
This PR tries to improve performance by:
String.replace
on the compiled css, replacing the template selector with the hashed class name.Somewhat unrelated, this PR also replaces a bunch of
String.join
calls with direct string concatination (++) where possible, asString.join
shows up as a hot spot when profiling.Depending on the browser, this change represents a 18-30% improvement compared to the current master branch.