Track upstream TypeScript 7 (tsgo) APIs needed for kea-typegen migration
@gantoine is already working on this.
Since May 19, 2026.
- Dominant language
- Python
- Stars
- 39.9k
- Forks
- 3.4k
- Avg merge
- 6h 51m
- Merged PRs (30d)
- 232
Description
Context
PR #59070 wires @typescript/native-preview (tsgo) as a shadow type-checker alongside tsc, with typescript@6.0.3 retained via pnpm.overrides for every tool that consumes the programmatic Compiler API. The largest such consumer is kea-typegen, which generates the *Type.ts files we depend on for kea logic typing.
This issue tracks the upstream gaps that block migrating kea-typegen (and the rest of our programmatic-API consumers) off typescript@6.
Why this is blocked today
@typescript/native-preview currently ships zero JS-callable code — package.json has no main/types, only a bin entry that subprocesses the native binary. The "Corsa" IPC API exists in microsoft/typescript-go source (_packages/native-preview/src/api/sync/api.ts) but is not bundled to npm.
Even once Corsa ships, kea-typegen's hot path needs APIs that aren't designed yet:
ts.factory.*— kea-typegen constructs*Type.tsAST nodests.createPrinter— serializes constructed nodes to textchecker.typeToTypeNode— converts a resolvedTypeback into a printableTypeNodechecker.typeToString,checker.getExportsOfModule— listed as gaps, no open PR
There is also an architectural mismatch: kea-typegen holds live ts.Node references across many checker calls and mutates the AST in-memory. Corsa is IPC: opaque handles, serialize/deserialize per call. No in-process AST graph.
Upstream issues to watch
- microsoft/TypeScript#63771 — Transformer Plugin or Compiler API (open, no timeline)
- microsoft/TypeScript#63800 — API usage patterns for complex editor extensions (Corsa design)
- microsoft/typescript-go#3610 — API: additional Checker methods for transpiler consumers (subset of methods landing incrementally;
typeToTypeNodeis a listed gap) - microsoft/typescript-go#3616 — API emit support (open PR, not merged)
Definition of done
-
@typescript/native-preview(or a Microsoft-blessed sibling package) ships a JS-importable module with:ts.factory,ts.createPrinter,ts.createSourceFile,Program.getTypeChecker(),TypeChecker.typeToTypeNode,TypeChecker.typeToString,TypeChecker.getExportsOfModule, and the ~40ts.is*AST predicates kea-typegen relies on. - kea-typegen's
peerDependencies.typescriptis bumped to support the 7.x line. - We drop the
pnpm.overrides.typescript = "6.0.3"pin and rely on the catalog entry only. - Same applies to other API consumers we currently pin:
ts-jest,ts-node,ts-json-schema-generator,@parcel/packager-ts,@parcel/transformer-typescript-types.
Realistic timeline
TS 7.1 at the earliest, more likely 7.2+. Microsoft has not committed to a date. No engineering action is feasible until upstream lands the APIs above — this is a watch-list, not a backlog item.
Related
- PR #59070 — adds the tsgo shadow CI step and the coexistence setup this issue depends on.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.