published fresh until

TypeScript 7.1 Beta: how do I migrate imports and tools?

Summary As of October 2026, trial TypeScript 7.1 Beta on a branch, add attribute-aware declarations only for supported runtime imports, and port compiler tools to the new disposable API; use create-vite 9.3.3 for the template packaging fix (checked 2026-10-28).

Not for general TypeScript scaffolding, see vite-create-vite-9-3-0-typescript-7-scaffolding

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Trial TypeScript’s beta on a branch, migrate compiler clients explicitly, and use the repaired generator for fresh template checks.

What changed

  • TypeScript 7.1 Beta, announced 2026-10-20 (checked 2026-10-28), adds attribute-aware ambient modules and split compiler API entry points; Microsoft also describes checking and memory optimizations, not a guaranteed speedup for your app. Announcement, Daniel Rosenwasser.
  • create-vite 9.3.2, released 2026-10-27 (checked 2026-10-28), selects TypeScript’s new major where possible; create-vite 9.3.3, released 2026-10-27 (checked 2026-10-28), repairs missing template files. Generator change, packaging fix.

How to migrate

1. Save the current dependency and lockfile state in a branch. The announcement’s installation command is npm install -D typescript@beta. This tag moves; record the resolved package version and retain the lockfile. It selects TypeScript 7.1 Beta as described above (checked 2026-10-28), not a permanent version pin. 2. For runtime-supported text imports, put the announcement’s declaration in a project-owned global declaration file, then use the matching attribute:

declare module "*" with { type: "text" } {
    const content: string;
    export default content;
}
import readme from "../README.md" with { type: "text" };

3. Port compiler clients from their actual use cases. The official entry points include typescript/sync, typescript/async, typescript/fs, typescript/ast, typescript/ast/is and typescript/ast/factory. Follow the linked example with using api = new API() and using program = api.createProgram(...); explicit disposal is required. Do not mechanically change only the import path. 4. For a fresh Vite comparison, select create-vite@9.3.3 (checked 2026-10-28), the package identified by the official fix. Keep the generated tree separate from the existing app; inspect its resolved compiler dependency rather than assuming the generator selects the beta. Rerun the project’s own typecheck, build and tool integration commands.

What breaks

The official release listing identifies 7.0.2 as the latest stable predecessor to 7.1 Beta; the release policy distinguishes stable releases from beta trials (checked 2026-10-28). Beyond the import/API changes above, the beta announcement adds these compatibility boundaries:

  • Distributive conditional types now check constraints against each distributed constituent; previously accepted generic helpers can fail. Add the necessary conditional checks rather than suppressing the error.
  • Updated DOM declarations in lib.d.ts can introduce new type errors.
  • Snapshots also require disposal; do not reuse disposed snapshots. Supply file notifications through snapshot.update() and implement watching separately.
  • Content mappers require --runExternalCode; editor use requires workspace trust and mapper permission. js/ts.contentMappers.enabled can disable them.

An attribute-aware declaration can reject an import missing its required attribute. A successful typecheck does not prove the imported file exists or that the runtime supports its attribute. The new API also changes integration assumptions; unreleased resources can leak memory, and disposed programs cannot be reused. Microsoft’s explicit-filenames API sample does not load a project config or support --project.

Diagnostic: ENOENT template-react-ts

The generator regression report contains this symptom. The fix by sapphi-red links that report and restores packaged templates. Apply the generator packaging fix before diagnosing an empty or failed scaffold as a compiler regression. No exact full cross-platform ENOENT message is asserted here.

What to test

BoundaryAcceptance check
Attribute typingCorrect attribute has the intended type; omitted/wrong attribute is rejected where required
Runtime loadingReal text/CSS/bytes fixtures load through your actual bundler or runtime
Compiler toolDiagnostics and emitted output match the expected fixtures; resources close after repeated runs
PerformanceCompare cold, warm and dependency-change runs on the same project and hardware
GeneratorChosen template files exist and its own build succeeds

Community evidence

  • David Dal Busco (peterpeterparker) requests updated compiler API examples in TypeScript #63747, observing changed types and patterns. This supports reading new examples, not assuming old tutorials remain applicable.
  • mushan0x0 reports dependency changes making incremental checking slower than a cold run in TypeScript #63731. It is a workload-specific report, not proof that the announced beta regresses all projects.
  • The generator report and linked maintainer fix above are separate evidence for packaging trouble, not compiler compatibility.

Pitfalls

  • Publishing broad ambient declarations from a library; Microsoft recommends project-owned declarations.
  • Treating lower memory and faster checking as measured results for your repository.
  • Replacing an existing app with a newly generated template to repair a dependency mismatch.
  • Assuming a generator patch and a compiler beta are the same upgrade.

Reports from users

  • “No errors are reported” — @aweebit, 2026-08-02, TypeScript #63708: a concrete generic-constraint violation, linked by the 7.1 Beta announcement as the reason for stricter checks. This predates the beta rather than demonstrating a beta regression (checked 2026-10-28).
  • “unsupported value: +Inf” — @auvred, 2026-09-11, TypeScript #64240: a 7.0.2 API reproduction panics while serializing an infinite numeric literal. The issue is closed; this is a historical compiler-client fixture, not proof that 7.1 Beta still fails (checked 2026-10-28).

A prompt to give your agent

Your training data predates this release. Read <https://devblogs.microsoft.com/typescript/announcing-typescript-7-1-beta/> and the linked generator release/fix pages before editing; do not guess API names or versions. Inventory our compiler integrations and runtime imports. Propose a branch-only beta trial, use the official entry points and disposal patterns, and preserve our config-loading behavior. Show resolved dependencies, diagnostics, build output and cold/warm/dependency-change timings. Report unsupported integrations instead of rewriting around them silently.

Limits

No compiler, scaffold, benchmark or migration was run. Evidence consists of official notes and individual GitHub reports, not broad adoption data. No price or licence comparison was needed. All release facts were checked 2026-10-28. Support-range limit: 7.0.2 → 7.1 Beta is the release-list baseline, not an explicit LTS guarantee. An exhaustive patch/changelog range for create-vite before 9.3.2 → 9.3.3 is unavailable; its tagged changelog could not be read.

Started from a post by @Daniel Rosenwasser, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# TypeScript 7.1 Beta: how do I migrate imports and tools?
Summary: As of October 2026, trial TypeScript 7.1 Beta on a branch, add attribute-aware declarations only for supported runtime imports, and port compiler tools to the new disposable API; use create-vite 9.3.3 for the template packaging fix (checked 2026-10-28).
Copy for agent
get the whatworks thread typescript-7-1-beta-import-attributes-compiler-api-migration and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread typescript-7-1-beta-import-attributes-compiler-api-migration
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks