Skip to content

TypeScript 4.7 Support #4800

Closed
Closed
@bradzacher

Description

@bradzacher

https://devblogs.microsoft.com/typescript/announcing-typescript-4-7-rc/

This issue is just to track all of the new features and their implementation state in this project.
As with all releases, we will not necessarily to support all features until closer to the full release when everything the features are stabilised.

Please be patient.

🔲 New Extensions

We'll want to add .cjs, .mjs, .mts, and .cts (as well as .d.cts and .d.mts) to our parser tooling so that we can correctly detect file types and default supported extensions.

Some code pointers to start off:
[1] [2] [3] [4] [5]

Essentially just search for .ts and go from there.

✅ Instantiation Expressions (#4938)

This will require AST changes.

Babel: babel/babel#14457

// extend Expression
type Expression = Expression | TSExpressionWithTypeArguments;

// Add new node
interface TSExpressionWithTypeArguments {
  type: "TSExpressionWithTypeArguments";
  expression: Expression;
  typeParameters: TSTypeParameterInstantiation;
}

extends Constraints on infer Type Variables (#4830)

This is already supported and will not require AST changes

✅ Optional Variance Annotations for Type Parameters (#4831)

This will require AST changes.

Babel: babel/babel#14359

// extend TSTypeParameter
interface TSTypeParameter {
  in?: boolean;
  out?: boolean;
}

lib.d.ts Updates (#4829)

We will need to regenerate our types within scope-manager.


Other changes with no impact to us

  • ECMAScript Module Support in Node.js
  • type in package.json
  • CommonJS Interop
  • package.json Exports, Imports, and Self-Referencing
    • Though with the next major we'll probably want to explore this to lock down our APIs and prevent deep dist imports whilst also providing nicely structured deep imports (i.e. map utils/dist/foo => utils/foo)
  • Control over Module Detection
  • Control-Flow Analysis for Computed Properties
    • This will just make all of our rules more accurate for free!
  • Improved Function Inference in Objects and Methods
  • Resolution Customization with moduleSuffixes
  • resolution-mode
  • Groups-Aware Organize Imports
  • Object Method Snippet Completions
  • Type Parameters No Longer Assignable to {} in strictNullChecks
  • readFile Method is No Longer Optional on LanguageServiceHost
  • readonly Tuples Have a readonly length Property

Metadata

Metadata

Assignees

No one assigned

    Labels

    ASTPRs and Issues about the AST structureNew TypeScript Versionaccepting prsGo ahead, send a pull request that resolves this issuedependenciesIssue about dependencies of the package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions