You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today Stylex sorts some rules in generated files via localeCompare, which uses ICU Collation under the hood.
This has several challenges:
Build output can vary with the locale the machine is built on.
Collation rules change with ICU version as language rules are added or refined.
Native builds must bundle or approximate ICU Collation. This is a large dependency, and the versioning challenge makes stable output less likely. (ex: OJ Stylex 795)
Proposal
Gain both performance and simplicity by switching to UTF-16 sorting instead. Output rule order is not user-visible, so locale-aware sorting is of low value here.
Risks
This change should be safe from a browser rendering perspective since Stylex atomic rules preclude ordering conflicts.
This change would alter the output in existing projects, likely breaking caches.
Activity
hurrymaplelad commentedon Nov 23, 2026
#2066 implements this proposal.
[babel-plugin] Sort compiler output by UTF-16 code units (#2066)
StyleX: use UTF-16 code-unit order for compiler sorts
StyleX: use UTF-16 code-unit order for compiler sorts (#797)