Skip to content
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

Closed
jyasskin opened this issue Sep 29, 2016 · 6 comments
Closed

Explain how to decide an interface's Exposed value #35

jyasskin opened this issue Sep 29, 2016 · 6 comments
Assignees
Labels
Status: Consensus to write We have TAG consensus about the principle but someone needs to write it (see "To Write" project) Topic: Web IDL Has to do with Web IDL

Comments

@jyasskin
Copy link
Contributor

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

@tobie
Copy link
Contributor

tobie commented Sep 29, 2016

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.

@tabatkins
Copy link

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?

@annevk
Copy link
Member

annevk commented Sep 30, 2016

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.

@torgo torgo added the Status: In Progress We're working on it but ideas not fully formed yet. label Jul 26, 2017
@torgo torgo added Status: Consensus to write We have TAG consensus about the principle but someone needs to write it (see "To Write" project) and removed Status: In Progress We're working on it but ideas not fully formed yet. labels Apr 6, 2018
@slightlyoff
Copy link
Member

The TODO on me here is to add a section to:

  • Prompt feature developers to consider adding their APIs to workers
  • Outline the hierarchy of contexts and their lifecycles
  • Write a quick rubric for making a decision about which worker types to expose a feature one
  • Perhaps outline example IDL

@hober hober added the Topic: Web IDL Has to do with Web IDL label Jul 6, 2020
@kenchris kenchris self-assigned this Feb 3, 2021
@torgo torgo added the Overtaken? This is an old issue that may no longer be relevant? label May 3, 2021
@plinss plinss added this to the 2022-01-17-week milestone Jan 13, 2022
@kenchris
Copy link
Contributor

This is related to #325

@torgo
Copy link
Member

torgo commented Jan 17, 2022

As discussed today we're going to close this and take the discussion to #325.

@torgo torgo closed this as completed Jan 17, 2022
@torgo torgo removed the Overtaken? This is an old issue that may no longer be relevant? label Jan 17, 2022
@torgo torgo removed this from the 2022-01-17-week milestone Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Consensus to write We have TAG consensus about the principle but someone needs to write it (see "To Write" project) Topic: Web IDL Has to do with Web IDL
Projects
None yet
Development

No branches or pull requests

9 participants