-
Notifications
You must be signed in to change notification settings - Fork 13k
Update DOM types #62496
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 DOM types #62496
Conversation
@typescript-bot test it |
Hey @jakebailey, the results of running the DT tests are ready. There were interesting changes: Branch only errors:Package: deno
Package: layui-layer
Package: react-sidebar
Package: cytoscape-cxtmenu
Package: alpinejs
Package: webrtc
Package: node
Package: amap-js-api
Package: dhtmlxscheduler
Package: dom-speech-recognition
Package: stylenames
|
@jakebailey Here are the results of running the user tests with tsc comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Something interesting changed - please have a look. Details
|
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@jakebailey Here are the results of running the top 400 repos with tsc comparing Something interesting changed - please have a look. Details
|
Something seems wrong with CSS... |
Hello @jakebailey, |
I'm not sure what the right solution is here; @saschanaz any ideas? Seems super breaky as-is |
Yeah, this is tricky... Revert would effectively be a merge, because we can't revert the addition of CSSStyleProperties. But then the whole point of the spec change is to split CSSStyleProperties from CSSStyleDeclaration so that the latter can be the superclass of others. Merging would revert the whole point of the spec change, and also break things - |
One could add something like But in that case |
Well, interfaces don't affect I'd be happy with basically anything, since this unfortunately really does need to go in... |
Ah, I mean |
microsoft/TypeScript-DOM-lib-generator#2174 should help |
Thanks; I'm going to pull that PR into this one and see how it fares. |
@typescript-bot test it |
Hey @jakebailey, the results of running the DT tests are ready. There were interesting changes: Branch only errors:Package: dhtmlxscheduler
Package: dom-speech-recognition
Package: webrtc
Package: node
Package: deno
|
@jakebailey Here are the results of running the user tests with tsc comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Something interesting changed - please have a look. Details
|
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@jakebailey Here are the results of running the top 400 repos with tsc comparing Something interesting changed - please have a look. Details
|
Hmmm, not super great either.... |
🫠 |
Things that return CSSStyleProperties should return CSSStyleDeclaration instead, otherwise augmenting the latter wouldn't work... |
Hey @jakebailey, the results of running the DT tests are ready. There were interesting changes: Branch only errors:Package: dhtmlxscheduler
Package: dom-speech-recognition
Package: webrtc
Package: node
Package: deno
|
@jakebailey Here are the results of running the user tests with tsc comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Everything looks good! |
@jakebailey Here are the results of running the top 400 repos with tsc comparing Everything looks good! |
These results are better.
Most of these are quite normal; always the case that we have to fix up packages which used to provide types that DOM now does. Node might get awkward to fix. Need to try. Deno, not super sure about; the error is actually that things are double declared, not just different, which I'm not sure we can fix? |
Deno uses class declarations, it's sad that ambient class declarations can't merge with ambient variable declarations... |
Deno is fixing it (thank you @dsherret), I am trying to fix the others preemtively. |
@typescript-bot run dt |
Hey @jakebailey, the results of running the DT tests are ready. There were interesting changes: Branch only errors:Package: dhtmlxscheduler
Package: dom-speech-recognition
Package: webrtc
Package: node
|
Node will be fixed by DefinitelyTyped/DefinitelyTyped#73799 (pending discussion about the optional props).
|
Probably their JS definition shadows the browser one. As long as the page doesn't try to use both the lib and the web API, it won't break the page. |
Well, they seem to predate the web types changing, so I mainly meant it in terms of "I thought the JS spec people never declared things that conflicted with any existing pages", but maybe I'm off base. |
But, I still don't know what to do with them, other than quite literally just deleting them off of DT. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates TypeScript's DOM type definitions and adjusts test baselines to reflect the performance impact of these changes. The DOM library update brings in newer web APIs and type definitions.
Key changes:
- Updated DOM type definitions which affect TypeScript's compilation performance metrics
- Adjusted performance baseline thresholds across numerous test files to accommodate the increased type checking overhead
- Updated one specific symbol reference from
CSSStyleDeclaration
toCSSStyleProperties
Reviewed Changes
Copilot reviewed 86 out of 92 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
tests/baselines/reference/verifyDefaultLib_dom.types | Updated performance stats showing significant increases in cache, type count, instantiation count, and symbol count |
tests/baselines/reference/variableDeclarationInStrictMode1.types | Similar performance metric increases reflecting DOM lib impact |
tests/baselines/reference/*.types (60+ files) | Performance baseline adjustments across JSX, React, and other test files |
tests/baselines/reference/divergentAccessorsTypes6.symbols | Updated symbol reference from CSSStyleDeclaration to CSSStyleProperties |
tests/baselines/reference/globalThisBlockscopedProperties.types | Updated keyof typeof globalThis to include new DOM types |
@typescript-bot run dt |
Hey @jakebailey, the results of running the DT tests are ready. There were interesting changes: Branch only errors:Package: dhtmlxscheduler
Package: dom-speech-recognition
Package: webrtc
|
Want to do this before #62111 and microsoft/TypeScript-DOM-lib-generator#2168.
Now is probably not the best time, quite yet, as IIRC the dom lib is getting some more changes.
Concerning perf impact, though... @saschanaz