-
Notifications
You must be signed in to change notification settings - Fork 440
Update Navigator type #700
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 Navigator type #700
Conversation
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.
There are a few MS-specific interfaces that are removed in this PR. Can you add them back manually unless you are sure that nobody is using them?
I will try to add these specific interfaces back to the files. Sorry for my late response and thanks for notifying it... 👍 |
hmm... why the test still failed while my local success...? 🤔 |
It's because dom.generated.d.ts is generated from various widl files plus some overriding jsons. You need to add Here's an example of the first: "interfaces": {
"interface": {
"MSFileSaver": {
"name": "MSFileSaver",
"methods": {
"method": {
"msSaveBlob": {
"name": "msSaveBlob",
"override-signatures": [
"msSaveBlob(blob: any, defaultName?: string): boolean"
]
}
// more methods here ...
}
},
"no-interface-object": 1
}, Here's what I've got in overridingTypes.json for Navigator, but it's not working properly yet: "interface": {
"Navigator": {
"name": "Navigator",
"extends": ["MSFileSaver", "MSNavigatorDoNotTrack"]
}, I'll keep looking at the code and update when I figure it out. @saschanaz any suggestions? |
You don't need to manually rewrite |
Hmm... what's different between "SVGFEDropShadowElement": {
"name": "SVGFEDropShadowElement",
"exposed": "Window",
"properties": {
"property": {
"in1": {
"name": "in1",
"read-only": 1,
"override-type": "SVGAnimatedString"
},
"dx": {
"name": "dx",
"read-only": 1,
"override-type": "SVGAnimatedNumber"
},
"dy": {
"name": "dy",
"read-only": 1,
"override-type": "SVGAnimatedNumber"
},
"stdDeviationX": {
"name": "stdDeviationX",
"read-only": 1,
"override-type": "SVGAnimatedNumber"
},
"stdDeviationY": {
"name": "stdDeviationY",
"read-only": 1,
"override-type": "SVGAnimatedNumber"
}
}
},
"methods": {
"method": {
"setStdDeviation": {
"name": "setStdDeviation",
"override-signatures": [
"setStdDeviation(stdDeviationX: number, stdDeviationY: number): void"
]
}
}
},
"extends": "SVGElement",
"implements": [
"SVGFilterPrimitiveStandardAttributes"
]
}, The output is: |
The |
Hmm... My local test already success, but why it failed again..? 🤔 |
Hmm, it seems you should do rebase or merge from master branch. |
Ok, will merge from master first... |
Currently already up to date with master. |
081d8d2
to
e61b35f
Compare
inputfiles/addedTypes.json
Outdated
@@ -2207,6 +2207,150 @@ | |||
} | |||
} | |||
} | |||
}, | |||
"MSFileSaver": { |
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.
All changes here in addedTypes.json look redundant. implements
in overridingTypes.json
should do these things automatically.
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.
All the added interfaces in addedTypes? such as MSFileSaver, MSNavigatorDoNotTrack, ExceptionInformation, etc.?
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.
Yup. They were once removed from the result because implements
did not included them (so the code thought they were needless), but as you added them again via overridingTypes.json
, now those should be kept intact without these manual typings.
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.
But, some interfaces like MSLaunchUriCallback
, ExceptionInformation
, ConfirmSiteSpecificExceptionsInformation
, StoreExceptionsInformation
, and StoreSiteSpecificExceptionsInformation
have been deleted, so I added it back manually through addedTypes.json
.
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.
That's because we have a type tracker that auto-deletes unreferenced/unexposed dictionaries and interfaces. Try removing them and building again, and you'll see those types won't be removed again 😁
The test failure seems to be from an ordering problem... What environment are you on? OS and node.js version, etc. |
inputfiles/addedTypes.json
Outdated
@@ -2207,6 +2207,20 @@ | |||
} | |||
} | |||
} | |||
}, | |||
"MSLaunchUriCallback": { | |||
"name": "MSLaunchUriCallback", |
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.
Ah, this is a problem. Could you remove this and add MSLaunchUriCallback
to "Window" field of knownTypes.json?
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.
Ok, sure.. will mve it to knownTypes.json...
OS: Office Notebook => Ubuntu 18.04 LTS (amd64), Personal Notebook (current): Manjaro Illyria 18.0.4 (amd64) |
I'm not sure what's the core problem yet but confirmed that we have a compatibility problem with Node.js 8/10. Updating to Node.js 12 fixes the problem. |
I see... will switch node to v12... 👍 |
baselines/dom.generated.d.ts
Outdated
@@ -10805,30 +10817,21 @@ declare var NavigationPreloadManager: { | |||
}; | |||
|
|||
/** The state and the identity of the user agent. It allows scripts to query it and to register themselves to carry on some activities. */ | |||
interface Navigator extends NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, MSNavigatorDoNotTrack, MSFileSaver, NavigatorBeacon, NavigatorConcurrentHardware, NavigatorUserMedia, NavigatorLanguage, NavigatorStorage, NavigatorAutomationInformation { | |||
readonly activeVRDisplays: ReadonlyArray<VRDisplay>; |
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.
We should restore activeVRDisplays
/getVRDisplays()
and NavigatorBeacon
. Looks good otherwise.
Changes