-
Notifications
You must be signed in to change notification settings - Fork 431
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
Non-deprecated lib.dom.d.ts properties removed #857
Comments
Generally speaking, we generate these from WebIDL files, but I don't know what our story is for vendor-specific additions and how they come/go. @sandersn @RyanCavanaugh has there been much discussion around that? |
#828 is the PR where we tried to write down our current thinking. Briefly, we're trying to include things that are in 2 or more browsers and a standards document. I don't think |
They can be present and work with certain browsers though without negative effects on other browsers though, right? I can understand the desire to remove these to have a common subset but this is generating build errors for what is otherwise valid code for the same browser configurations without a lot of warning / deprecation. |
As I understand it, we don't want to have the default typescript/javascript completions suggest properties that aren't actually available in the majority of browsers. However, before now we've never even tried to address breaking changes in the DOM. I think there are two missing pieces:
@orta and @saschanaz will probably also have a useful take on this since they have more expertise than I do with web standards. |
We want to be moving to a place where more of the artifacts we build the dom types from come from the IDLs which the W3C/WHATWG provide instead of the edge ones aren't updated anymore I could see a new DT module which keeps the vendor specific properties via interface merging as a great backup strategy Re: two, that's a bit harder (we'd have to bake it into the compiler?) but we could at least go back and add a note to the release notes of the 3.9 blog post? |
This seems also be true for Calls to
Is this intended? If yes, is there a way to add this without declaring another global window, e.g. declare global {
interface Window {
console: Console;
}
} |
|
I was running into a similar problem building ionic-team/stencil using [email protected] - specifically this line src/hydrate/runner/runtime-log.ts#L4. @saschanaz I see you're referring to https://github.com/microsoft/TSJS-lib-generator/blob/master/baselines/dom.generated.d.ts#L19486 declare var window: Window & typeof globalThis; I can confirm So should we use the following type/s moving forward? const win: Window & typeof globalThis;
...
const or: typeof window; I haven't really dug into the code/documentation so correct me if I'm wrong - I feel like |
I guess I understand why I'm getting this error. My method signature looks like this const fn = ( win: Window ) => { win.console.log() } According to your explanation I need to change it to const fn = ( win: Window & globalThis ) => { win.console.log() } Right? IMHO this is a bit awkward 😅 |
@muuki88 |
Thanks a lot for the fast feedback. will do |
Or event less thinking needed: |
@saschanaz |
Ah true, thanks for correction. |
While trying the TS 3.9 RC I'm encountering numerous compile errors against
lib.dom.d.ts
against properties that have been removed. I noticed the introduction of these changes in this PR, notably properties ofCSSStyleDeclaration
such asms*
,webkit*
, andlayout*
. Given many of these weren't marked deprecated I want to make sure this is expected behavior.(Making this issue after speaking with @DanielRosenwasser and tagging @sandersn . Thanks!)
The text was updated successfully, but these errors were encountered: