Fix a race condition that sometimes caused apps to skip their first paint after launch

This commit is contained in:
James Babcock committed 2026-08-30 15:35:19 -07:00
1 parent ccd28b7ac9
commit 7ebf921299
9 files changed
+74

No files matched your search

+6
View File
@@ -118,6 +118,12 @@ function post(message: WorkerAppReply): void {
global.postMessage(message);
}
// The host queues messages until this arrives: posts to a worker whose bundle
// is still evaluating can be silently dropped (see WorkerAppHost). Top-level
// evaluation is synchronous, so the handler below is installed before any
// queued message can be delivered.
post({ type: "worker-ready" });
global.onmessage = (event: { data: WorkerAppMessage }) => {
const message = event.data;
switch (message.type) {