Skip to content

P4 (part 4): rename source to bare canonical names + invert compat generator - #2932

Merged
ejhammond merged 3 commits into
xds-unprefix-integrationfrom
navi/refactor/p4-source-rename-phase4
Jun 19, 2026
Merged

ejhammond merged 3 commits into
xds-unprefix-integrationfrom
navi/refactor/p4-source-rename-phase4

Conversation

@ejhammond

Copy link
Copy Markdown
Contributor

What

Completes P4 — the source-of-record rename. Bare names (Button, useTheme, ButtonVariantMap) are now canonical in source; the XDS* names become generated compat re-export aliases.

  • 320 files renamed (XDSButton.tsx → Button.tsx, useXDSTheme.ts → useTheme.ts, etc.)
  • ~12k XDS*/useXDS* identifiers flipped to bare across core source
  • Compat generator inverted — now emits XDS* aliases from bare canonical (Button as XDSButton), with a guard to skip names re-exported from sibling modules (avoids duplicate root export * aliases). 102 barrels regenerated.
  • Module augmentation preserved — verified empirically that consumer declare module { interface XDSButtonVariantMap } augmentations flow through the re-export alias to the canonical bare interface (the re-export form preserves augmentability; a type alias would not).

Collisions disambiguated

The rename surfaced 3 genuine pre-existing name clashes (component-canonical-bare vs an unrelated bare type). All have zero fbsource consumers; resolved by keeping the prominent component name canonical and giving the data type a specific name:

Was (both bare after naive flip) Resolution
Token (UI component) vs Token (CodeBlock tokenizer type) tokenizer type → SyntaxToken
SyntaxTheme (provider component) vs SyntaxTheme (defineSyntaxTheme interface) interface → SyntaxThemeDefinition
HeadingLevel (Heading numeric 1–6) vs HeadingLevel (theme 'h1'..'h6' tags) theme type → HeadingTag

Validation

  • @xds/core tsc: 0 errors
  • Build: success (xds.css + sibling astryx.css both emit)
  • Full vitest suite: 3157/3157 pass

Scope notes

Package scope stays @xds/*; layer names unchanged (xds-base/xds-theme) per P0 decision 4. Stacks on the dual-emit work (#2928, already merged). CI doesn't auto-run on integration PRs; validated locally as above.

- Flip all XDS<Cap>/useXDS<Cap> identifiers to bare across 554 core source files
- git mv 377 files (XDS*.tsx/.ts/useXDS*.ts -> bare filenames)
- Invert compat generator: emit XDS* aliases FROM bare canonical
  (prefixedName/collectExistingPrefixedNames); regenerate 102 barrels
- Remove 5 now-redundant self-referential @deprecated alias decls
  (StackAlignment/CenterAxis/SideNavCollapseState/TopNavSlot/TopNavSlotContext)
- Rewrite compat-aliases.test.tsx for the inverted direction (XDS* alias -> bare canonical)

Remaining tsc errors (2 collisions, flip-induced, need disambiguation):
- Token: component (now bare) collides with CodeBlock's tokenizer Token type
- HeadingLevel: generator over-emits XDSHeadingLevel alias in both Text + Heading
  barrels (Text re-exports Heading's types)
WIP commit for durability; not yet building clean.
Resolves all flip-induced collisions; @xds/core typecheck passes (0 errors).

Fixes since the WIP commit:
- Generator: skip aliasing names re-exported from a sibling module (../X) to
  avoid duplicate XDS* aliases at the root export * barrel.
- Barrel intra-block duplicate specifiers deduped (Center/Layout/Stack).
- compat-aliases.test.tsx rewritten for the inverted (bare-canonical) direction.
- UseXDS<Cap> -> Use<Cap> across core (47 files) — the flip's \bXDS regex
  missed mid-word Use*XDS* convention names; regen produced correct single
  XDS* aliases.
- Disambiguated 3 genuine name collisions the rename surfaced (all zero
  fbsource consumers), keeping the prominent component name canonical:
  * CodeBlock tokenizer 'Token' type -> SyntaxToken (Token = the UI component)
  * defineSyntaxTheme 'SyntaxTheme' interface -> SyntaxThemeDefinition
    (SyntaxTheme = the provider component)
  * theme/types 'HeadingLevel' ('h1'..'h6' tags) -> HeadingTag
    (HeadingLevel = the Heading component's numeric 1-6 prop type)

Module augmentation preserved (XDS* aliases are re-export form; verified
consumers augmenting XDS*VariantMap flow to the bare canonical interface).
@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

@ejhammond must be a member of the Meta Open Source team on Vercel to deploy.
- Click here to add @ejhammond to the team.
- If you initiated this build, request access.

Learn more about collaboration on Vercel and other options here.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 19, 2026
The snapshot file + keys moved with the XDSFormLayout->FormLayout rename; the
data-style-src paths and describe-block keys update to the bare name. Content
otherwise matches (dual astryx-/xds- classes from the earlier dual-emit work).
@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
xds-sandbox Error Error Jun 19, 2026 4:44am

Request Review

@ejhammond
ejhammond merged commit 93c9c39 into xds-unprefix-integration Jun 19, 2026
2 of 3 checks passed
ejhammond added a commit that referenced this pull request Jun 19, 2026
…nerator (#2932)

* P4 (part 4) WIP: source rename to bare canonical + inverted generator

- Flip all XDS<Cap>/useXDS<Cap> identifiers to bare across 554 core source files
- git mv 377 files (XDS*.tsx/.ts/useXDS*.ts -> bare filenames)
- Invert compat generator: emit XDS* aliases FROM bare canonical
  (prefixedName/collectExistingPrefixedNames); regenerate 102 barrels
- Remove 5 now-redundant self-referential @deprecated alias decls
  (StackAlignment/CenterAxis/SideNavCollapseState/TopNavSlot/TopNavSlotContext)
- Rewrite compat-aliases.test.tsx for the inverted direction (XDS* alias -> bare canonical)

Remaining tsc errors (2 collisions, flip-induced, need disambiguation):
- Token: component (now bare) collides with CodeBlock's tokenizer Token type
- HeadingLevel: generator over-emits XDSHeadingLevel alias in both Text + Heading
  barrels (Text re-exports Heading's types)
WIP commit for durability; not yet building clean.

* P4 (part 4): complete source rename to bare canonical — tsc clean

Resolves all flip-induced collisions; @xds/core typecheck passes (0 errors).

Fixes since the WIP commit:
- Generator: skip aliasing names re-exported from a sibling module (../X) to
  avoid duplicate XDS* aliases at the root export * barrel.
- Barrel intra-block duplicate specifiers deduped (Center/Layout/Stack).
- compat-aliases.test.tsx rewritten for the inverted (bare-canonical) direction.
- UseXDS<Cap> -> Use<Cap> across core (47 files) — the flip's \bXDS regex
  missed mid-word Use*XDS* convention names; regen produced correct single
  XDS* aliases.
- Disambiguated 3 genuine name collisions the rename surfaced (all zero
  fbsource consumers), keeping the prominent component name canonical:
  * CodeBlock tokenizer 'Token' type -> SyntaxToken (Token = the UI component)
  * defineSyntaxTheme 'SyntaxTheme' interface -> SyntaxThemeDefinition
    (SyntaxTheme = the provider component)
  * theme/types 'HeadingLevel' ('h1'..'h6' tags) -> HeadingTag
    (HeadingLevel = the Heading component's numeric 1-6 prop type)

Module augmentation preserved (XDS* aliases are re-export form; verified
consumers augmenting XDS*VariantMap flow to the bare canonical interface).

* P4 (part 4): regenerate FormLayout snapshot after rename

The snapshot file + keys moved with the XDSFormLayout->FormLayout rename; the
data-style-src paths and describe-block keys update to the bare name. Content
otherwise matches (dual astryx-/xds- classes from the earlier dual-emit work).
@cixzhang
cixzhang deleted the navi/refactor/p4-source-rename-phase4 branch June 21, 2026 17:03

This branch had an error being deployed

1 failed deployment
Preview — 73b5b213 Deployed Jun 19, 2026 by vercel[bot]
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 Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant