TypeScript 7.1 Beta adds import attributes in ambient modules and an es2026 target
The beta also introduces source phase imports and a new multi-entry-point API for building tools on the Go-based compiler.
Microsoft has released the beta of TypeScript 7.1, installable with npm install -D typescript@beta. The headline change is support for import attributes in ambient module declarations, so a declaration such as a wildcard module can now be tied to a specific attribute like type: text, css or bytes.
With these declarations a project gets an error if a file is imported without the required attribute, and the imported value gets the correct type. The team notes that such imports are not validated against files on disk, and recommends that libraries leave these declarations out of published packages so applications can configure their own globals.
The release also adds es2026 as a stable --target and --lib option, covering newly standardised library features, and brings a set of proposed Promise and Iterator methods into --lib esnext. Source phase imports are available too, with a note that many tools do not yet support them for JavaScript files.
A new API is organised into several entry points such as typescript/sync, typescript/async and typescript/fs, aimed at tool authors. Developers can try the beta in a branch or CI job, and tool authors who use the compiler API should review the new entry points before the final release.
Sources
- Announcing TypeScript 7.1 Betaofficial
Verified Oct 23, 2026 (official source). typescriptjavascriptdeveloper-toolsrelease