Skip to content

Move to TypeScript 7 #985

Closed
Closed

Description

@allisonmahmood

Move Patchy to TypeScript 7, the Go compiler, everywhere: the workspace, the CLI and patch repos. TypeScript 7.0 ships no JavaScript compiler API, so everything that still reads TypeScript's API moves off it, and no TypeScript 6 stays behind.

Decisions

  • Lint moves from ESLint and typescript-eslint to Oxlint. Its type-aware rules run on TypeScript 7 through oxlint-tsgolint, and the repo's own rules run as an Oxlint JS plugin. New patch repos lint with Oxlint too.
  • Effect diagnostics come from @effect/tsgo. effect-tsgo tsc runs an Effect-patched TypeScript 7 without patching node_modules.
  • New patch repos start on TypeScript 7, and the CLI refuses to publish a repo still on TypeScript 6. The refusal says how to move both its compiler and its lint. Published patches keep running untouched.
  • The node:crypto imports the new Effect checker flags move to Effect's Crypto service. HMAC, AES-GCM and timing-safe comparison have no Effect equivalent, so they keep node:crypto with a per-file reason.
  • The CLI parses patch sources with @babel/parser instead of TypeScript's API. TypeScript 7 emits the CLI's declarations and Rolldown bundles them.

Stack

  1. build: lint with Oxlint
  2. refactor: Effect Crypto replaces node:crypto
  3. refactor(cli): parse patch sources without the TypeScript API
  4. build: TypeScript 7
  5. feat(cli): new and published patches use TypeScript 7

Baseline on main (2f9f7c1): TypeScript 6 and ESLint

One 16-core Linux machine, Node 24.20. Medians of 3 runs (5 for patch repos, 10 for the CLI), uncached.

Measure Time Peak memory
Type-check every project in turn, compiler only 151 s 3.3 GB
Type-check the tests program 87 s 3.3 GB
pnpm typecheck 142 s 3.3 GB
pnpm build 75 s (57–134 s, shared machine) 0.9 GB
pnpm lint 38 s 3.5 GB
patchy --version 0.35 s 170 MB
CLI tarball 35.1 MB (index.js 13.9 MB)
Patch repo tsc --noEmit: 52-file tier 2 / 40-file tier 1 / 25-file tier 2 2.4 / 2.9 / 1.2 s 0.4–0.5 GB
Patch repo eslint .: same repos 1.3 / 1.1 / 0.6 s 0.2–0.45 GB

CI medians over main's last 5 runs: pnpm lint 44 s, pnpm typecheck 145 s, the CLI release build 62 s.

Done means

  • pnpm typecheck, pnpm build and pnpm lint run on TypeScript 7 and Oxlint, with the same Effect rules failing the build, and no TypeScript 6 in the lockfile.
  • patchy init makes a TypeScript 7 repo that lints with Oxlint, and publishing a TypeScript 6 repo is refused with the steps to move it.
  • The same measurements, rerun on the finished stack, are posted here beside the baseline.

Activity

  1. added
    dependencies
    area:ci
    area:cli
    on Oct 28, 2026
  2. allisonmahmood commented on Oct 29, 2026

    @allisonmahmood
    OwnerAuthor

    The same measurements rerun at #1009's head (9afa182), the workspace's last TypeScript change in the stack: TypeScript 7, @effect/tsgo and Oxlint. Same machine, script and medians as the baseline above; load during these runs was equal or higher (load average 4.7–9.7).

    Measure Baseline: TS 6 + ESLint TS 7 + Oxlint Faster by
    Type-check every project in turn 151 s 25.5 s 5.9×
    Type-check the tests program 87 s 7.1 s 12×
    Type-check apps/server 4.3 s 1.3 s 3.2×
    pnpm typecheck 142 s 20.9 s 6.8×
    pnpm build 75 s 11.6 s 6.5×
    pnpm lint 38 s 11.6 s 3.3×
    patchy --version 0.35 s / 170 MB 0.20 s / 110 MB 1.7×
    CLI tarball 35.1 MB 22.5 MB −36%
    Patch repo tsc --noEmit: 52-file tier 2 / 40-file tier 1 / 25-file tier 2 2.4 / 2.9 / 1.2 s 0.39 / 0.35 / 0.24 s 5–8×
    Patch repo lint, same repos (ESLint → Oxlint, the scaffold's rules) 1.3 / 1.1 / 0.6 s 0.06 / 0.05 / 0.06 s 10–22×

    Peak memory falls for the server program (653 → 357 MB), lint (3.5 → 2.6 GB) and patch repos (0.4–0.5 → 0.15–0.27 GB). The whole-workspace type-check stays about the same, around 3.2 GB.

    The three real patch repos type-check under TypeScript 7 and lint clean under the scaffold's Oxlint config without code changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:ciarea:clidependencies

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions