Skip to content

Run install() downloads in parallel instead of blocking the main thread. - #200

Open
padenot wants to merge 2 commits into
mainfrom
install-async
Open

Run install() downloads in parallel instead of blocking the main thread.#200
padenot wants to merge 2 commits into
mainfrom
install-async

Conversation

@padenot

@padenot padenot commented Aug 6, 2026

Copy link
Copy Markdown
Member

Step 6 queued a task on the relevant global object's task queue that then waited for the language pack downloads to complete, which stalls script on the main thread. Move the download initiation and the wait into an [=in parallel=] block, and queue a task only to resolve the promise.

Fixes #199


Preview | Diff

padenot added 2 commits August 6, 2026 16:12
Step 6 queued a task on the relevant global object's task queue that then
waited for the language pack downloads to complete, which stalls script on
the main thread. Move the download initiation and the wait into an
[=in parallel=] block, and queue a task only to resolve the promise.

Fixes #199
The prose already states the promise resolves to false if options.langs is
empty, but no step implemented it: an empty sequence vacuously passes the
unsupported-language check and then trivially succeeds with no downloads,
resolving to true. Add an explicit step, matching how the availability
algorithm treats an empty sequence as unavailable.
@padenot

padenot commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

Added another commit that fixes a mistake in the prose, but it was clear what to do.

@padenot
padenot requested a review from evanbliu August 6, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

install() algorithm blocks main thread

2 participants