Repository navigation
refactor(web): port the docs type generator to the typescript 7 api - #574
Merged
kianbazza merged 1 commit intoSep 29, 2026
Conversation
kianbazza
added this pull request to stack #570
September 29, 2026 14:31
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
kianbazza
force-pushed
the
ui-627-port-the-docs-type-generator-to-the-typescript-7-api
branch
from
September 29, 2026 14:34
5ca14a8 to
01944cd
Compare
Moves `apps/web/scripts/build-types-meta.ts` from the TypeScript 5 compiler API to TypeScript 7's `typescript/unstable/sync` API and drops the `typescript5` alias, so the repo carries one TypeScript version. Regenerates `apps/web/.types/types-meta.json`; the extracted types, props, and docs match the previous output apart from union ordering and a few noted differences.
kianbazza
force-pushed
the
ui-627-port-the-docs-type-generator-to-the-typescript-7-api
branch
from
September 29, 2026 14:54
01944cd to
ad6f2b2
Compare
kianbazza
marked this pull request as ready for review
September 29, 2026 14:58
This branch was successfully deployed
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.
Summary
The generator's logic and output schema are unchanged. What changed is how it reaches TypeScript. TypeScript 7 has no classic compiler API; its checker runs in a separate process that
typescript/unstable/synctalks to. The port maps each call across:typeToStringtakes theTypeFormatFlagsvalues as numbers, since TS 7 doesn't export the enum.The analysis project is a throwaway tsconfig next to
apps/web/tsconfig.json, soextends,pathsand type roots resolve as before. It's gitignored and removed on exit, on failure, and on Ctrl-C.Three places reproduce TypeScript 5 behaviour that TypeScript 7 doesn't share, so the docs tables stay the same:
propertyOrderrestores TS 5's order: the interface's own members in source order, then each base inextendsorder.DropdownMenuRootProps.childrenkeeps Base UI's Popover description.ColumnDataType's annotated union.Evidence
bun run docs:type-genneedstypescript5(TypeScript 5.9.3) next to TypeScript 7.After: it runs on TypeScript 7 only, in about 3 s (same as before), and produces identical output on repeated runs.
types-meta.jsonwas compared against the previous generator's output on the same sources. Union and intersection members were compared as sets and everything else in order:required,default,shortType, enum members and theirvalueType,typeParamsand type docs are all identical. No union member or argument changed.type/formattedTypestrings differ only in union member order: TS 7 orders unions differently, e.g.((props, state) => ReactElement) | ReactElement.definitions now use source formatting: repo indentation, no semicolons, comments kept.Pick/Omit-derived types such asCheckboxItemDef,ComboboxSurfaceProps,SelectSurfacePropsand the registryFilter*Props, where TS 5's order was effectively arbitrary. Component*Propstables likeDropdownMenuItemPropsandComboboxItemPropsare unchanged.*SurfaceProps.childrennow show "Children (Input, List, etc.)" where they had no description.BreadcrumbNode.node, andcontentonDropdownMenuSurfaceProps/SelectSurfaceProps.Merge Danger
Door: two-way
Revert to restore the TS 5 generator (and re-add the
typescript5alias).Blast Radius: docs type tables
The docs render
types-meta.jsondirectly, so the order and description changes above are visible on the component API pages.typescript/unstable/*can change in any TypeScript release;typescriptis pinned to7.0.2exactly, and a TypeScript bump should re-rundocs:type-genand diff the output.Closes UI-627