-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Get rid of WindowOrWorkerGlobalScope without splitting the entries #9127
Comments
Do you intend to file an issue in Web IDL, because it kinda makes sense to me? |
I hadn't planned on that, no. That would require new syntax for putting methods, attributes and constants on the global object, and I'm not sure what that would look like? I guess something like this? [Exposed=Window]
Promise<Response> fetch(...); Maybe that would be nice? But I think it need not inform how we deal with this in BCD, it would be changing the syntax of Web IDL but not what the resulting JS environment is like. |
[Exposed=Window]
global Promise<Response> fetch(...);
[Exposed=Window]
global attribute Navigator navigator; I guess this form would be easier to read both for machines and humans. But yeah, it's not a blocker for BCD of course. |
I still think that we should have a single entry for these things, but I'm not sure if it should be @ddbeck @Elchi3 do you agree that we should keep single entries here? If it's only a matter of picking the structure, do you have any preferences? I would be happy with almost anything that unblocks #8929 :) |
|
In #9125 (comment) @teoli2003 proposes to split. What you think about it, @foolip? |
@Elchi3 that issue is about |
To understand better what we are trying to achieve here, I opened two draft PRs:
The first one (that proposes to split) felt more naturally fitting into BCD to me, but I'm happy to hear feedback. Also, let me know if I misunderstood what exactly was meant by not splitting this mixin. |
#11518 matches what I had in mind, and I like what I'm seeing there. If the MDN pages are also merged, there would be a single place to learn about, for example, |
Yes, I think the unified approach has benefits for MDN readers. I will work on refining that PR further so we can see how it would go. Does anyone else have thoughts on how a unified approach would break a bit an exact mapping from Web IDL to BCD paths? Is that a thing people care about? |
It matters in https://github.com/microsoft/TypeScript-DOM-lib-generator. I hope it should be easy enough to remap, but since the mapping is breaking further and further, I'll probably write a new library that represents exact mapping 🤔 |
For anyone interested: I published https://www.npmjs.com/package/bcd-idl-mapper |
@saschanaz do you have an example of how to use bcd-idl-mapper together with a bunch of IDL and BCD? From the docs it sounds like it's just a BCD-like object, but I'm not quite sure how to use it. |
It's basically same as getting the corresponding data from BCD. Say the wanted item is about |
I see, so it seems like bcd-idl-mapper is actually a reorganized version of BCD, I assumed based on the name that it would provide some mapping (IDL to BCD path) and not the BCD data directly. And it seems like as long as BCD still has some mixin data, bcd-idl-mapper is going to be a mix of styles, like |
I guess we need to make a call which route we want to go:
It seems like the |
No objections, strong support! :) |
The recap a discussion yesterday, we're in agreement on the
|
I believe mdn/content#8351 and #11518 fixed this. |
@Elchi3 I still don't think we have docs for when to use globals. Unless I've missed something. I think we should keep this open until it's done. |
Oh yes, sorry. I'm assigning this to @foolip then. |
I have "Guideline for _globals" written on a piece of paper here, so one day :) |
The guidelines have been added in #12652, so I think it's safe to close this issue now! |
Filing an issue for a problem raised in #7849 (comment) and #8929 (comment).
When getting rid of mixins, the default outcome would be replacing
api.WindowOrWorkerGlobalScope.fetch
withapi.Window.fetch
+api.WorkerGlobalScope.fetch
, but that doesn't seem great.It's an accident of how Web IDL works that the exposure set of interfaces like
Request
is defined using[Exposed=(Window,Worker)]
while the exposure set of methods likefetch
is defined usingpartial interface mixin WindowOrWorkerGlobalScope
.I think we should find a common way to represent the worker exposure. Many different approaches could work, but my first suggestion would be
api.WindowOrWorkerGlobalScope.fetch
→api.fetch
and working through the many consequences of that.The text was updated successfully, but these errors were encountered: