You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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
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.
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.
The text was updated successfully, but these errors were encountered:
Acknowledgement
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
...any[]
becoming...unknown[]
🐛instanceof
type narrowing change due to.prototype
inference 🟢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.The text was updated successfully, but these errors were encountered: