Skip to content
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

fix: fix valid-shorthands object casting error on css-shorthand-expand null return #814

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

mellyeliu
Copy link
Member

@mellyeliu mellyeliu commented Dec 17, 2024

What changed / motivation ?

Certain complex shorthand values like '4px solid var(--fds-gray-10)' seem to trip up the css-shorthand-expand package, which defaults to returning null. Let's handle the cases by prematurely returning and not providing an autofix in such cases.

Testing

Still identifying repros to make the test more robust

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 17, 2024
Copy link

github-actions bot commented Dec 17, 2024

workflow: benchmarks/size

Comparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.

@stylexjs/[email protected] size:compare
./size-compare.js /tmp/tmp.uqzSC1poOr /tmp/tmp.0lqXL2tKEC

Results Base Patch Ratio
stylex/lib/stylex.js
· compressed 729 729 1.00
· minified 2,541 2,541 1.00
stylex/lib/StyleXSheet.js
· compressed 1,266 1,266 1.00
· minified 3,776 3,776 1.00
rollup-example/.build/bundle.js
· compressed 567,110 567,110 1.00
· minified 10,232,512 10,232,512 1.00
rollup-example/.build/stylex.css
· compressed 100,626 100,626 1.00
· minified 757,176 757,176 1.00

import stylex from 'stylex';
const styles = stylex.create({
main: {
borderRight: '4px solid var(--fds-gray-10)'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still identifying repros to make the test more robust

@mellyeliu mellyeliu marked this pull request as ready for review December 17, 2024 20:12
Copy link
Contributor

@Prakshal-Jain Prakshal-Jain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming we are aligned that we should return if css shorthand expand fails, the changes LGTM.
@nmn please feel free to chime in since you have more context 🙂

@mellyeliu
Copy link
Member Author

mellyeliu commented Dec 17, 2024

Lint error will still be triggered, we just will not provide an autofix. Merging as SEV follow up

@mellyeliu mellyeliu merged commit db00997 into main Dec 17, 2024
8 checks passed
@mellyeliu mellyeliu deleted the cli-cache branch December 17, 2024 21:03
aminaopio pushed a commit to aminaopio/stylex that referenced this pull request Dec 22, 2024
aminaopio pushed a commit to aminaopio/stylex that referenced this pull request Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants