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
declareletx: A|(B&C);leta: A=x;// previously error, now the same
Originally motivated because we can't run the compiler with unions in our perf suites because of Empty intersection reduction #31838 making types more inclusive caused Node's parent property to be massive
Now by reducing when the parent property is accessed, it greatly helped the problem
10% speedup for material-ui, will help styled-components as well, and React's ref property
Key insight is that the only way to solve this problem is to not do it when constructing the intersection, but instead defer until a member is resolved
This is a breaking change: we will explore more members than we have before
We found two bugs in the current compiler, found bugs in DT
Not going to detect doubly nested discriminants at the outer level, so that won't break
declareletxx: B&C;xx.foo// today you get number, with this change its an error
Willing to take the breaking change nature of this because we found errors and the perf benefits are a clear win
The text was updated successfully, but these errors were encountered:
Touched-up edits from me on @uniqueiniquity's notes
Discriminated Narrowing with
typeof
#32399
Non-null assertions
!
with Optional Chaining?.
#36031
undefined
a?.b.c!
can still be undefinedCan appending
.js
in Auto-Imports make sense?#36725
.js
) is required in Node ESM and Browser ESM for ESM importsimportModuleSpecifierEnding
for editor optionsMaking Impossible Intersections of Discriminated Unions Produce
never
#36696
Our type rewriting rules often create types that don't make sense
Originally didn't resolve this because we thought it was expensive and would cause circularities
Now, once we're about resolve the members of the union, we reduce, instead of reducing up front
you can view this as detecting the intersection version of discriminants
note that if one has an explicitly designated never type, we allow this
Originally motivated because we can't run the compiler with unions in our perf suites because of Empty intersection reduction #31838 making types more inclusive caused Node's
parent
property to be massiveNow by reducing when the parent property is accessed, it greatly helped the problem
10% speedup for material-ui, will help styled-components as well, and React's ref property
Key insight is that the only way to solve this problem is to not do it when constructing the intersection, but instead defer until a member is resolved
This is a breaking change: we will explore more members than we have before
We found two bugs in the current compiler, found bugs in DT
Not going to detect doubly nested discriminants at the outer level, so that won't break
Willing to take the breaking change nature of this because we found errors and the perf benefits are a clear win
The text was updated successfully, but these errors were encountered: