Skip to content

fix(docsite): sync ThemingTarget/DerivedVar with the authoring types - #4915

Merged
nynexman4464 merged 1 commit into
mainfrom
fix/docsite-theming-target-deprecatedfor
Aug 11, 2026
Merged

nynexman4464 merged 1 commit into
mainfrom
fix/docsite-theming-target-deprecatedfor

Conversation

@nynexman4464

Copy link
Copy Markdown
Contributor

The docsite data generator emits its own copy of the authoring doc types into src/generated/componentRegistry.ts. Two fields that exist on the canonical types in packages/cli/authoring/doctypes/base/type.ts were never mirrored into that copy:

  • ComponentThemingTarget.deprecatedFor — used by Indicator, CheckboxInput, RadioList
  • ComponentThemingDerivedVar.replaces — used by TextArea

So the generator writes those fields into the registry and then the registry's own interfaces reject them. tsc fails on the generated file:

src/generated/componentRegistry.ts(18835,13): error TS2353: Object literal may only specify
known properties, and '"deprecatedFor"' does not exist in type 'ThemingTarget'.
...
src/generated/componentRegistry.ts(23518,13): error TS2353: Object literal may only specify
known properties, and '"replaces"' does not exist in type 'DerivedVar'.

This blocks pnpm -F @astryxdesign/docsite build — the build compiles, then dies in the TypeScript step.

Verification

# before (on main)
pnpm -F @astryxdesign/docsite generate && pnpm -F @astryxdesign/docsite typecheck
→ 5 errors, exit 2

# after
→ exit 0

Also green: pnpm check:repo, pnpm -F @astryxdesign/docsite test (364 passed), and a full pnpm -F @astryxdesign/docsite build.

No changeset — @astryxdesign/docsite is private and unpublished.

Note on the underlying pattern

The generator's copy has to be kept in step with the authoring types by hand, and nothing checks the two against each other, so this drift is silent until a component actually authors the new field. Worth a follow-up to either derive the emitted interfaces from the authoring types or add a check:sync guard — out of scope here.

The docsite generator keeps its own copy of the authoring doc types.
ComponentThemingTarget.deprecatedFor and ComponentThemingDerivedVar.replaces
were added upstream but never mirrored here, so componentRegistry.ts emits
fields its own interfaces reject and the docsite build fails type checking.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 11, 2026
@vercel

vercel Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview Aug 11, 2026 10:48pm

Request Review

@nynexman4464
nynexman4464 marked this pull request as ready for review August 11, 2026 22:50
@nynexman4464
nynexman4464 merged commit 61d3c10 into main Aug 11, 2026
20 checks passed
@nynexman4464
nynexman4464 deleted the fix/docsite-theming-target-deprecatedfor branch August 11, 2026 23:02
imdreamrunner pushed a commit to is-jain/astryx that referenced this pull request Aug 14, 2026
…eta#4915)

The docsite generator keeps its own copy of the authoring doc types.
ComponentThemingTarget.deprecatedFor and ComponentThemingDerivedVar.replaces
were added upstream but never mirrored here, so componentRegistry.ts emits
fields its own interfaces reject and the docsite build fails type checking.
imdreamrunner added a commit that referenced this pull request Aug 14, 2026
…) (#4916)

* fix(core): TopNavMegaMenu anchors to its trigger outside a <nav> (#4905)

DefaultMegaMenu set its CSS anchor via triggerButtonRef.current?.closest('nav')
and skipped the triggerRef call entirely when no <nav> ancestor exists — so a
standalone render (like the docsite Properties preview) left no element
carrying the anchor name. The panel's position-area then computes to 'none'
and the top-layer popover pins to the viewport top-left corner.

Fall back to anchoring on the trigger button itself so the panel opens below
its trigger wherever the component is rendered.

* fixup: wrap the docs preview in a TopNav instead of changing the anchor logic

Per review: the Properties preview should render TopNavMegaMenu in its real
context. Declare playground.wrapper: TopNav in TopNavMegaMenu.doc.mjs (the
preview injects the component as children, an alias for startContent) so the
panel anchors to the wrapper's <nav> and opens below the bar. Revert the
trigger-anchor fallback in TopNavMegaMenu.tsx and its tests; drop the
changeset since the published component behavior no longer changes.

* fix(docsite): sync ThemingTarget/DerivedVar with the authoring types (#4915)

The docsite generator keeps its own copy of the authoring doc types.
ComponentThemingTarget.deprecatedFor and ComponentThemingDerivedVar.replaces
were added upstream but never mirrored here, so componentRegistry.ts emits
fields its own interfaces reject and the docsite build fails type checking.

---------

Co-authored-by: nynexman4464 <[email protected]>
Co-authored-by: Ivor Zhou <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — ae56abb3 Deployed Aug 11, 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