Open littledan opened 2 years ago
I'm supportive of this. Defining a common minimum API list in the ShadowRealm can definitely help people to know the commonality of these runtimes.
I'd hope that, ideally, the
[Exposed=*]
list is a subset of the WinterCG list; if we deviate from that, we should understand why.
I'm wondering if events like ErrorEvent
or PromiseRejectionEvent
are common to WinterCG. It should meet the bar of at least two runtimes implemented them, but I suppose they are not going to be implemented in Node.js anyway.
We discussed this list in the 2022-07-14 WinterCG call. The list seems to be a subset of the common minimum API discussed here, so [Exposed=*]
makes sense to apply to WinterCG environments, and conversely, ShadowRealms created inside of a WinterCG environment should contain all the same APIs as on the web. We agreed to audit the list more fully to confirm these properties.
It seems like there are [Exposed=*]
interfaces which aren't in the list. In particular:
CustomEvent
ErrorEvent
and PromiseRejectionEvent
. As mentioned earlier in this thread, these are not very useful unless we specify the error
and unhandledrejection
events in a web-compatible way though.WritableStreamDefaultWriter
. This seems to have been an oversight.
ShadowRealms support some Web APIs, through the new notation
[Exposed=*]
in WebIDL, see https://github.com/tc39/proposal-shadowrealm/issues/331. We should consider examining the list of APIs exposed in this way and comparing it to the WinterCG list. I'd hope that, ideally, the[Exposed=*]
list is a subset of the WinterCG list; if we deviate from that, we should understand why.