microsoft / microsoft/TypeScript

Bloomberg feedback for 6.0

Open
#63,245 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Discussion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

Acknowledgement
  • I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.
Comment

We evaluated the 6.0 RC releases and 6.0 is a moderate impact release for us.

# Change Affects Release notes Packages affected Reported as
1 Deprecation of node module resolution Module Resolution Yes <1%
2 Key mapping in mapped clause cause contextual types to fail Type Checking No <1% #63225
3 Inference produces different result Type Checking No <1% #63227
4 JS emit removes comments Emit No <1%
5 API changes hasDefaultLib removed Type Checking Yes 100%

Deprecation of node module resolution

All our projects used the node moduleResolution. With the release of 6.0 this was deprecated. The resolution closest to our internal module loader behavior is bundler.

Most of the projects did not have issue migrating, although some did due to two main causes:

  1. Some import types in declarations switched to using import('.') instead of import('.\index') which we do not support
  2. Some projects used declaration files for json files that used the extension json.d.ts which worked fine in node but not with bundler (and using --allowArbitraryExtensions requires the extension to be d.json.ts which we currently do not support)

However these impacted a very small number of packages.

JS emit removes comments

Some comments above JSX elements are removed where before they were preserved. These seem like an improvement:

function Component() {
    return (
        // Comment is removed in 6.0
        <div></div>
    )
}

Playground Link 6.0
Playground Link 5.0

API changes hasDefaultLib removed

We had a custom implementation of skipLibChecks that only checked declarations authored in the project (usually hand authored) but not those that come from a trusted central source. This relies on setting the hasDefaultLib flag on the declaration source files from the trusted source and using skipDefaultLibChecks. This approach unfortunately no longer works with 6.0 resulting in slower build times for us.

One workaround if overriding isSourceFileDefaultLibrary on the program instance. This seems to work well in 6.0. It would be useful to have a better way to exclude files from type checking in 7.0 where we will not be able to do such monkey patching. Even with the perf improvements in 7.0 it seems wasteful to check files we know are valid.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the linked Playground examples and the reported issues #63225 and #63227, then investigate the module-resolution, JavaScript emit, and Program API areas named in the report. There is no single completion criterion: the migration effects, comment removal, inference changes, and default-library checking concerns would need separate reproduction and decisions.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.