Skip to content

chore(deps): build with TypeScript 7 native compiler#1690

Closed
xobotyi wants to merge 1 commit into
deps/vitest-4from
deps/typescript-7
Closed

chore(deps): build with TypeScript 7 native compiler#1690
xobotyi wants to merge 1 commit into
deps/vitest-4from
deps/typescript-7

Conversation

@xobotyi

@xobotyi xobotyi commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Switches the build to typescript@7.0.2 (native compiler) using the officially documented side-by-side layout:

  • typescript moves 5.9.3 → 6.0.3 and stays on 6.x — typescript@7 ships no JS compiler API, and typescript-eslint only supports TS <6.1 (TS 7 support tracked for ≥7.1). API consumers (typescript-eslint via @ver0/eslint-config, editors) keep working against the TS 6 API.
  • @typescript/native (npm alias for typescript@^7.0.2) provides the native tsc, used by the build via the new tsc:native script. Explicit path because yarn links .bin/tsc from the package named typescript, so a bare tsc resolves to 6.0.3.
  • tsconfig: explicit rootDir (required by TS 6+) and types: ["node"] (TS 6+ no longer auto-includes @types/*; restores the process global used by cookie/storage hooks).
  • yarn 4.10.2 → 4.17.1 — required: older yarn's builtin typescript compat patch fails to fetch typescript@7 (expects the removed lib/_tsc.js).

Emit parity: dist/ byte-identical to a TS 6 build except useIsomorphicLayoutEffect's declaration — typeof useLayoutEffect instead of the signature-identical typeof useEffect.

Follow-up: once linting moves to oxc (or typescript-eslint ships TS ≥7.1 support), the side-by-side setup can collapse to a single typescript@7 dependency. Supersedes #1677.

Stacked on #1689; retargets to master when it merges.

Verification: build (tsc 7.0.2) clean, lint 0 problems (eslint 9), 527/527 tests pass.

typescript@7 ships only native binaries with no JS compiler API, and
typescript-eslint supports TS <6.1 (TS 7 support is tracked for
>=7.1). Uses the officially documented side-by-side layout: the
'typescript' package stays on 6.0.3 for API consumers
(typescript-eslint, editors), typescript@7 is installed under the
'@typescript/native' alias for builds.

- build runs the native tsc via the tsc:native script: yarn links
  .bin/tsc from the package named 'typescript', so a plain tsc call
  resolves to 6.0.3.
- tsconfig: TS 6+ requires explicit rootDir for the build and no
  longer auto-includes @types packages; 'types: [node]' restores the
  'process' global that useCookieValue and the storage hooks check.
- yarn 4.10.2 -> 4.17.1: the older builtin typescript compat patch
  fails to fetch typescript@7 (expects the removed lib/_tsc.js).
- dist output is identical to a TS 6 build except
  useIsomorphicLayoutEffect's declaration, inferred as 'typeof
  useLayoutEffect' instead of the signature-identical 'typeof
  useEffect'.

Once typescript-eslint supports TS >=7.1, the side-by-side setup can
collapse to a single typescript@7 dependency.
@xobotyi
xobotyi force-pushed the deps/typescript-7 branch from a16d594 to ce0c90b Compare July 22, 2026 11:58
@xobotyi
xobotyi deleted the branch deps/vitest-4 July 22, 2026 12:01
@xobotyi xobotyi closed this Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant