microsoft / microsoft/TypeScript

Bloomberg TS5.5-beta feedback

Aperta
#58,523 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Discussion
Lingua principale
Go
Stelle
111k
Fork
14.4k
Merge medio
1g 19h
PR unite (30g)
117

Descrizione

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;

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

L’issue non indica file o test del repository; inizia dalla riproduzione minima collegata di TypeScript 5.5 beta e confronta il comportamento riportato del controllo dei tipi con le release notes. Poi analizza l’esempio di narrowing di Array.isArray e l’ordine degli export emessi; il lavoro è completato quando i risultati sono confermati come comportamento previsto o come regressioni risolvibili.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, typescript
Ambito
compilers
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.