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
Issues with inferring from a deeply-recursive type to a deeply-recursive mapped type.
Now a type in the DOM is deeply-recursive.
Part of the issue here is that mapped types try to eagerly operate on array types when they run into them.
We increased our instantiation depth limit from 50 to 500.
On some browsers, that's high enough to cause a stack overflow.
Might have to go back to a depth limit of 100 instead - so how do we keep the same wins from before?
Rewriting type instantiation logic to trampoline is scary.
Quick aside: trampolining in this context is replacing recursion by preserving state across calls, either through continuation passing style and closures or generators and state machines.
One thing we're experimenting with is tail recursion in recursive conditional types.
Have to end in the original type reference.
Now you can write string trimming logic that happily chomps away at whitespace and never takes up any stack space.
#45685 for a link to my idea for letting package managers handle lib redirection. To clarify: npm has no issues doing this. In a hypothetical world where you have a dependency that declares a dependency version that you want to override is a scenario where npm is less usable than yarn, but that's not actually particularly applicable here, as we (the typescript compiler) will only look at the top-level version anyway, so you can trivially override the witnessed version just by depending on a specific version yourself.
Library Reference Overrides / Overrides for
/// <reference lib />
#45518
lib
references via the TSConfig #45518) just does atsconfig.json
override./// <reference lib />
syntax. There's no way to really get rid of these in the first place."ignore-lib": ["dom"]
?"lib": ["!dom"]
?-dom
and!dom
./// <reference lib="!dom" />
?types
array.@typescript/es2019
)node_modules
ideas. @weswigham will need to give some written details on what this looks like.Handling Stack Overflows from Instantiations Across Runtimes
#45576
Have to end in the original type reference.
Now you can write string trimming logic that happily chomps away at whitespace and never takes up any stack space.
"Fails" if your branch ends in a union instead, but users can encode that with an accumulator.
The text was updated successfully, but these errors were encountered: