Skip to content

Upgrade TypeScript to 7 (build failing — needs review) - #106

Draft
woksin wants to merge 1 commit into
mainfrom
chore/typescript-7
Draft

Upgrade TypeScript to 7 (build failing — needs review)#106
woksin wants to merge 1 commit into
mainfrom
chore/typescript-7

Conversation

@woksin

@woksin woksin commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Upgrades the Components repo to TypeScript 7.0.2 — the new native (Go) compiler that is now latest on npm. The tsc CLI typecheck/build passes cleanly, but the broader JavaScript toolchain (ESLint typed-linting and Rollup bundling) is not yet compatible with the native compiler, so CI and publish will fail until those tools add native-compiler support. See the blocker section below.

Changed

  • typescript: ^6.0.3^7.0.2 (root package.json, the only manifest declaring typescript).
  • Yarn: 4.5.34.17.1 (packageManager + .yarnrc.yml yarnPath + .yarn/releases/). Required: Yarn 4.5.3's bundled plugin-compat tried to apply its built-in TypeScript patch to lib/_tsc.js, which the native TS7 package no longer ships, aborting yarn install. Yarn 4.17.1 handles the native package and installs cleanly.
  • tsconfig.json / Source/tsconfig.json: removed compiler options that TS7 has removed (hard TS5102 errors otherwise): baseUrl (root + Source), downlevelIteration, and the now-unnecessary ignoreDeprecations: "6.0". No baseUrl-rooted imports exist in the source (all non-relative imports are real npm packages), so this is a safe no-op for resolution.

Package manager

Yarn (workspaces; Source builds, ESLint is test-only). No lockfile is committed in this repo, per its existing convention. yarn install succeeds under 4.17.1.

Verification

  • typescript resolves to 7.0.2 (require('typescript').version7.0.2, tsc --versionVersion 7.0.2).
  • yarn build (per-workspace tsc -p tsconfig.json) — PASSES, exit 0. tsc -b on Source typechecks and emits dist/esm (.js + .d.ts + maps) with zero errors.

⚠️ Blocker — native compiler has no programmatic JS API

TS7's typescript npm package exposes only version and versionMajorMinor from its JS module — the classic compiler API (ModuleKind, ScriptTarget, createProgram, …) is undefined. The native compiler is a Go binary driven through the tsc CLI. Any tool that loads typescript as a library therefore breaks:

  • ESLint typed-linting (yarn lint / yarn ci): @typescript-eslint/typescript-estree crashes with TypeError: Cannot read properties of undefined (reading 'Cjs') (ts.ModuleKind.Cjs).
  • Rollup bundling (g:build / prepare, i.e. the CJS bundle for npm publish): @rollup/plugin-typescript crashes with TypeError: Cannot read properties of undefined (reading 'ES2015') (ts.ModuleKind.ES2015).

Because CI's javascript-build.yml runs yarn ci (which includes the lint step) and publish.yml produces the Rollup bundle, both will fail until @typescript-eslint and @rollup/plugin-typescript ship native-compiler support (or the project moves those steps off the classic TS API). This is an upstream ecosystem gap, not a config error, and is out of scope for a version bump — hence the bump is kept and flagged for review. Vitest (esbuild-based transforms) is likely unaffected but was not exercised here.

Workflow changes

None required. Grepping .github/workflows/ found no explicit typescript version pins or tsc-install steps — the only build reference is yarn build in publish.yml. No workflow files were modified.

🤖 Generated with Claude Code

Update Components to TypeScript 7 (the native compiler) for improved
build/typecheck performance.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@woksin
woksin marked this pull request as draft July 10, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant