-
Notifications
You must be signed in to change notification settings - Fork 329
[babel-plugin] Make 'property-specificity' the default 'styleResolution' #1064
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
Conversation
workflow: benchmarks/perfComparison of performance test results, measured in operations per second. Larger is better.
|
d643302
to
f23901b
Compare
workflow: benchmarks/sizeComparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.
|
I tested one of the runtime impacts of this change. The styleq runtime has benchmarks, and I added a couple of fixtures to represent the different compiled style objects created by StyleX for
This is the source style (taken from one of the StyleX unit tests) export const styles = stylex.create({
error: {
borderColor: 'red blue',
borderStyle: 'dashed solid',
borderWidth: '0 0 2px 0',
margin: 'calc((100% - 50px) * 0.5) 20px 0',
padding: 'calc((100% - 50px) * 0.5) var(--rightpadding, 20px)',
},
short: {
borderBottomWidth: '5px',
borderBottomStyle: 'solid',
borderBottomColor: 'red',
borderColor: 'var(--divider)',
borderRadius: borderRadius * 2,
borderStyle: 'solid',
borderWidth: 1,
marginTop: 'calc((100% - 50px) * 0.5)',
marginRight: 20,
marginBottom: 0,
paddingTop: 0,
},
}); The output for // property-specificity output
export const styles = {
error: {
kVAM5u: "xs4buau",
ksu8eU: "xn06r42",
kMzoRj: "xn43iik",
kogj98: "xe4njm9",
kmVPX3: "x1lmef92",
$$css: true
},
short: {
kt9PQ7: "xa309fb",
kfdmCh: "x1q0q8m5",
kL6WhQ: "xud65wk",
kVAM5u: "x1lh7sze",
kaIpWk: "x12oqio5",
ksu8eU: "x1y0btm7",
kMzoRj: "xmkeg23",
keoZOQ: "xxsse2n",
km5ZXQ: "x1wh8b8d",
k1K539: "xat24cr",
kLKAdn: "xexx8yu",
$$css: true
}
}; The output for // application-order output
export const styles = {
error: {
kVAM5u: "xs4buau",
kzOINU: null,
kGJrpR: null,
kaZRDh: null,
kBCPoo: null,
k26BEO: null,
k5QoK5: null,
kLZC3w: null,
kL6WhQ: null,
ksu8eU: "xn06r42",
kJRH4f: null,
kVhnKS: null,
k4WBpm: null,
k8ry5P: null,
kSWEuD: null,
kDUl1X: null,
kPef9Z: null,
kfdmCh: null,
kMzoRj: "xn43iik",
kjGldf: null,
k2ei4v: null,
kZ1KPB: null,
ke9TFa: null,
kWqL5O: null,
kLoX6v: null,
kEafiO: null,
kt9PQ7: null,
kogj98: "xe4njm9",
kUOVxO: null,
keTefX: null,
koQZXg: null,
k71WvV: null,
km5ZXQ: null,
kqGvvJ: null,
keoZOQ: null,
k1K539: null,
kmVPX3: "x1lmef92",
kg3NbH: null,
kuDDbn: null,
kE3dHu: null,
kP0aTx: null,
kpe85a: null,
k8WAf4: null,
kLKAdn: null,
kGO01o: null,
$$css: true
},
short: {
kVAM5u: "x1lh7sze",
kzOINU: null,
kGJrpR: null,
kaZRDh: null,
kBCPoo: null,
k26BEO: null,
k5QoK5: null,
kLZC3w: null,
kL6WhQ: null,
kaIpWk: "x12oqio5",
krdFHd: null,
kfmiAY: null,
kVL7Gh: null,
kT0f0o: null,
kIxVMA: null,
ksF3WI: null,
kqGeR4: null,
kYm2EN: null,
ksu8eU: "x1y0btm7",
kJRH4f: null,
kVhnKS: null,
k4WBpm: null,
k8ry5P: null,
kSWEuD: null,
kDUl1X: null,
kPef9Z: null,
kfdmCh: null,
kMzoRj: "xmkeg23",
kjGldf: null,
k2ei4v: null,
kZ1KPB: null,
ke9TFa: null,
kWqL5O: null,
kLoX6v: null,
kEafiO: null,
kt9PQ7: null,
keoZOQ: "xxsse2n",
km5ZXQ: "x1wh8b8d",
keTefX: null,
k71WvV: null,
k1K539: "xat24cr",
kLKAdn: "xexx8yu",
$$css: true
}
}; |
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.
lgtm! js size improvements look great
maybe we queue this for the next release because the 0.13.0 has some breaking changes already
f23901b
to
5d08e71
Compare
Changing the default styleResolution enforces more disallowed shorthands and reduces the size of the generated JavaScript objects.
5d08e71
to
75194ef
Compare
Changing the default styleResolution enforces more disallowed shorthands and reduces the size of the generated JavaScript objects.
Summary of the benchmark results is below.
create
.Every metric we track is significantly improved or neutral as a result of this change.
Notes: