microsoft / microsoft/TypeScript

Bloomberg TS5.5-beta feedback

Open
#58,523 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Discussion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
1d 19h
Merged PRs (30d)
117

Description

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

We are in the process of evaluating the impact of TS 5.5 beta on Bloomberg code. Below are preliminary findings.

Overall this looks to be a low-impact release. The following changes were observed and seem to either be benign in nature or else improvements:

Change Impacts Release notes Packages affected
Stricter type-checking of partial objects Type checker This may be caused by improved type predicates 1
Improved narrowing of Array.isArray result Type checker This may be caused by improved type predicates 1
Exports are hoisted to the top of a module Emitted JS Not announced Most
Stricter type-checking of partial objects

We observed one project with a new type error in 5.5-beta, seemingly due to an improvement in type-checking for partials.

A minimal reproduction is here.

Improved narrowing of Array.isArray result

We observed for one project a new type error from trying to compare a string with an array after an Array.isArray check. The generics involved make a minimal reproduction infeasible but the essence of the code is:

if (Array.isArray(foo)) {
     If (foo !== "something") // raises a new error for some complex foo
}
Exports are hoisted to the top of a module

Module exports seem to be hoisted to the top of modules now. No runtime impact observed.

Object.defineProperty(exports, "__esModule", { value: true });
+exports.foo = foo;
 function foo() {
     // …
 }
-exports.foo = foo;

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

The issue names no repository files or tests; start with the linked TypeScript 5.5 beta minimal reproduction and compare the reported type-checking behavior with the release notes. Then investigate the Array.isArray narrowing example and emitted export ordering, with done meaning the findings are confirmed as expected behavior or actionable regressions.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.