-
Notifications
You must be signed in to change notification settings - Fork 46
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
Explain how to decide an interface's Exposed value #35
Comments
So there are two parts to this. One which explains the transition from implicitly exposing API's to Window (when omitting the extended attribute) to requiring explicit exposition. This belongs in the WebIDL spec. The second part relates to general guidelines as to where to expose APIs and arguably might belong in a more generic document about Web architecture. I imagine it's the second part you're interested in covering here. |
Obvious start is something like, what kinds of objects does this API interact with? If it's the DOM, then you want to only expose it to Window. If it's a networking API, you don't want to expose it to Worklets. Is the overall idea that we should expose to all contexts that it makes logical sense to (modulo things we've explicitly decided are mistakes and choose not to spread, like localStorage in Workers)? Or is there a more nuanced/limited concept of what's appropriate to expose in a given global? |
I think it's really subtle and as we're building out more global environments, probably requires being conservative and reaching out to the various communities developing those global environments whether your feature should be exposed. A lot of things make sense for Window and Worker, some don't make sense for all of Worker (as that includes ServiceWorker), and most doesn't make sense for Worklet. |
The TODO on me here is to add a section to:
|
This is related to #325 |
As discussed today we're going to close this and take the discussion to #325. |
Spec authors have to decide whether to expose their interfaces on just Window, or also Workers and Worklets. We should say something about how to make that decision.
See also https://www.w3.org/Bugs/Public/show_bug.cgi?id=26425.
@tobie @annevk @tabatkins
The text was updated successfully, but these errors were encountered: