-
Notifications
You must be signed in to change notification settings - Fork 108
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
Add features and assign more keys for workers (and add a workers group) #2665
base: main
Are you sure you want to change the base?
Changes from all commits
608e7b8
656d45d
f46c301
20864a1
3dd46a5
11d8cdc
8c9259f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Dedicated workers | ||
description: The `Worker()` constructor runs a script in its own thread, which can send and receive messages with the script that created it. Also known as web workers. | ||
spec: https://html.spec.whatwg.org/multipage/workers.html#workers | ||
caniuse: webworkers | ||
group: workers | ||
status: | ||
compute_from: api.WorkerGlobalScope.importScripts | ||
compat_features: | ||
- api.DedicatedWorkerGlobalScope | ||
- api.DedicatedWorkerGlobalScope.close | ||
- api.DedicatedWorkerGlobalScope.name | ||
- api.Worker | ||
- api.Worker.Worker | ||
- api.Worker.Worker.mime_checks | ||
- api.Worker.Worker.options_name_parameter | ||
- api.Worker.error_event | ||
- api.Worker.terminate | ||
- api.Worker.worker_support | ||
- api.WorkerGlobalScope | ||
- api.WorkerGlobalScope.error_event | ||
- api.WorkerGlobalScope.importScripts | ||
- api.WorkerGlobalScope.importScripts.mime_checks | ||
- api.WorkerGlobalScope.location | ||
- api.WorkerGlobalScope.navigator | ||
- api.WorkerGlobalScope.rejectionhandled_event | ||
- api.WorkerGlobalScope.self | ||
- api.WorkerGlobalScope.unhandledrejection_event | ||
- api.WorkerLocation | ||
- api.WorkerLocation.hash | ||
- api.WorkerLocation.host | ||
- api.WorkerLocation.hostname | ||
- api.WorkerLocation.href | ||
- api.WorkerLocation.origin | ||
- api.WorkerLocation.pathname | ||
- api.WorkerLocation.port | ||
- api.WorkerLocation.protocol | ||
- api.WorkerLocation.search | ||
- api.WorkerLocation.toString | ||
- api.WorkerNavigator |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
# Generated from: dedicated-workers.yml | ||
# Do not edit this file by hand. Edit the source file instead! | ||
|
||
status: | ||
baseline: high | ||
baseline_low_date: 2015-07-29 | ||
baseline_high_date: 2018-01-29 | ||
support: | ||
chrome: "4" | ||
chrome_android: "18" | ||
edge: "12" | ||
firefox: "4" | ||
firefox_android: "4" | ||
safari: "4" | ||
safari_ios: "5" | ||
compat_features: | ||
# baseline: high | ||
# baseline_low_date: 2015-07-29 | ||
# baseline_high_date: 2018-01-29 | ||
# support: | ||
# chrome: "2" | ||
# chrome_android: "18" | ||
# edge: "12" | ||
# firefox: "3.5" | ||
# firefox_android: "4" | ||
# safari: "4" | ||
# safari_ios: "5" | ||
- api.Worker | ||
- api.Worker.terminate | ||
|
||
# baseline: high | ||
# baseline_low_date: 2015-07-29 | ||
# baseline_high_date: 2018-01-29 | ||
# support: | ||
# chrome: "4" | ||
# chrome_android: "18" | ||
# edge: "12" | ||
# firefox: "3.5" | ||
# firefox_android: "4" | ||
# safari: "4" | ||
# safari_ios: "5" | ||
- api.DedicatedWorkerGlobalScope | ||
- api.DedicatedWorkerGlobalScope.close | ||
- api.Worker.Worker | ||
- api.Worker.error_event | ||
- api.WorkerGlobalScope | ||
- api.WorkerGlobalScope.error_event | ||
- api.WorkerGlobalScope.location | ||
- api.WorkerLocation | ||
- api.WorkerLocation.hash | ||
- api.WorkerLocation.host | ||
- api.WorkerLocation.hostname | ||
- api.WorkerLocation.href | ||
- api.WorkerLocation.pathname | ||
- api.WorkerLocation.port | ||
- api.WorkerLocation.protocol | ||
- api.WorkerLocation.search | ||
- api.WorkerLocation.toString | ||
- api.WorkerNavigator | ||
|
||
# baseline: high | ||
# baseline_low_date: 2015-07-29 | ||
# baseline_high_date: 2018-01-29 | ||
# support: | ||
# chrome: "4" | ||
# chrome_android: "18" | ||
# edge: "12" | ||
# firefox: "3.5" | ||
# firefox_android: "34" | ||
# safari: "4" | ||
# safari_ios: "5" | ||
- api.WorkerGlobalScope.self | ||
|
||
# ⬇️ Same status as overall feature ⬇️ | ||
# baseline: high | ||
# baseline_low_date: 2015-07-29 | ||
# baseline_high_date: 2018-01-29 | ||
# support: | ||
# chrome: "4" | ||
# chrome_android: "18" | ||
# edge: "12" | ||
# firefox: "4" | ||
# firefox_android: "4" | ||
# safari: "4" | ||
# safari_ios: "5" | ||
- api.WorkerGlobalScope.importScripts | ||
|
||
# baseline: high | ||
# baseline_low_date: 2016-09-20 | ||
# baseline_high_date: 2019-03-20 | ||
# support: | ||
# chrome: "38" | ||
# chrome_android: "38" | ||
# edge: "14" | ||
# firefox: "29" | ||
# firefox_android: "29" | ||
# safari: "10" | ||
# safari_ios: "10" | ||
- api.WorkerLocation.origin | ||
|
||
# baseline: high | ||
# baseline_low_date: 2018-04-30 | ||
# baseline_high_date: 2020-10-30 | ||
# support: | ||
# chrome: "4" | ||
# chrome_android: "18" | ||
# edge: "17" | ||
# firefox: "3.5" | ||
# firefox_android: "4" | ||
# safari: "4" | ||
# safari_ios: "5" | ||
- api.WorkerGlobalScope.navigator | ||
|
||
# baseline: high | ||
# baseline_low_date: 2019-03-25 | ||
# baseline_high_date: 2021-09-25 | ||
# support: | ||
# chrome: "70" | ||
# chrome_android: "70" | ||
# edge: "18" | ||
# firefox: "55" | ||
# firefox_android: "55" | ||
# safari: "12.1" | ||
# safari_ios: "12.2" | ||
- api.DedicatedWorkerGlobalScope.name | ||
- api.Worker.Worker.options_name_parameter | ||
|
||
# baseline: high | ||
# baseline_low_date: 2020-07-28 | ||
# baseline_high_date: 2023-01-28 | ||
# support: | ||
# chrome: "49" | ||
# chrome_android: "49" | ||
# edge: "79" | ||
# firefox: "69" | ||
# firefox_android: "79" | ||
# safari: "11" | ||
# safari_ios: "11" | ||
- api.WorkerGlobalScope.rejectionhandled_event | ||
- api.WorkerGlobalScope.unhandledrejection_event | ||
|
||
# baseline: low | ||
# baseline_low_date: 2022-09-12 | ||
# support: | ||
# chrome: "71" | ||
# chrome_android: "71" | ||
# edge: "79" | ||
# firefox: "67" | ||
# firefox_android: "67" | ||
# safari: "16" | ||
# safari_ios: "16" | ||
- api.WorkerGlobalScope.importScripts.mime_checks | ||
|
||
# baseline: false | ||
# support: | ||
# firefox: "81" | ||
# firefox_android: "81" | ||
# safari: "16" | ||
# safari_ios: "16" | ||
- api.Worker.Worker.mime_checks | ||
|
||
# baseline: false | ||
# support: | ||
# firefox: "34" | ||
# firefox_android: "34" | ||
- api.Worker.worker_support |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
name: JavaScript modules in service workers | ||
description: 'The `navigator.serviceWorker.register()` method accepts `{ type: "module" }` to load scripts that use `import` and `export`. Also known as ECMAScript modules or ESM in service workers.' | ||
spec: https://w3c.github.io/ServiceWorker/#dom-registrationoptions-type | ||
group: js-modules | ||
group: | ||
- js-modules | ||
- workers |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
name: JavaScript modules in shared workers | ||
description: 'The `SharedWorker()` constructor accepts `{ type: "module" }` to load scripts that use `import` and `export`. Also known as ECMAScript modules or ESM in shared workers.' | ||
spec: https://html.spec.whatwg.org/multipage/workers.html#shared-workers-and-the-sharedworker-interface:dom-sharedworker-2 | ||
group: js-modules | ||
group: | ||
- js-modules | ||
- workers |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
name: JavaScript modules in workers | ||
description: 'The `Worker()` constructor accepts `{ type: "module" }` to load scripts that use `import` and `export`. Also known as ECMAScript modules or ESM in workers.' | ||
spec: https://html.spec.whatwg.org/multipage/workers.html#dom-worker-dev | ||
group: js-modules | ||
group: | ||
- js-modules | ||
- workers |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,15 @@ spec: | |
- https://html.spec.whatwg.org/multipage/indices.html#event-messageerror | ||
- https://w3c.github.io/ServiceWorker/#eventdef-serviceworkerglobalscope-messageerror | ||
group: messaging | ||
status: | ||
compute_from: | ||
- api.DedicatedWorkerGlobalScope.messageerror_event | ||
- api.MessagePort.messageerror_event | ||
- api.ServiceWorkerContainer.messageerror_event | ||
- api.Window.messageerror_event | ||
compat_features: | ||
- api.DedicatedWorkerGlobalScope.messageerror_event | ||
- api.MessagePort.messageerror_event | ||
- api.ServiceWorkerContainer.messageerror_event | ||
- api.Window.messageerror_event | ||
- api.Worker.messageerror_event | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are errors separated into their own feature instead of with their parent features? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good question too. I don't know how these features came to be. The guiding principle for features should always be: does this feature make sense, individually, to web developers? Is this something they talk about separately from other things? Is this perceived as an incremental addition to the platform? I'm not super convinced that this feature should exist on its own to be honest, but I don't have the context. Maybe the guiding principle I mentioned before applies here. I just don't know enough to be sure. One other aspect to keep in mind is that, over time, as features mature and get baseline high, it makes less and less sense for them to live on their own. That's why we're working on a mechanism to merge features. Maybe messageerror makes sense now, but in a few years from now, we might want to merge it into a bigger parent feature. By then, it's likely that developers won't think of messageerror as a separate thing anymore. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
name: requestAnimationFrame() in workers | ||
description: The `requestAnimationFrame()` method in workers schedules a function that runs before the next repaint. Together with offscreen canvas, you can animate content from a worker. | ||
spec: https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#animation-frames | ||
group: workers |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Shared worker | ||
description: The `SharedWorker()` constructor runs a script in its own thread, which can send and receive messages with other scripts running at the same origin. | ||
spec: https://html.spec.whatwg.org/multipage/workers.html#shared-workers-introduction | ||
caniuse: sharedworkers | ||
group: workers | ||
status: | ||
compute_from: api.SharedWorker | ||
compat_features: | ||
- api.SharedWorker | ||
- api.SharedWorker.SharedWorker | ||
- api.SharedWorker.SharedWorker.mime_checks | ||
- api.SharedWorker.SharedWorker.options_name_parameter | ||
- api.SharedWorker.error_event | ||
- api.SharedWorker.port | ||
- api.SharedWorkerGlobalScope | ||
- api.SharedWorkerGlobalScope.close | ||
- api.SharedWorkerGlobalScope.connect_event | ||
- api.SharedWorkerGlobalScope.name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a process/decision-making question: I noticed that only
close
andname
are included forDedicatedWorkerGlobalScope
, why only those two? Is there something unique about them that the other properties don't have?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this particular case, it seems to be because the other BCD keys under api.DedicatedWorkerGlobalScope are already assigned to other features.
If you open https://web-platform-dx.github.io/web-features-explorer/ids/, you'll see the entire list of features, together with their BCD keys. On that page, you can do a search for "api.DedicatedWorkerGlobalScope".
You'll see that api.DedicatedWorkerGlobalScope.message_event and api.DedicatedWorkerGlobalScope.postMessage, for example, are already part of the postmessage feature.
Currently, in web-features, a given BCD key can only be part of one feature at most. This is something we might change in the future.
You're asking a good question though. I don't think there's a super clear way to answer whether those BCD keys should be in postmessage, or in dedicated-workers.