Skip to content

Commit 0ca6ca1

Browse files
Update the use cases in the explainer's motivation section (#42)
This change updates the explainer to not list Prioritized Task Scheduling as a browser-internal use case, since it can be used together with `AsyncContext` as the former API is currently defined. The browser-internal use case (transitive task prioritization) is also listed, together with it. This change also removes the browser-internal use case of limiting access to certain APIs, since it was felt to be somewhat controversial.
1 parent a9008a0 commit 0ca6ca1

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,18 @@ Use cases for this include:
2121
control. This includes timing measurements, as well as OpenTelemetry. For
2222
example, OpenTelemetry's
2323
[`ZoneContextManager`](https://open-telemetry.github.io/opentelemetry-js/classes/_opentelemetry_context_zone_peer_dep.ZoneContextManager.html)
24-
is only able to achieve this by using zone.js (see the prior art section).
24+
is only able to achieve this by using zone.js (see the prior art section
25+
below).
26+
27+
- Web APIs such as
28+
[Prioritized Task Scheduling](https://wicg.github.io/scheduling-apis) let
29+
users schedule a task in the event loop with a given priority. However, this
30+
only affects that task's priority, so users might need to propagate that
31+
priority, particularly into promise jobs and callbacks.
32+
33+
Furthermore, having a way to keep track of async control flows in the JS
34+
engine would allow these APIs to make the priority of such a task transitive,
35+
so that it would automatically be used for any tasks/jobs originating from it.
2536

2637
- There are a number of use cases for browsers to track the attribution of tasks
2738
in the event loop, even though an asynchronous callstack. They include:
@@ -37,14 +48,6 @@ Use cases for this include:
3748
requires being able to tell which task initiated a particular soft
3849
navigation.
3950

40-
- Transitive task prioritization: The
41-
[Prioritized Task Scheduling API](https://wicg.github.io/scheduling-apis/)
42-
allows setting the priority a task should have in the event loop, but that
43-
does not currently extend to task spawned from that one.
44-
45-
- Limiting access to certain APIs transitively, such as sensitive or
46-
high-entropy APIs from less-trusted scripts and any tasks they might spawn.
47-
4851
Hosts are expected to use the infrastructure in this proposal to allow tracking
4952
not only asynchronous callstacks, but other ways to schedule jobs on the event
5053
loop (such as `setTimeout`) to maximize the value of these use cases.

0 commit comments

Comments
 (0)