-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minify compiled style keys #875
base: main
Are you sure you want to change the base?
Conversation
workflow: benchmarks/sizeComparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.
|
@@ -374,7 +374,7 @@ describe('Evaluation of imported values works based on configuration', () => { | |||
_inject2("@property ----__hashed_var__1jqb1tb { syntax: \\"*\\"; inherits: false;}", 0); | |||
const styles = { | |||
color: color => [{ | |||
"--__hashed_var__1jqb1tb": color == null ? null : "__hashed_var__b69i2g", | |||
kUBWw5: "__hashed_var__b69i2g", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regression for dynamic styles
Updated to use a new feature flag for controlling this behavior - |
Reduce the size of minifed JS by "minifying" the compiled style keys produced by StyleX. This patch uses a base 62 hashing function to generate smaller hashes, which are prefixed with `k` to avoid requiring quotes around hashes that start with a number.
Avoid false positives on code contained within inline babel snapshots
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The config option makes this a lot safer to roll out. Thanks!
I still need to figure out why the dynamic styles output changed |
What changed / motivation ?
Reduce the size of minifed JS by "minifying" the compiled style keys produced by StyleX. This patch uses a base 62 hashing function to generate smaller hashes, which are prefixed with
k
to avoid requiring quotes around hashes that start with a number.Fix #741
Pre-flight checklist
Contribution Guidelines