Running a Stable-vs-RC TypeScript 7.1 CI Lane Before Upgrading

Running a Stable-vs-RC TypeScript 7.1 CI Lane Before Upgrading

pr0h0••30 min read•tech
AI Usage (85%)

A release candidate for a compiler is not a compatibility signal. It's a claim by the compiler team that the surface is ready, published before the ecosystem has had time to disagree. If your repository is a plain application that runs tsc and ships the output, an RC usually costs you an afternoon. If your repository consumes the compiler — transformers, custom lint rules, declaration publishing, editor plugins, build tooling that type-checks internally — the blast radius is wider than the CLI suggests. Wider still for TypeScript 7.x, where the implementation itself is the thing that changed.

So the useful question isn't "does TypeScript 7.1 RC work?" It's "which of our supported workflows have we actually executed against it, and what evidence do we have for each?" That's a CI design problem, not a benchmarking one. This post builds the lane that answers it: a parallel stable-vs-RC CI lane that keeps your current compiler authoritative, runs the TypeScript 7.1 release candidate beside it, and turns the differences into a reviewable upgrade decision.

⚠️

Everything below runs the candidate compiler in parallel with the stable one. Nothing here replaces the compiler your build pipeline depends on until the compatibility contract in this post is green and reviewed.

On this page

Keep the Stable TypeScript Compiler Blocking While the 7.1 RC Proves Compatibility

Why a Green tsc Build Doesn't Establish RC Compatibility

The failure mode this lane prevents is specific: someone runs tsc under the RC on a branch, the build exits 0, and the team declares the upgrade fine. For an app with no compiler consumers, that's roughly correct. For anything else, exit 0 on tsc -p tsconfig.json proves only that the command-line compile path produced no new diagnostics. It says nothing about the rest of what your repository does with the compiler:

  • Compiler API consumers. A transformer, codegen script, or lint rule that does import ts from "typescript" is bound to an API surface, not to a command. Compiler rewrites routinely keep the CLI stable while changing node factory signatures, deprecating helpers, or dropping exports that plugins had reached for.
  • Published declaration output. If you ship .d.ts files, that text is a public contract. A compiler that emits structurally different declarations — reordered members, changed inferred types, new syntax in the output — can break downstream consumers who never touch your source.
  • Editor tooling. The language service is a second integration path with its own version negotiation. The tsc binary and the language service can disagree about what a workspace is doing, and users experience the editor, not your CI.
  • The surrounding toolchain. Bundlers, test runners, and lint integrations embed their own compiler versions. A candidate that "works" can still be shadowed by a plugin silently loading the stable package out of a hoisted node_modules.

For TypeScript, the 7.x line is a rewrite rather than an incremental release. Microsoft's March 2025 announcement of the native port described TypeScript 7 as a Go-based implementation, positioned 6.x as the continuing JavaScript codebase in the interim, and framed the compiler API as an open work item rather than a shipped equivalent. I'm treating that as background, not as a statement about 7.1 — the announcement predates any 7.1 RC and can't tell you what 7.1 exposes. What it does tell you is that CLI parity and API parity are independent variables here, and a lane that only runs tsc measures one of them.

Scope and Position: A Parallel Comparison Lane, Not a Benchmark

The position: build a parallel, reproducible comparison lane; keep stable authoritative; promote only on evidence. Concretely, this post covers:

  1. An evidence gate that refuses to run an unverified candidate rather than substituting a nightly.
  2. A frozen comparison contract — same commit, config, dependency graph, OS, and Node runtime.
  3. Isolated stable and candidate installations with explicit executable paths.
  4. A GitHub Actions lane where stable is required and the candidate is visible but non-blocking.
  5. Checks for type checking, incremental builds, compiler API consumers, declaration output, editor integration, and the surrounding toolchain.
  6. A promotion and rollback decision recorded against artifacts.

Out of scope: publishing an RC-based release, replacing typescript in a shared workspace root, and performance claims. Those come after correctness.

Verify the TypeScript 7.1 RC Report Before You Choose a Candidate

Attribute the Supplied Claim Precisely

The source material here is thin, and it should be described that way. A TechGig item dated 5 December 2026 carries the headline "TypeScript 7.1 release candidate arrives with new API and content mappers." That's the entire verified content of the supplied snippet: a publisher, a date, a product name, an RC status, and two feature labels.

It does not establish:

  • that a package is published, under what name, or with which dist-tags;
  • which interfaces "new API" refers to — compiler API, language service protocol, configuration surface, or something else;
  • what a "content mapper" is, what contract it has, or whether it lives in the compiler, the language service, or a tooling layer;
  • any compatibility behavior, deprecation, or migration requirement;
  • supported Node.js versions, platforms, or package identity for a native binary, if one exists.

Two of those gaps are load-bearing. "New API" could describe an addition, a replacement, or a rename, and each implies a different amount of work. "Content mappers" is a label with no verifiable referent in the supplied text. Building fixtures for it before reading primary documentation would mean inventing semantics and then testing my invention.

Establish an Evidence Gate Before Touching the Registry

Resolve the candidate through primary sources before executing anything: official TypeScript release notes on typescriptlang.org, then the release entries in the TypeScript repository, then package metadata from the registry. Only after the official package name is confirmed should you touch the registry — otherwise you're guessing at an identifier and may land on a typosquat or an unofficial mirror.

Once the name is confirmed from a primary source, record these facts before installing:

## Only after the official package name is confirmed from release notes.
npm view typescript dist-tags --json
npm view typescript versions --json | tail -n 40

Expected shape (illustrative — the values must come from a live registry, not from this post):

{
  "latest": "6.x.y",
  "next": "7.1.0-rc.x",
  "beta": "7.1.0-beta.x"
}

Record the following in a file committed alongside the lane:

FieldWhy it matters
Package nameConfirms you are not installing an unofficial artifact
Exact version stringDist-tags move; the lane must pin
Dist-tag used to discover itDistinguishes "RC" from "nightly" from "beta"
dist.integrityDetects a republished or tampered tarball
Executable name and pathA native compiler may not ship the tsc JS shim
Declared engines.node / os / cpuExplains a blocked lane instead of a mysterious failure
Publish timestampAnchors the comparison to a date

npm view typescript@<version> dist.integrity engines os cpu time --json gets most of that in one call.

Handle Missing Confirmation Explicitly

⚠️

If you cannot verify an official 7.1 RC from primary sources, stop. Don't substitute next or a nightly build, don't infer the feature set from a headline, and don't assume a native compiler exposes the existing JavaScript compiler API.

The lane has to encode this refusal. blocked is a legitimate result, not a broken build:

  • Release notes exist but the registry entry doesn't resolve → blocked, reason registry-unresolved.
  • The package resolves but its engines field excludes the lane's Node version → blocked, reason runtime-unsupported. Record it and move on rather than quietly upgrading Node inside the lane, which would break the "same runtime" comparison.
  • The release notes describe a native binary with no JS compiler API → every API check is unsupported, not failed. That distinction decides whether you schedule adapter work or accept a deferred migration.

An unsupported result and a failed result lead to different planning conversations. Collapsing them into "red job" throws away the information you need.

Define the Comparison Contract Before Writing CI

Inventory Every Surface That Touches the Compiler

Walk the repository and write down every place the compiler is touched. Be exhaustive on paper; you can scope the CI matrix later.

SurfaceHow to find itWhat breaks if it breaks
CLI compiletsc in scripts, tsconfig.jsonBuild output, exit codes
Compiler API importgrep -rn "from \"typescript\"" --include=*.ts --include=*.js --include=*.mjsTransformer and codegen pipelines
Transformers / custom pluginsts.createX factories, program.emitEmitted JS correctness
Declaration generation"declaration": true in any configPublic type contract for consumers
Downstream consumersSeparate packages that import your .d.tsConsumer build breaks
Language serviceEditor extension, typescript.tsdk, LSP clientEditor diagnostics, completion
Build-tool pluginsBundler/runner plugins with a typescript peerSilent fallback to stable compiler

That last row is the one teams miss. A plugin with "peerDependencies": { "typescript": ">=4" } will happily resolve whatever version is nearest in the tree, which in a hoisted install may not be the lane's candidate at all.

Freeze the Comparison Inputs So Only One Variable Moves

A comparison only means something if exactly one variable moved. Freeze:

  • Source commit — both lanes check out the same SHA. Record it.
  • Configuration — the same tsconfig.json files, byte-identical. If the candidate needs a config change to run at all, that change is a finding, and it gets its own file rather than an edit to the shared one.
  • Dependency graph — the same lockfile for application dependencies, with only the compiler specifier differing per lane.
  • OS and architecture — same runner image for both jobs.
  • Node.js version — same major, and the same exact patch where the candidate's engines field allows it.

If a candidate runtime requirement prevents an otherwise controlled comparison — a minimum Node, a platform-specific binary — write it down as a documented deviation in the lane's README, attached to the results. A deviation you can read is survivable. A deviation buried inside a green checkmark isn't.

Specify a Machine-Readable Result Schema

Every check writes one JSON record. The schema is the contract between the CI runner and whoever reads the results later — including you, six weeks from now, trying to remember why you deferred a migration.

results/schema-example.json
{
"schemaVersion": 1,
"lane": "candidate",
"commit": "0f1e2d3",
"compiler": {
  "package": "typescript",
  "version": "<verified-version>",
  "distTag": "next",
  "integrity": "sha512-...",
  "binPath": "lanes/candidate/node_modules/.bin/tsc",
  "binRealPath": "lanes/candidate/node_modules/typescript/bin/tsc"
},
"runtime": { "node": "v22.x.y", "os": "linux", "arch": "x64" },
"checks": [
  {
    "id": "typecheck.noemit",
    "status": "failed",
    "exitCode": 2,
    "durationMs": 8123,
    "artifacts": ["out/candidate/typecheck.log"],
    "diagnostics": { "new": 2, "removed": 0, "changed": 1 }
  },
  {
    "id": "api.transform",
    "status": "unsupported",
    "reason": "candidate package exposes no compiler API entry point",
    "artifacts": ["out/candidate/api-transform.log"]
  }
]
}

Five statuses, and they don't mean the same thing:

  • passed — ran, exited as expected, no new diagnostics.
  • failed — ran, produced a difference or a nonzero exit.
  • unsupported — the candidate doesn't offer this surface at all.
  • blocked — the lane couldn't run it (missing package, excluded runtime, absent editor).
  • not-run — skipped by configuration; must carry a reason.

Treat blocked and not-run as noise that has to be justified. Neither is an implicit pass.

Install Stable and RC Toolchains Without Contaminating Each Other

Fixture Layout: Two Isolated Lanes, One Source of Truth

Two isolated installs, one shared source of truth for the fixtures.

toolchain-compare/
├── fixtures/
│   ├── src/               # shared TypeScript sources (checked in once)
│   ├── tsconfig.json      # shared config
│   └── consumer/          # fixtures that compile against emitted .d.ts
├── lanes/
│   ├── stable/
│   │   ├── package.json
│   │   ├── package-lock.json
│   │   └── node_modules/
│   └── candidate/
│       ├── package.json
│       ├── package-lock.json
│       └── node_modules/
├── out/
│   ├── stable/
│   ├── candidate/
│   └── results/
└── tools/
    ├── compare.mjs
    └── normalize.mjs

The shared fixtures/ directory is what makes the comparison honest: both lanes compile the same bytes with the same config. The per-lane manifests differ only in the compiler specifier, so npm ci produces two lockfiles whose diff is the upgrade under review.

Why not one node_modules with an alias? You can, via npm: aliases, but aliasing changes module resolution for anything that resolves typescript by name — which includes exactly the compiler-dependent plugins you're trying to test. Separate prefixes keep resolution natural.

Reproducible Installation and Compiler Identity Commands

STABLE_VERSION="$(node -p "require('./lanes/stable/package.json').dependencies.typescript")"
CANDIDATE_VERSION="$(node -p "require('./lanes/candidate/package.json').dependencies.typescript")"

npm install --prefix lanes/stable --save-exact "typescript@${STABLE_VERSION}"
npm install --prefix lanes/candidate --save-exact "typescript@${CANDIDATE_VERSION}"

## CI uses lockfile installs only, never `npm install`
npm ci --prefix lanes/stable
npm ci --prefix lanes/candidate

Invoke the compiler through an explicit per-lane path, never a global:

node lanes/stable/node_modules/typescript/bin/tsc --version
node lanes/candidate/node_modules/typescript/bin/tsc --version

If the candidate ships a native executable rather than a JS shim, bin/tsc won't exist at that path. That's not a problem to work around; it's information. Resolve the real entry point and record it:

node -e "console.log(require.resolve('./lanes/candidate/node_modules/.bin/tsc'))"
readlink -f lanes/candidate/node_modules/.bin/tsc

The binRealPath field in the result schema exists so a future reader can tell whether the two lanes ran comparable executables.

💪

Don't "fix" a peer dependency error by adding --legacy-peer-deps in the candidate lane. A peer conflict is a compatibility finding. If you suppress it to get the job green, you've deleted the evidence.

Verify Isolation Before Any Compile Runs

Three checks, each cheap enough to run before any compile:

## 1. Which compiler does each lane resolve?
node -e "console.log(require.resolve('typescript', { paths: [process.cwd() + '/lanes/candidate'] }))"

## 2. Which compiler does a specific plugin resolve?
node -e "
  const path = require('path');
  const req = require('module').createRequire(require.resolve('some-plugin'));
  console.log(req.resolve('typescript'));
"

## 3. What does the dependency tree actually look like?
npm ls typescript --prefix lanes/candidate --all

Check 2 is the one that matters. Check 1 tells you what your own script loads. Check 2 tells you what a third-party plugin loads, and those can differ inside a single prefix if the plugin pinned typescript as a direct dependency instead of a peer.

For caches, key on everything that can change behavior:

key: ts-lane-${{ runner.os }}-node${{ matrix.node }}-${{ matrix.lane }}-${{ hashFiles(format('lanes/{0}/package-lock.json', matrix.lane)) }}

Including the lane name matters here. A cache keyed only on the lockfile hash is safe, but a key that omits the lane can poison one lane with the other's node_modules after a version coincidence.

Implement the Parallel Stable-vs-RC CI Lane

GitHub Actions Workflow with Independent Status Reporting

name: ts-compat

on:
  pull_request:
  schedule:
    - cron: "0 6 * * 1"

jobs:
  stable:
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: "22.14.0" }
      - name: Install (lockfile only)
        run: npm ci --prefix lanes/stable
      - name: Record identity
        run: node tools/compare.mjs identity --lane stable --out out/results/stable-identity.json
      - name: Compile
        run: node tools/compare.mjs run --lane stable --out out/results/stable.json
      - name: Upload artifacts
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: ts-compat-stable
          path: |
            out/results/stable*.json
            out/stable/*.log
          if-no-files-found: warn

  candidate:
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: "22.14.0" }
      - name: Gate on verified candidate
        id: gate
        run: node tools/compare.mjs gate --lane candidate
      - name: Install (lockfile only)
        if: steps.gate.outputs.status == 'ready'
        run: npm ci --prefix lanes/candidate
      - name: Compile
        if: steps.gate.outputs.status == 'ready'
        run: node tools/compare.mjs run --lane candidate --out out/results/candidate.json
      - name: Upload artifacts
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: ts-compat-candidate
          path: |
            out/results/candidate*.json
            out/candidate/*.log
          if-no-files-found: warn

Two deliberate choices. First, if: always() on the upload steps: artifacts after a failure are the most valuable artifacts. Second, the gate step, which refuses to install when the candidate can't be verified — the CI expression of the evidence gate.

Keep Stable Required; Make the Candidate Visible Without Blocking Merges

One thing not to do: don't put continue-on-error: true on the candidate job. It converts a failure into a success at the reporting layer, and GitHub then renders the job as passed-with-a-note that reviewers scroll past.

What you lose is the identity of the failing step. With blanket continue-on-error, a candidate job that failed because npm ci hit a peer conflict looks identical to one that failed because a transformer crashed — both are "the job would have failed but we told it not to." You can recover that from logs. You won't recover it from the checks UI, which is where the decision actually gets made.

The cleaner alternative:

  1. Let the candidate job fail normally. It shows red.
  2. Don't add it to branch protection's required status checks. Merges proceed.
  3. Make the failure legible: have the runner write per-check statuses into an artifact and a job summary, so the red X leads to a table instead of a 4,000-line log.
{
  echo "## Candidate lane"
  echo
  echo "| Check | Status | Detail |"
  echo "| --- | --- | --- |"
  node -e "
    const r = require('./out/results/candidate.json');
    for (const c of r.checks) console.log(\`| \${c.id} | \${c.status} | \${c.reason ?? ''} |\`);
  "
} >> "$GITHUB_STEP_SUMMARY"

If the candidate lane is noisy enough to need suppression while it stabilizes, suppress at the checkout level — run it on schedule and workflow_dispatch only, or on PRs labeled ts-rc — rather than lying about the result.

A Comparison Runner That Captures Real Outcomes

tools/compare.mjs
import { spawnSync } from "node:child_process";





const CANDIDATE_TSC = "lanes/candidate/node_modules/typescript/bin/tsc";
const STABLE_TSC = "lanes/stable/node_modules/typescript/bin/tsc";

function compilerMeta(lane) {
const req = createRequire(join(process.cwd(), "lanes", lane, "noop.js"));
const pkgPath = req.resolve("typescript/package.json");
const pkg = req("typescript/package.json");
return {
  package: pkg.name,
  version: pkg.version,
  binPath: lane === "candidate" ? CANDIDATE_TSC : STABLE_TSC,
};
}

function runCheck(lane, id, args) {
const started = performance.now();
const res = spawnSync(process.execPath, [
  lane === "candidate" ? CANDIDATE_TSC : STABLE_TSC,
  ...args,
], { encoding: "utf8", cwd: process.cwd(), maxBuffer: 32 * 1024 * 1024 });

const durationMs = Math.round(performance.now() - started);
const logDir = join("out", lane);
mkdirSync(logDir, { recursive: true });
const logPath = join(logDir, `${id}.log`);
writeFileSync(logPath, `STDOUT\n${res.stdout}\nSTDERR\n${res.stderr}`);

// Distinguish a compiler crash from a compiler verdict.
const crashed = res.status === null || /Cannot find module|EACCES|Exec format error/.test(res.stderr);

return {
  id,
  status: crashed ? "blocked" : res.status === 0 ? "passed" : "failed",
  exitCode: res.status,
  durationMs,
  artifacts: [logPath],
};
}

const lane = process.argv[process.argv.indexOf("--lane") + 1];
const out = process.argv[process.argv.indexOf("--out") + 1];

const checks = [
runCheck(lane, "typecheck.noemit", ["-p", "fixtures/tsconfig.json", "--noEmit", "--pretty", "false"]),
runCheck(lane, "build.clean", ["-p", "fixtures/tsconfig.json", "--pretty", "false"]),
];

const result = {
schemaVersion: 1,
lane,
commit: process.env.GITHUB_SHA ?? "local",
compiler: compilerMeta(lane),
runtime: { node: process.version, os: process.platform, arch: process.arch },
checks,
};

mkdirSync(dirname(out), { recursive: true });
writeFileSync(out, JSON.stringify(result, null, 2));

const hardFailures = checks.filter((c) => c.status === "failed" || c.status === "blocked");
process.exit(hardFailures.length === 0 ? 0 : 1);

spawnSync with encoding: "utf8" and a maxBuffer cap is deliberate: a candidate that emits thousands of diagnostics should be recorded, not truncated into a misleading success. Writing the raw log to disk before deciding status means the artifact survives the exit code.

Compare Type Checking and Build Behavior

Run the Same Three Compile Modes

With source and config frozen, run:

## no-emit check
node lanes/<lane>/node_modules/typescript/bin/tsc -p fixtures/tsconfig.json --noEmit --pretty false

## clean build
rm -rf out/<lane>/dist
node lanes/<lane>/node_modules/typescript/bin/tsc -p fixtures/tsconfig.json --pretty false

## project references
node lanes/<lane>/node_modules/typescript/bin/tsc -b fixtures/tsconfig.build.json --pretty false

Keep the three outcomes separate in the schema. A project-reference build that fails on tsc -b for reasons unrelated to type checking — missing composite flags, changed build-info handling — is a different finding from a new type error, and it needs a different owner.

The triage rule that matters most: a new diagnostic is not the same as an install failure, a crash, or a command-line incompatibility. If the candidate rejects a flag you've been passing for years, you get a nonzero exit with a message like Unknown compiler option — that's a CLI compatibility finding. If it exits with a Node stack trace, that's a crash. If diagnostics went from 0 to 3, that's a semantic change. exitCode plus the log content separate these; the exit code alone does not.

Normalize Only Nondeterministic Fields

Diagnostics embed absolute paths. Those differ per runner and per lane, so leaving them in produces diffs that are pure noise.

// tools/normalize.mjs
const stripRoot = (line) => line.replaceAll(process.cwd(), "");
const stripLineCol = (line) => line.replace(/\(\d+,\d+\)/, "(L,C)");

export function normalizeDiagnostics(raw) {
  return raw
    .split("\n")
    .map((l) => stripLineCol(stripRoot(l.trimEnd())))
    .filter((l) => /error TS\d+|warning TS\d+/.test(l));
}

Compare diagnostic codes and locations — not just counts, and not just message text. Codes are the stable identifier; messages get reworded between releases without any behavior change, and treating a reworded message as a regression trains people to ignore the lane.

Keep the raw logs regardless. The normalized set is for diffing; the raw log is for the human who has to decide whether TS2345 at the same location is the same error.

Exercise Incremental Compilation Separately

Incremental builds are where compiler rewrites tend to leak. A rebuild that exits 0 because it did nothing looks identical to a rebuild that correctly invalidated and re-emitted.

rm -rf out/<lane>/dist out/<lane>/tsbuildinfo
node lanes/<lane>/node_modules/typescript/bin/tsc -p fixtures/tsconfig.incremental.json
## controlled edit: change one exported function's signature
node lanes/<lane>/node_modules/typescript/bin/tsc -p fixtures/tsconfig.incremental.json
diff -r out/stable/dist out/candidate/dist || true

Then verify the invalidation actually happened, rather than trusting the exit code:

  • Confirm the build-info directory is per-lane and per-compiler-version. If two compilers share a .tsbuildinfo file, you're measuring whichever wrote it last.
  • Confirm the edited file's output changed. A rebuild that ignores the edit is a correctness bug, and it will be invisible in every other check.
  • Confirm the unedited files did not get spuriously rechecked. Compare emitted mtimes or use --diagnostics where supported.
📝

Incremental state formats are internal and version-specific. Treat a format mismatch as expected and always start the incremental check from an empty build-info directory; don't try to read stable's build info with the candidate.

Test Compiler API Consumers Against Their Actual Integration Model

One Fixture per API Surface You Actually Use

Don't write a fixture for every export. Write one per surface your repository touches, derived from the inventory in the contract. A typical set:

FixtureWhat it exercisesPass condition
api-programcreateProgram, getSourceFiles, getTypeCheckerProgram built, symbol count plausible
api-astforEachChild, node kind guardsTraversal completes, expected kinds found
api-factoryfactory.createPropertySignature etc.Emitted output parses and matches snapshot
api-transformprogram.emit with a custom transformerTransform ran, output differs as intended
api-lscreateLanguageService or LSP callsCompletion/diagnostics returned

Each fixture has two halves — load and execute — and you should test them independently. A package that exports nothing useful fails at load with a clear error. A package that exports a renamed symbol fails at execute with ts.factory.createX is not a function. Only the second tells you something about migration cost.

// fixtures/api/factory.test.mjs



const ts = await import("typescript");

test("factory surface still constructs a property signature", () => {
  assert.equal(typeof ts.factory?.createPropertySignature, "function");
  const node = ts.factory.createPropertySignature(
    undefined,
    ts.factory.createIdentifier("id"),
    undefined,
    ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword)
  );
  assert.equal(ts.SyntaxKind[node.type.kind], "StringKeyword");
});

Run this against each lane by installing the fixture's typescript resolution into the lane prefix, so import "typescript" resolves per lane rather than to whatever sits at the repo root.

Resolve Each Plugin's Compiler Dependency Explicitly

The scenario to catch: your transformer correctly imports the candidate, but a build-tool plugin wraps it and passes a Program built by the stable compiler. The types may be structurally compatible enough to avoid a crash, and you get a green run that tested nothing.

Detect it by asserting identity, not by inspecting the tree:



const pluginRequire = createRequire(require.resolve("some-build-plugin"));
const pluginCompiler = pluginRequire("typescript");

if (pluginCompiler.version !== process.env.EXPECTED_CANDIDATE_VERSION) {
  console.error(
    `plugin resolved typescript@${pluginCompiler.version}, ` +
    `expected ${process.env.EXPECTED_CANDIDATE_VERSION}`
  );
  process.exitCode = 1;
}

Run that assertion as its own check, api.plugin-resolution, failing when versions diverge. It's the cheapest guard against a false-green API lane, and it costs one require.resolve.

Treat Absent or Changed API Support as a Compatibility Finding

When a surface is missing entirely, the check is unsupported, with the reason captured verbatim from the failure. Then consult the official migration guidance for that version before deciding anything. Three legitimate responses:

  1. Adapter work. Keep the integration, write a shim that targets both APIs. Cost is ongoing, so it needs an owner and a removal condition.
  2. Deferred adoption. Keep the API-consuming package on stable while the compiler upgrade proceeds elsewhere. This is the common outcome and shouldn't be treated as a failure of the upgrade effort.
  3. Separately pinned integration. Pin the API-consuming tool to the stable compiler explicitly, and document that the repo intentionally runs two compilers.

What is not legitimate is assuming CLI parity implies API parity. If tsc exits 0 and ts.factory is gone, the upgrade has a real cost the build never showed you.

Validate Declaration Output as a Published Contract

Generate into Separate Directories and Diff

node lanes/stable/node_modules/typescript/bin/tsc -p fixtures/tsconfig.declarations.json \
  --declaration --emitDeclarationOnly --outDir out/stable/dts --pretty false
node lanes/candidate/node_modules/typescript/bin/tsc -p fixtures/tsconfig.declarations.json \
  --declaration --emitDeclarationOnly --outDir out/candidate/dts --pretty false

diff -ru out/stable/dts out/candidate/dts > out/results/dts.diff || true

Enable declarationMap only if your package actually publishes declaration maps. Otherwise you're diffing a feature you don't ship, and .d.ts.map files are churn-heavy.

Expect three categories of diff, and treat them differently:

  • Compositional noise — member ordering, comment placement, whitespace. Harmless, but it drowns the signal, so normalize it or diff per-file with a semantic view.
  • Inferred type changes — the compiler now widens, narrows, or names a type differently. These are breaking changes for consumers even when runtime behavior is identical.
  • New syntax in output — a satisfies, an infer constraint, an import-attribute form. This compiles fine for anyone on a recent compiler and fails for anyone on your declared minimum.

Compile Consumer Fixtures Against Both Outputs

for dts in out/stable/dts out/candidate/dts; do
  node lanes/stable/node_modules/typescript/bin/tsc -p fixtures/consumer/tsconfig.json \
    --noEmit --pretty false \
    --paths "{\"@scope/pkg\": [\"$PWD/$dts/index.d.ts\"]}"
done

Run the consumer fixture against the oldest compiler your package supports as well as current ones. A declaration emitted by the candidate that only parses on the candidate is a producer-side change that exceeds your compatibility policy — the package is now unusable for consumers who haven't upgraded, and that's your decision to make, not the compiler's.

Name the two failure directions explicitly in the results:

DirectionSymptomMeaning
Producer regressionConsumer fails on candidate output, passes on stable output, same consumer compilerYour published contract regressed
Policy exceedanceConsumer fails on candidate output only with the old consumer compilerEmitted syntax exceeds your declared support floor
Consumer errorFails on bothPre-existing fixture bug; fix the fixture first

Inspect the Packed Package, Not Just the Directory

A textual diff can't establish whether something is breaking. What you actually publish is the tarball, filtered by files and .npmignore, with typesVersions and exports applied.

npm pack --prefix fixtures/pkg --pack-destination out/stable
tar -tzf out/stable/*.tgz | sort > out/results/pack-stable.txt
## repeat for candidate, then:
diff -u out/results/pack-stable.txt out/results/pack-candidate.txt

Beyond the file list, test representative behavior of the published surface: a default export still default, an overload still resolving to the same signature for the same arguments, a generic still inferring the same parameter, go-to-definition in an editor landing in source rather than a generated stub. A declaration file whose text is unchanged can still break consumers if a re-export moved or a type was re-exported from a different module path.

Check Editor Integration Independently of the Build

Record the Whole Stack

Write down the integration route before changing anything, because "the editor" is at least four versions negotiating:

  • Editor build (e.g. code --version) and, for JetBrains or Neovim, the equivalent.
  • The TypeScript extension version.
  • Whether the workspace uses the bundled TypeScript, a workspace version (typescript.tsdk), or a language server shipped by something else.
  • The exact mechanism used to point it at the candidate.
⚠️

Don't assume an existing workspace setting like typescript.tsdk can point at an RC. If the candidate ships as a native binary with its own server entry point, the current setting may silently keep loading the stable package — and the editor will look fine while testing nothing.

Configure the candidate only through its documented mechanism. If the release notes don't document one, the editor check is blocked with reason no-documented-integration, which is a genuine result worth reporting upstream.

A Repeatable Editor Smoke Test

Automate protocol-level checks only where the candidate exposes a documented interface. Otherwise run this as a scripted human checklist recorded in the PR.

StepActionPass condition
Diagnostics after editIntroduce a type error, saveError appears within a few seconds, correct code and location
Clean stateFix the errorSquiggle clears without reload
CompletionType obj. on a known interfaceMembers listed, no stale entries from the stable server
RenameRename a symbol used across 3 filesAll references updated, no partial rename
Go to definitionOn an import from the packageLands in the intended source or .d.ts
Declaration navigationOn a re-export in packed outputLands in the emitted declaration, not a stub

The rename and go-to-definition steps are what catch a mixed state, where diagnostics come from the candidate but navigation comes from the stable server because two processes are running.

Keep Content-Mapper Claims Conditional

The supplied headline mentions "content mappers." The supplied snippet doesn't say what that means, what it maps, or which layer exposes it. It might be a compiler feature, a language service feature, or a tooling-layer feature; the headline doesn't distinguish.

So the honest treatment is:

  • If primary documentation confirms the feature and states its contract, write a mapping-specific fixture and record the contract verbatim in the results file.
  • If documentation exists but the contract is ambiguous, record what is stated and mark the check blocked with the ambiguity as the reason.
  • If no documentation confirms it, report not-run with reason feature-unverified and stop. Don't write an assertion whose expected value I invented.

This isn't pedantry. A fixture that asserts guessed semantics will fail, and the failure will get attributed to the compiler rather than to the guess — which is exactly how a compatibility lane loses its credibility.

Exercise the Toolchain Beyond the Compiler Command

Focused Fixtures for the Tools You Actually Run

The compiler is one node in a graph. Add a check per tool that touches types:

ToolWhat to checkDoes it type-check or strip?
BundlerBuild the fixture, compare output shapeVaries by loader; some strip only
Test runnerRun the fixture suite, compare pass/failOften strips via a transform
Lint integrationLint the fixture, compare diagnosticsUsually type-aware (separate program)
Declaration toolingBundle/rollup .d.ts, compare outputRuns its own compiler
Custom scriptsCodegen, changelog toolingConsumer of the compiler API

Mark each as type-checking or type-stripping in the results. Tools that merely strip types will pass under a candidate with completely broken type inference, and their green check is evidence of nothing. The type-aware ones — especially a lint integration that builds its own Program — are genuinely informative, and they often resolve their own compiler version, which is why the plugin-resolution assertion from the API section belongs here too.

Keep the Matrix Bounded

Don't chase every combination. Two tiers:

  • Pull request lane: one OS, the Node major your engines field requires, stable plus candidate.
  • Scheduled lane: add the oldest supported Node major, plus a second OS if your support policy names one.

Add an environment only when your published support policy requires it, or when a real field report justifies it. An unbounded matrix produces blocked checks in environments nobody uses, and the noise teaches the team to ignore the lane.

Measure Performance Only After Correctness

⚠️

Don't publish an RC speed number from a single CI run on a shared runner. Report the distribution or report nothing.

Once the correctness checks are green, measure three phases separately — installation, clean build, incremental rebuild — and repeat each enough times to see variance:

for i in 1 2 3 4 5; do
  rm -rf out/candidate/dist
  /usr/bin/time -f "%e" node lanes/candidate/node_modules/typescript/bin/tsc -p fixtures/tsconfig.json
done

Report the median, the range, and the runner. If the candidate is 2× slower on a vCPU-starved runner and 1.1× faster on your laptop, the honest summary is "inconclusive on CI hardware, needs a dedicated benchmark host" — and the correctness results still stand on their own.

Turn Differences into Reproducible Upgrade Decisions

An Illustrative Comparison Table

This is the artifact reviewers read. Note what it contains and what it refuses to contain.

CheckStableCandidateEvidenceLikely ownerNext action
typecheck.noemitpassedfailed, 2 new TS2345out/results/candidate.json, raw logApp teamTriage: intentional or regression
build.cleanpassedpassedartifact—None
build.incrementalpassedfailed, stale outputdiff of dist/App teamReduce to fixture, then report upstream
api.plugin-resolutionpassedfailed, plugin loaded stableresolution logBuild toolingConfirm plugin peer range; likely stale
dts.diffpassed3 inferred type changesdts.diffLibrary maintainerReview each as semver-relevant
editor.smokepassedblocked, no documented integrationchecklistDev experienceAsk upstream for the supported route
toolchain.lintpassedfailed, ignores absentlint logApp teamUnsupported integration; defer
feature.content-mappersnot-runnot-run——Unverified; no fixture written

Three distinct kinds of rows, and the table has to say which is which. The typecheck row is a project observation — it came from running the repo. The schema sample earlier in this post is expected fixture output, written before any live run. The incremental and content-mapper rows hold untested hypotheses at the point of writing: the incremental failure is failed because the run happened, but its cause is unknown; the content-mapper row is entirely unrun.

Triage into Four Buckets

Every difference goes in exactly one:

  1. Documented intentional change — the release notes or migration guide describes it. Action: update your code, cite the document in the PR.
  2. Unsupported integration — the candidate doesn't offer the surface. Action: choose adapter, defer, or pin. Needs an owner and a review date.
  3. Stale assumption — your code relies on removed or changed behavior that was already deprecated. Action: fix now, independent of the upgrade.
  4. Suspected regression — nothing documents it and the fixture is small. Action: reduce, then report.

Reduction means a single-file fixture with the exact version, the exact command, and the observed versus expected output. A bug report that says "our monorepo fails to build" gets closed. One that says tsc 7.1.0-rc.<n> with this 12-line fixture under these compiler options emits this instead of that gets acted on.

Promotion and Rollback Criteria

Promote the candidate to authoritative only when all of the following hold:

  • Every supported workflow is green in the candidate lane.
  • Declaration output changes have been reviewed individually, with a semver decision recorded for each.
  • Editor support is verified through a documented integration route, or an explicit, owned exception is filed.
  • Every unsupported, blocked, and not-run check has a named owner and a disposition.
  • The results are attached to the change, with the version strings and integrity hashes that produced them.

Rollback stays cheap if you kept the stable lockfile untouched. Do that: never mutate lanes/stable/package-lock.json as part of an upgrade attempt. Reverting is then a single commit that points the production path back at a lockfile nobody edited.

And rerun the whole suite against the final release. An RC that passed in December is not the 7.1.0 that ships; the final can contain changes made after the RC you validated, and your approval was scoped to a version string, not a dist-tag.

Further Reading and Evidence to Retain

Sources Worth Keeping

Two of these are primary for the version question; one is secondary. If the primary sources don't confirm a 7.1 RC, this post's lane reports blocked and nothing else in it changes — which is the point of building the gate before the fixture.

Retain the Decision Trail

Keep the stable compiler authoritative until the candidate clears your compatibility contract, and keep the receipts: version strings with integrity hashes, both lockfiles, raw logs, normalized diffs, the packed file lists, the editor checklist, and an explicit list of the checks you couldn't run. The upgrade decision should be answerable from artifacts alone — a reviewer with no context should be able to see which version was tested, which workflows were exercised, what changed in the declarations, and which gaps were accepted, and by whom.

A lane that produces a green checkmark and nothing else will be re-litigated every time someone asks whether the upgrade is safe. A lane that produces a table is a decision.

Share this post

More posts

Loading comments…