Skip to content

chore: run local TypeScript tooling on the native TypeScript 7.1 nightly - #1730

Merged
leonidaz merged 4 commits into
mainfrom
feat/ts7-type-program
Oct 7, 2026
Merged

leonidaz merged 4 commits into
mainfrom
feat/ts7-type-program

Conversation

@leonidaz

@leonidaz leonidaz commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

#1399 has merged, and this branch is rebased onto main, so it carries only this PR's own three commits.

  • Make the native catalog's TypeScript 7.1 nightly the repository's only TypeScript 7: one alias, typescript-native, used by octane-tsc, local tools, and base-ui's native pristine type lanes. Nothing installs TypeScript 7.0.2 anymore.
  • Start moving local TypeScript tooling to TypeScript 7's typescript/unstable/sync API, beginning with the react-port type-evidence program.
  • Keep the classic typescript (default catalog, 5.9) for every published module that uses the JavaScript API, so applications on TypeScript 5.9 or 6 keep working.

Why

TypeScript 7's npm package has no classic compiler API: import ts from 'typescript' returns only { version, versionMajorMinor }. Its API lives in typescript/unstable/* and talks to the native compiler over IPC. Only 7.1 nightlies can type-check .tsrx, through --runExternalCode and @tsrx/content-mapper. Local tooling can therefore use one pinned nightly for everything, while code that runs inside applications must keep the classic API for whatever TypeScript they install.

Changes

  • One TypeScript 7. The native catalog holds typescript-native: npm:[email protected]. The alias lets a package keep the classic typescript beside it.

    • base-ui and base-ui-utils drop typescript-pristine-native: npm:[email protected] for it. Their pristine type lanes pass on the nightly, and UPSTREAM.md says they no longer run upstream's 7.0.2.
    • The root typecheck calls their native tsc by path instead of the ambiguous .bin/tsc.
    • With that alias gone, the optional typescript peers pnpm had filled with 7.0.2 (@tsrx/ripple, vue, i18next, valibot, cosmiconfig) resolve to the classic 6.0.3 or 5.9.3 already in the workspace. Every other locked version is unchanged.
  • scripts/octane-tsc/native.mjs. The native compiler path, the .tsrx content-mapper entry and the TypeScript 5.9 compatibility options, shared by octane-tsc and the native tools.

  • createNativeTypeEvidenceProgram. The react-port type-evidence program on typescript/unstable/sync.

    • A sibling wrapper tsconfig enables the content mapper, so .tsrx imports are typed instead of any. The new test fails without the mapper.
    • Over base-ui's adapted type specs (575 files, 4,227 exports) it builds in about half the time of the classic program. Every export gets the same type, apart from typeToString text: union member order (213) and literal quote style (4).
  • Type evidence on TypeScript 7. scripts/react-port/evidence.mjs, pinned-public-types.mjs and generate-public-contract-tests.mjs read the evidence program through the TypeScript 7 API, and the classic Volar-proxied program is removed.

    • createTypeEvidenceProgram(rootNames, project) throws when the .tsrx content mapper cannot resolve (TS100031) instead of checking imported TSRX as any.
    • scripts/react-port/native-types.mjs holds the TypeScript 7 differences that would otherwise read as undefined:
      • id fields behind getters;
      • declaration handles;
      • getTarget() throwing for a type without a target;
      • [] alias arguments;
      • valueType, defaultType, boolean value;
      • the native lib directory;
      • modifiers by SyntaxKind.
    • Classic TypeScript remains only to parse tsconfig files and upstream sources.
    • The regenerated base-ui and base-ui-utils published contracts keep all 2,073 and 85 assertions. Four gain members from TypeScript 7.1's newer DOM and Temporal libs (customElementRegistry, moveBefore, oncommand, toTemporalInstant), the libs octane-tsc checks them with.
    • Test fixtures outside the repository link @tsrx/content-mapper and octane, as a workspace package resolves them.

Follow-up

Validation

  • node --test scripts/react-port/*.test.mjs (374 pass), scripts/check-source-publication.test.mjs (19 pass), and octane-tsc on sample projects after the shared-module refactor.
  • After the evidence port: pinned-public-types.test.mjs (57 pass), evidence-cli.test.mjs (74 pass), type-program.test.mjs (2 pass, one pinning the unresolvable-mapper failure), generate-public-contract-tests.mjs for base-ui and base-ui-utils compared by meaning with the classic output, pnpm react-parity:validate, and the base-ui source ledgers.
  • base-ui and base-ui-utils pristine type lanes on the nightly: 0 errors.
  • pnpm typecheck:coverage, pnpm react-parity:validate, pnpm packages:source:check, pnpm ci:workflow:test, pnpm sync.
  • pnpm install --frozen-lockfile; the lockfile drops every TypeScript 7.0.2 entry and nothing else.
  • pnpm format:check, pnpm typecheck, pnpm test: left to CI.

Risk / follow-ups

Provenance

  • An agent produced this diff (agent-authored)

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Note

Medium Risk
Pristine upstream type lanes now run a pinned 7.1 nightly instead of upstream's 7.0.2, and local tooling depends on unstable typescript/unstable/* APIs that move with nightly bumps.

Overview
This PR makes the native catalog's typescript-native alias (TypeScript 7.1 nightly) the repo's only TypeScript 7 install, replacing per-package typescript-pristine-native @ 7.0.2. base-ui and base-ui-utils pristine type lanes, root typecheck, and octane-tsc all invoke that compiler via scripts/octane-tsc/native.mjs (shared path, content mapper, and TS 5.9 compatibility defaults).

React-port type evidence moves off the classic Volar-proxied program onto typescript/unstable/sync, with native-types.mjs wrapping TS 7's remote-object API. createTypeEvidenceProgram fails if the .tsrx mapper cannot resolve instead of silently typing TSRX as any. Regenerated published-contract tests pick up a few DOM lib members under the nightly.

Lockfile and react-parity manifests refresh (lockfile hash, pristine lane compilerBins, manifest script hashes). octane-mcp-server registers the perf-review skill. Classic typescript 5.9 stays for packages that need the JS API in apps.

Reviewed by Cursor Bugbot for commit 8c79232. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent chore PR: tooling, dependencies, repo maintenance labels Oct 4, 2026
@leonidaz
leonidaz changed the base branch from chore/tsrx-0.5 to main October 4, 2026 20:34
@leonidaz
leonidaz marked this pull request as ready for review October 4, 2026 20:34
@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark report

🟢 No budget breaches, no added work, and no timing changes beyond ±3%.

Compares 37a1c1484, the merge commit's first parent with b294047ff on the same runner. A byte value over its committed budget or any increase in a js-framework work counter fails this check. Wall time is a report: base and head samples alternate in one browser, and an operation is called slower or faster only when the 95% confidence interval of its ratio excludes ±3%. Workflow run

js-framework: 1k/10k row operations

All 20 timed operations (20 without a verdict)
target operation base ms head ms head/base 95% CI
octane-tsrx run 3.375 3.617 +5.1% −2.0% … +9.1% ⚪ within noise
octane-tsrx replace 8.933 9.392 +4.4% −4.6% … +11.2% ⚪ within noise
octane-tsrx add 3.067 3.125 ±0.0% −6.9% … +3.1% ⚪ within noise
octane-tsrx update 0.156 0.148 +0.0% −3.1% … +4.6% ⚪ within noise
octane-tsrx select 0.007 0.006 −1.3% −4.2% … +0.7% ⚪ within noise
octane-tsrx swap 0.036 0.037 +4.1% +1.8% … +4.9% ⚪ within noise
octane-tsrx remove 0.018 0.019 +5.2% −1.7% … +10.1% ⚪ within noise
octane-tsrx runlots 31.467 29.883 −0.9% −5.9% … +2.5% ⚪ within noise
octane-tsrx select_lots 0.007 0.007 −0.3% −1.8% … +1.9% ⚪ within noise
octane-tsrx clear 48.225 47.858 +1.3% −3.5% … +3.5% ⚪ within noise
octane-jsx run 4.242 4.275 ±0.0% −3.5% … +4.9% ⚪ within noise
octane-jsx replace 8.833 8.492 −1.3% −4.2% … +3.4% ⚪ within noise
octane-jsx add 3.942 3.725 ±0.0% −2.7% … +2.9% ⚪ within noise
octane-jsx update 0.312 0.322 −1.1% −3.5% … +3.9% ⚪ within noise
octane-jsx select 0.163 0.164 +1.3% −3.6% … +3.4% ⚪ within noise
octane-jsx swap 0.261 0.264 +0.9% −1.2% … +2.1% ⚪ within noise
octane-jsx remove 0.208 0.216 +0.2% −1.3% … +2.1% ⚪ within noise
octane-jsx runlots 34.775 36.208 +1.7% −0.3% … +5.0% ⚪ within noise
octane-jsx select_lots 1.983 2.171 +5.2% −0.8% … +11.1% ⚪ within noise
octane-jsx clear 57.992 56.050 −1.3% −10.2% … +0.4% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

No changes across 60 measured values.

Public-import reachability bundles (bytes)

No changes across 111 measured values.

leonidaz and others added 3 commits October 7, 2026 18:15
…y's only TypeScript 7

The native catalog now holds one entry, `typescript-native`, an alias of the
pinned 7.1 nightly, so a package can keep the classic `typescript` (default
catalog, 5.9) beside it. octane-tsc and base-ui's and base-ui-utils' native
pristine type lanes use it; those lanes ran TypeScript 7.0.2 through their own
`typescript-pristine-native` alias, and the root typecheck now calls the
native tsc by path instead of the package's ambiguous `.bin/tsc`. Both pristine
lanes pass on the nightly, and UPSTREAM.md says the lane no longer runs
upstream's 7.0.2.

With that alias gone, nothing installs TypeScript 7.0.2. The optional
`typescript` peers that pnpm had filled with it (@tsrx/ripple, vue, i18next,
valibot, cosmiconfig) resolve to the classic 6.0.3 or 5.9.3 already in the
workspace; every other locked version is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`createNativeTypeEvidenceProgram(rootNames, project)` builds the react-port
type-evidence program on `typescript-native` (the native catalog's 7.1 nightly)
through `typescript/unstable/sync`. A sibling wrapper tsconfig, as in octane-tsc,
enables @tsrx/content-mapper with Octane's Volar compiler, so `.tsrx` imports
are typed instead of `any`; the new test fails without the mapper.

octane-tsc's native compiler path, `.tsrx` content-mapper entry and TypeScript
5.9 compatibility options move to scripts/octane-tsc/native.mjs, which both
share.

The classic `createTypeEvidenceProgram` stays for evidence.mjs and
generate-public-contract-tests.mjs until they move to the TypeScript 7 AST and
checker. Over base-ui's adapted type specs (575 files, 4,227 exports) the native
program builds in about half the time and gives every export the same type,
apart from union member order (213) and literal quote style (4) in
`typeToString` text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
evidence.mjs, pinned-public-types.mjs and generate-public-contract-tests.mjs
now read the react-port type-evidence program through TypeScript 7's
`typescript/unstable/sync` API, and the classic Volar-proxied program is
removed. `createTypeEvidenceProgram(rootNames, project)` builds it from the
project's tsconfig with the `.tsrx` content mapper, and throws when the mapper
cannot resolve (TS100031) instead of checking imported TSRX as `any`.

TypeScript 7 differs from the classic API in ways that would otherwise read as
`undefined` rather than fail, so scripts/react-port/native-types.mjs keeps them
in one place: symbols, types and signatures refer to each other by id behind
getters (`getSymbol()`, `getTypes()`, `getParameters()`); declarations are
handles to resolve; `getTarget()` throws for a type without a target; alias
type arguments are `[]` rather than absent; index infos carry `valueType`; a
type parameter's default is `defaultType`; boolean literals carry `value`
rather than an intrinsic name; TypeScript's own declarations live in the
native platform package, which has no `hasNoDefaultLib`; and modifiers are
read by `SyntaxKind`. Classic TypeScript remains only to parse tsconfig files
and upstream sources, never program nodes.

The regenerated base-ui and base-ui-utils published contracts keep every
assertion; four gain members from TypeScript 7.1's newer DOM and Temporal lib
declarations (`customElementRegistry`, `moveBefore`, `oncommand`,
`toTemporalInstant`), the same libs octane-tsc checks them with, and group
numbering follows TypeScript 7's export order. Test fixtures outside the
repository link @tsrx/content-mapper and octane, as a workspace package
resolves them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@leonidaz
leonidaz force-pushed the feat/ts7-type-program branch from e7b31e3 to d25e61b Compare October 7, 2026 22:21
#1868 added .rulesync/skills/perf-review without mapping it in
REPO_SKILLS, so octane_skill could not reach it and the MCP server test
that compares the map with the directory fails. It fails on main too
(37a1c14, test shard 3/4), and so on every PR merged with main. Map
it and list it in the README.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@leonidaz
leonidaz merged commit fab1304 into main Oct 7, 2026
29 checks passed
@leonidaz
leonidaz deleted the feat/ts7-type-program branch October 7, 2026 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent chore PR: tooling, dependencies, repo maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants