-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Update lib dom for 4.2 #42067
Update lib dom for 4.2 #42067
Conversation
OK, merging this at the end fo the day and I'll be keeping an eye out over the week for changes |
This PR breaks a lot of DT tests. In particular, lots of noise about modifiers of some getElementById<E extends Element = HTMLElement>(elementId: string): E | null; Type parameters that aren't used in the parameter list are an anti-pattern. Using a type parameter only in the return type basically amounts to an implicit type cast to the contextual type, if any. In this case the change is also breaking because the new definition produces declare function getElementById<E extends Element>(s: string): E | null;
declare function foo(x: string | HTMLElement): void;
foo(getElementById('hello')); // Now errors What happens here is that we infer |
BTW, we typically run the DT tests before merging PRs like this. Having lots of breaks in the DT tests in master leads to a bunch of counter productive noise in other PRs. |
Oof, yeah, my bad - sorry, my first time sending them over from the DOM repo. I can revert tomorrow and look at extracting the Element changes out to get a safer merge |
Updates the dom.d.ts files - Key changes:
import.meta.url
is now definedBreaking changes
microsoft/TypeScript-DOM-lib-generator#960