-
Notifications
You must be signed in to change notification settings - Fork 315
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
Adding a developer-provided name #1121
Comments
Yea, internally we actually use the same field for SharedWorker's name and ServiceWorker scope. |
id is useful when it's tied to a specific instance of a service worker, so the currently installing service worker could have one id while the currently activating service worker could have another. @domenic are you thinking that name would be shared across all instances of the same serviceworker, or will each instance be able to have it's own name? |
I don't really have enough clue about service worker lifetimes to know what would be a reasonable answer there. |
As far as I understood, what whatwg/html#2477 suggests is to give a name to a worker global scope basically. I think we'd need to consider two more aspects when it comes to SW:
That said, I don't think the name for debugging is much relevant to SW case. As @n8schloss suggests, if we need an id for debugging, exposing service worker's id as EDIT: |
Hmm OK. This makes me lean toward "Add name to workers and omit it from service workers as they are already distinguishable in the debugger [and the concept doesn't make as much sense for them]." |
Checking whatwg/html#2664, I think we can close this issue? |
Yep, sounds good! |
This is a spinoff of whatwg/html#2477 designed specifically to gather feedback from the service worker community.
There we're contemplating adding a web-dev-supplied name:
This is anticipated to mostly be used by devtools.
Service workers have an id, but I guess that isn't developer-exposed, and is slated to be removed? #1076
For service workers a name seems less important since there's only going to be one per page (right?) and they're pretty identifiable already by their scope. So maybe we should do nothing for service workers? On the other hand @n8schloss mentioned in #1076 (comment) that this might be useful for certain use cases.
I guess there's also a bunch of questions about id and clients there that I don't understand.
I'd like some clarity on which path we want to take. Here are the options I see:
name
to workers and omit it from service workers as they are already distinguishable in the debugger.name
to workers and service workers as a developer-helper, but with no tie to service-worker concepts like clients or IDsThe text was updated successfully, but these errors were encountered: