Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bloomberg feedback for 5.4 Beta #57464

Closed
1 task done
acutmore opened this issue Feb 21, 2024 · 0 comments
Closed
1 task done

Bloomberg feedback for 5.4 Beta #57464

acutmore opened this issue Feb 21, 2024 · 0 comments
Labels
Discussion Issues which may not have code impact

Comments

@acutmore
Copy link
Contributor

Acknowledgement

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

Comment

by @acutmore, @molisani, @dragomirtitian

We have completed our evaluation of the impact of upgrading to TypeScript 5.4 on our codebase. Here are our findings.

This is shaping up to be a medium impact release. The following table lists changes that affected our codebase, and where appropriate a link to a separate Issue:

🟢 = positive breaking change
🔴 = negative breaking change
🐛 = compiler bug

Change Affects Release notes Packages affected Reported as
More Accurate Conditional Type Constraints (with optional property) 🟢 Type Checking Yes ~95% (transitive)(3 direct)  
Preserved Narrowing in Closures Following Last Assignments 🟢 Type Checking Yes 2  
Errors When Type-Only Imports Conflict with Local Values 🟢 Type Checking Yes 2  
...any[] becoming ...unknown[]  🐛 Type Checking   2 #57389
New circular type alias error 🐛 Type Checking   1 #57357
instanceof type narrowing change due to .prototype inference 🟢 Type Checking   1 #57397
Interface merging no longer masking wider return type 🟢 Type Checking   1 n/a
Inline type import not utilizing existing import 🔴 .d.ts emit   8 #57415

More Accurate Conditional Type Constraints (with optional property)

Comes from: #56004

Playground

This impacted most of our packages because it caused a new error in core packages that almost everything else depends on, and we don't skipLibChecks.

Looking at the error it is correctly identifying that the type may not be valid when instantiated, so is a good error. We have since improved these types to have a more accurate constraint.

Side-note: This particular pattern only errors when exactOptionalPropertyTypes is disabled (we keep this as the default).

Interface merging no longer masking wider return type

Bisects to: #55447

This bug fix impacted one package. This error does also appear in TS 5.3 if the order of a union is changed - so 5.4 is now more reliably catching this regardless of union order.

Playground

Inline type import not utilizing existing import

Bisects to: #56857

This negatively impacted 8 packages. In some cases TypeScript is no longer utilizing existing import statements for declaration emit, and instead adding new inline type imports. This triggers an error in our build pipeline where we assert that .d.ts imports only resolve to a package's public entrypoints.

@RyanCavanaugh RyanCavanaugh added the Discussion Issues which may not have code impact label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Issues which may not have code impact
Projects
None yet
Development

No branches or pull requests

2 participants