Repository navigation
Port dedicated Web Workers and worker-realm polyfills - #29
Draft
matthargett wants to merge 4 commits into
Draft
matthargett wants to merge 4 commits into
matthargett wants to merge 4 commits into
Conversation
Adapt BabylonJS/JsRuntimeHost#258 (177b832) to the monorepo target names, test harness and runtime dispatch loop. Keep the worker and renderer independent and preserve the parent scheduler through shutdown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports BabylonJS/JsRuntimeHost#258 onto the monorepo Node-API v7 branch. The diff excludes the conformance and v7 layers as well as all NativeXr and renderer changes.
Adds dedicated worker realms, structured clone and ArrayBuffer transfer lists, worker lifecycle and messaging, and the Streams, Fetch/Response, Compression, Blob/File and IndexedDB functionality used by the application-derived worker fixture. Runtime dispatch preserves the upstream Apple and Linux JSC run loops. Shutdown wakes the active loop and late worker deliveries use a lifetime-safe parent scheduler.
The application-facing constructor is the browser form: new Worker(new URL(...), { type: "module" }). The embedder enables JSRUNTIMEHOST_POLYFILL_WORKER, links Worker, and initializes it with a bundle root or asset resolver before evaluating application code. Module workers must be bundled into self-contained script-compatible chunks. IndexedDB is in-memory and per realm; nested workers, transferable MessagePorts and SharedArrayBuffer are out of scope. Apple distribution builds do not use private watchdog SPI: non-yielding code cannot be forcibly interrupted there.
macOS Release validation: public JavaScriptCore (67 native tests, 351 JS cases) and QuickJS (52 native tests, 348 JS cases). Includes queued messages and teardown, the WPT-derived worker regressions, and a visualization worker fetching compressed data into IndexedDB. The full production Factotum bundle and physical devices have not been run. No application, WebXR or renderer changes are included.
Implementation and device TODOs
AGENTS.md · Qualification and PR index. Upstream-shared head; fork-only instructions are in the linked handoff.