Skip to content

Conversation

@nmn
Copy link
Collaborator

@nmn nmn commented Sep 23, 2025

What changed / motivation ?

The previous PR adds support for descendent/sibling selectors but only with a defaultMarker. That works for many common cases, but sometimes more that one marker is needed to differentiate between two ancestors, or two siblings etc.

This PR adds an API for defining custom markers with the defineMarker API.

Additional Context

Needs a little more testing to build confidence. The same value needs to be both a string and an object in different situations, so we need to be a bit careful.

Pre-flight checklist

@meta-cla meta-cla 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 Sep 23, 2025
@github-actions
Copy link

github-actions bot commented Sep 23, 2025

workflow: benchmarks/perf

Comparison of performance test results, measured in operations per second. Larger is better.

[email protected] compare
node ./compare.js /tmp/tmp.eSuIWGkREO /tmp/tmp.0NnEJ2nFmf

Results Base Patch Ratio
babel-plugin: stylex.create
· basic create 622 615 0.99 -
· complex create 200 181 0.91 !!
babel-plugin: stylex.createTheme
· basic themes 455 443 0.97 -
· complex themes 43 42 0.98 -

@github-actions
Copy link

github-actions bot commented Sep 23, 2025

workflow: benchmarks/size

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

[email protected] compare
node ./compare.js /tmp/tmp.AEqGQQ5Nn7 /tmp/tmp.A884WOSax9

Results Base Patch Ratio
@stylexjs/stylex/lib/cjs/stylex.js
· compressed 1,278 1,296 1.01 +
· minified 3,986 4,111 1.03 +
@stylexjs/stylex/lib/cjs/inject.js
· compressed 1,223 1,223 1.00
· minified 3,216 3,216 1.00
benchmarks/size/.build/bundle.js
· compressed 496,650 496,650 1.00
· minified 4,847,840 4,847,840 1.00
benchmarks/size/.build/stylex.css
· compressed 99,853 99,853 1.00
· minified 747,541 747,541 1.00

@nmn nmn force-pushed the feat/define-marker branch from 7ddc5b7 to ccc164a Compare October 13, 2025 05:11
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.

1 participant