Repository navigation
[babel-plugin] Sort compiler output by UTF-16 code units - #2066
Merged
Merged
Conversation
|
@hurrymaplelad is attempting to deploy a commit to the Meta Open Source Team on Vercel. A member of the Team first needs to authorize it. |
This was referenced Nov 23, 2026
Closed
hurrymaplelad
marked this pull request as ready for review
November 23, 2026 23:00
Draft
mellyeliu
approved these changes
Nov 24, 2026
mellyeliu
added a commit
that referenced
this pull request
Dec 3, 2026
Port #2066. Rule ordering, pseudo keys, at-rule keys and createTheme at-rules now compare UTF-16 code units instead of ICU collation, so the icu_collator dependency is gone.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed / motivation?
Replace locale-aware sorting with UTF-16 code-unit order in the JavaScript compiler. CSS assembly uses it for the legacy class name, declared property name, width-query context, declaration text, and full rule text. Pseudo/attribute conditions and theme override at-rule groups use it too, preserving pseudo-element boundaries and
default-first behavior. Numeric priorities and breakpoint direction are unchanged.Linked PR/Issues
Resolves #2065.
Additional context
Assembly can reorder CSS but does not compute class names. Reordered pseudo/attribute conditions and theme override groups can change hashes, compiled class names, metadata keys, and CSS selectors. Rebuild JS and CSS together; the output can invalidate caches. Order still matters if same-priority rules overlap in the cascade. The
icu_collatorcomparisons in #2008's Rust pseudo and stylesheet paths are a follow-up.Test plan:
yarn build,yarn test:packages(2,288 passed),yarn prettier:report,yarn lint:reporton Node 22, and Flow 0.314.0 on Ubuntu 24.04. The eight regression cases and expected hashes cover all seven sites, surrogate-pair ordering, reversed input, and both class hash paths. Seven fail against the base compiler; no existing snapshots changed.Fork Actions have not run (approval required: tests, benchmarks). The Vercel preview requires authorization.
Pre-flight checklist