Skip to content

Switch to UTF-16 sorts #2065

Done
Done

Description

@hurrymaplelad

Describe the feature request

Problem

Today Stylex sorts some rules in generated files via localeCompare, which uses ICU Collation under the hood.

This has several challenges:

  1. Build output can vary with the locale the machine is built on.
  2. Collation rules change with ICU version as language rules are added or refined.
  3. 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

  1. added
    enhancement
    on Nov 23, 2026
  2. hurrymaplelad commented on Nov 23, 2026

    @hurrymaplelad
    ContributorAuthor

    #2066 implements this proposal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions