Skip to content

Commit e2cd41b

Browse files
authored
Reorganize the repo structure (WICG#27)
The repo was getting unruly, with a mix of explainers and brainstorming documents. This patch makes the following mechanical changes: - Create explainers/ directory for explainers - Create misc/ directory for brainstorming and misc docs - Rename files to consistently use lower-case-with-dashes
1 parent 76e450d commit e2cd41b

20 files changed

+23
-24
lines changed

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ main thread work. Since long tasks and responsiveness are at odds, breaking up
3030
long tasks can help keep an app responisive when also *yielding to the browser's
3131
event loop*.
3232

33-
[Userspace schedulers](UserspaceSchedulers.md) have evolved to manage these
33+
[Userspace schedulers](./misc/userspace-schedulers.md) have evolved to manage these
3434
chunks of work—prioritizing and executing work async at an appropriate
3535
time relative to current situation of user and browser.
3636

@@ -54,7 +54,7 @@ there are several problems they still face:
5454
script. This disincentivizes yielding for script that requires low task
5555
latency.
5656

57-
We propose adding [scheduler.yield()](YieldAndContinuation.md) as a
57+
We propose adding [scheduler.yield()](./explainers/yield-and-continuation.md) as a
5858
solution.
5959

6060
3. **Coordination between (cooperating) actors**: Most userspace schedulers
@@ -71,7 +71,7 @@ there are several problems they still face:
7171
scheduling decisions to help improve user experience.
7272

7373
We propose adding a [prioritized postTask scheduling
74-
API](PrioritizedPostTask.md) to address this problem.
74+
API](./explainers/prioritized-post-task.md) to address this problem.
7575

7676
4. **A disparate set of scheduling APIs**: Despite the need to schedule chunks
7777
of script, the Platform lacks a unified API to do so. Developers can choose
@@ -82,7 +82,7 @@ there are several problems they still face:
8282
write scheduling code, and requires expert knowledge of the Browser's event
8383
loop to do so. Creating a unified native scheduling API can alleviate this.
8484

85-
This is also addressed by the [postTask API](PrioritizedPostTask.md).
85+
This is also addressed by the [postTask API](./explainers/prioritized-post-task.md).
8686

8787
## Additional Scheduling Problems
8888

@@ -91,12 +91,12 @@ space. Additionally, there are developer needs for things like detecting when
9191
a frame is pending, throttling the frame rate, and avoiding layout thrashing.
9292

9393
Some of the other APIs we're considering in this space are noted
94-
[here](LowLevelAPIs.md).
94+
[here](./misc/low-level-apis.md).
9595

9696
## Explainer Links
9797

98-
* [scheduler.yield()](YieldAndContinuation.md)
99-
* [scheduler.postTask()](PrioritizedPostTask.md)
98+
* [scheduler.yield()](./explainers/yield-and-continuation.md)
99+
* [scheduler.postTask()](./explainers/prioritized-post-task.md)
100100
* [isInputPending()](https://github.com/WICG/is-input-pending)
101101

102102
## Further Reading / Viewing
File renamed without changes.

PrioritizedPostTask.md explainers/prioritized-post-task.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Main Thread Scheduling: Prioritized postTask API
22

3-
For an overview of the larger problem space, see [Main Thread Scheduling API](README.md).
3+
For an overview of the larger problem space, see [Main Thread Scheduling API](../README.md).
44

55
## TL;DR
66

@@ -11,7 +11,7 @@ experience), but the Platform lacks a unified API to schedule prioritized work.
1111
## The Problem
1212

1313
To keep apps responsive, developers can (and should) break up long tasks into
14-
smaller chunks. [Userspace schedulers](UserspaceSchedulers.md) often manage
14+
smaller chunks. [Userspace schedulers](../misc/userspace-schedulers.md) often manage
1515
these chunks of work (tasks)—prioritizing and executing work
1616
asynchronously at an appropriate time relative to the current situation of the
1717
user and browser.
@@ -41,7 +41,7 @@ tasks of a given task source.
4141

4242
The current state of prioritization in the browser looks something like this:
4343

44-
![Current Web Priorities](images/web_priorities_current.png)
44+
![Current Web Priorities](../images/web-priorities-current.png)
4545

4646
The first two—*microtask* and *don't yield*—are generally
4747
antithetical to scheduling and the goal of improving responsiveness. They are
@@ -101,7 +101,7 @@ covered by this minimal set of priorities. We also understand that apps may have
101101
finer-grained app-specific priorities, and are considering additional APIs to
102102
support these (see FAQ below).
103103

104-
![New Web Scheduling Priorities](images/web_priorities_proposed.png)
104+
![New Web Scheduling Priorities](../images/web-priorities-proposed.png)
105105

106106
1. **user-blocking**: User-blocking tasks are tasks that block a user from
107107
interacting with and using the app. This could be (chunked) work that is
@@ -384,7 +384,7 @@ scheduler.postTask(() => { console.log('B'); });
384384
The API shape described above is the current MVP. The following are
385385
extensions of the base API that are in various degrees of exploration:
386386

387-
1. [**Propagating and Inheriting Priority**](PostTaskPropagation.md): A
387+
1. [**Propagating and Inheriting Priority**](post-task-propagation.md): A
388388
frequent request we see from developers is the desire to inherit or
389389
propagate the currently running task's priority.
390390

@@ -452,15 +452,15 @@ lightweight solution and will publish an explainer soon.
452452
Priority inversions occur whenever higher priority work depends on lower
453453
priority work, so simply by introducing priorities introduces this risk. There
454454
is only so much the API can do to prevent these situations, although [inheriting
455-
priority](PostTaskPropagation.md) can help to some degree.
455+
priority](post-task-propagation.md) can help to some degree.
456456

457457

458458
This is something that developers should be aware of whenever using
459459
priorities, and should guard against in situations where a resource is shared
460460
and can be accessed by multiple, different priority tasks.
461461

462462
Some of the situations where this can occur are explored
463-
[here](PriorityInversion.md), as well as potential solutions. It is not clear
463+
[here](../misc/priority-inversion.md), as well as potential solutions. It is not clear
464464
at this point that a native solution beyond `TaskController` is needed, and we
465465
await further developer feedback from Origin Trial.
466466

@@ -503,11 +503,11 @@ concurrent mode).
503503
The proposal orignally included the ability to pass arguments to the callback,
504504
like in `setTimeout`, but was removed because modern JS supports arrow functions,
505505
which obviates the need to pass them through `postTask`
506-
(see [this issue](https://github.com/WICG/main-thread-scheduling/issues/18)).
506+
(see [this issue](https://github.com/WICG/scheduling-apis/issues/18)).
507507

508508
## Security Considerations
509509

510-
**Note**: This section summarizes [this much longer exploration](PostTaskSecurity.md).
510+
**Note**: This section summarizes [this much longer exploration](../misc/post-task-security.md).
511511

512512
The main security concern is whether or not the API adds new surfaces to
513513
perform side-channel attacks, specifically for same-process cross-origin

YieldAndContinuation.md explainers/yield-and-continuation.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Main Thread Scheduling: Yield and Continuation
22

3-
For an overview of the larger problem space, see [Main Thread Scheduling API](README.md).
3+
For an overview of the larger problem space, see [Main Thread Scheduling API](../README.md).
44

55
## The Problem
66

@@ -31,7 +31,7 @@ yielding.
3131

3232
Visually, the overhead might look something like this:
3333

34-
![Yield Overhead](images/yield_overhead.png)
34+
![Yield Overhead](../images/yield-overhead.png)
3535

3636
This overhead can **disincentivize script from yielding**, which can lead to
3737
unresponsiveness in apps.
@@ -71,7 +71,7 @@ async function doWork() {
7171
```
7272
7373
There is an optional `priority` argument that works with the [prioritized
74-
postTask API](PrioritizedPostTask.md). If this argument is provided, the
74+
postTask API](prioritized-post-task.md). If this argument is provided, the
7575
Promise is resolved after tasks of the given priority and higher run.
7676
```javascript
7777
let continuation = scheduler.yield('high');
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

APIOptions.md misc/api-options.md

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

OriginTrialStatus.md origin-trial-status.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ testing this API in the wild (you can register [here](https://developers.chrome.
66

77
This page tracks the current status of what parts of the APIs are implemented
88
as part of the trial. Please read the
9-
[explainer](https://github.com/WICG/main-thread-scheduling/blob/master/PrioritizedPostTask.md)
9+
[explainer](./explainers/prioritized-post-task.md)
1010
to understand how to take advantage of these APIs.
1111

1212
In addition to participating via the origin trial, these APIs are available on
@@ -35,8 +35,7 @@ The minimum supported Chrome version for `onprioritychange` and `currentTaskSign
3535

3636
2. `TaskController` and `TaskSignal` have been implemented.
3737

38-
3. [Priority
39-
inheritance](https://github.com/WICG/main-thread-scheduling/blob/master/PostTaskPropagation.md)
38+
3. [Priority inheritance](./explainers/post-task-propagation.md)
4039
has been implemented and exposed through `scheduler.currentTaskSignal`.
4140

4241
4. An `onprioritychange` event has been added to `TaskSignal`.
@@ -45,7 +44,7 @@ The minimum supported Chrome version for `onprioritychange` and `currentTaskSign
4544

4645
Sample code can be found [here](sample-code/), which covers the currently
4746
implemented features. Please see the
48-
[explainer](https://github.com/WICG/main-thread-scheduling/blob/master/PrioritizedPostTask.md)
47+
[explainer](./explainers/prioritized-post-task.md)
4948
for more context.
5049

5150
TODO(shaseley): add examples for `scheduler.currentTaskSignal` and `onprioritychange`.

sample-code/posttask-with-delay.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ <h3>postTask Example: Delayed Tasks</h3>
1717
// The API takes an optional argument for 'delay', which is essentially makes
1818
// postTask act like a prioritized version of setTimeout. The semantics are
1919
// described in the explainer:
20-
// https://github.com/WICG/main-thread-scheduling/blob/master/PrioritizedPostTask.md#posting-delayed-tasks
20+
// https://github.com/WICG/scheduling-apis/blob/master/explainer/prioritized-post-task.md#posting-delayed-tasks
2121
results.push(scheduler.postTask(() => 'hello!', {delay: 1000}));
2222
results.push(scheduler.postTask(() => 'scheduled'));
2323
results.push(scheduler.postTask(() => 'world,'));

0 commit comments

Comments
 (0)