-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Google feedback on TypeScript 4.4-beta #45047
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
Comments
@h-joo thank you very much for this summary! It sounds like Google didn't run into any issues with new strictness flags being introduced. Do you all run with |
We've been doing the latter. That'd be the reason that we had no issues with the strictness flags. We will discuss this internally whether we want to turn the new flags on. Thank you for mentioning this. |
Following the review from @h-joo , it looks wrong to remove These methods are supported by major browsers and described in https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot. |
but |
Feedback to the TypeScript team for TypeScript 4.4-beta
This GitHub issue contains feedback on the TS 4.4-beta release from the team
that is responsible for keeping Google's internal software working with the
latest version of TypeScript.
During the 4.4-beta migration, we have ran into some issues. Especially some
changes made in lib.dom.d.ts will make it diffilcut for Google to migrate. We've
listed the breaking changes which we weren't able to easily migrate in the
following section.
Breakages which are complicated to migrate
Each subsection in this section contains a diagnosis of the breakage and a link
to the github issue if available.
canvas API changes in WebGL
WebGL2RenderingContext no longer seems to have a .canvas field, however the
WebGLRenderingContext does have one. TS now doesn't list one on either API.
There seems to be a github issue
related to the failure, and it seems it has been fixed already.
Readonly attributes in DOMPoint, DOMMatrix, DOMRect
Some properties of DOMPoint, DOMMatrix, DOMRect became readonly, and this no
longer match the specification. This is because these types no longer override
properties from the extended types to be read/write.
Compare(DOMPoint):
Compare(DOMMatrix):
Compare(DOMRect):
Removed Types
SpeechRecognition, RTCError got removed from lib.dom.d.ts. There are existing
code which use this API, and it would be difficult to migrate without proper
type support either from the compiler or from definitelyTyped.
Offscreen Rendering API changes
OffscreenCanvas still exists, but it's marked as deprecated. Though it is no
longer a value, i.e. code calling
new OffscreenCanvas
no longer works, it'sjust an interface. We think this might be unintentional. Though, we would still
be able to migrate via referring to the types defined in
DefinitelyTyped.
ShadowRoot interface changes
ShadowRoot is a subtype of DocumentFragment. DocumentFragment has a
getElementById which returns HTMLElement. In 4.4-beta, DocumentFragment no
longer defines its own getElementById method, meaning
HTMLElement.prototype.shadowRoot.getElementById returns Element, not
HTMLElement. This causes hundreds of breakages of code using shadowRoot.
ChildNode interface changes
In 4.4, ChildNode no longer extends Node. This seems like a bug.
DocumentOrShadowRoot interface changes
DocumentOrShadowRoot no longer has getSelection, elementFromPoint,
elementsFromPoint, caretFromRange. We also couldn't find in the repo whether
this was intentional or not.
Impact summary (trivial fix unavailable)
Impact summary (trivial fix available)
The text was updated successfully, but these errors were encountered: