feat: JSWorker for all runtimes (not just V8) + Node transfers#211
Merged
Benjamin-Dobell merged 2 commits intogodotjs:mainfrom Apr 20, 2026
Merged
Conversation
147aa88 to
1f916e5
Compare
325cd1e to
30b4853
Compare
JSC and QuickJS now implement the V8 Serializer API in order to handle serialization of standard JS types intermingled with Godot variants. On the web things are a bit more complex. We try take advantage of the web's built-in postMessage functionality as much as possible. The browser's postMessage handles structured clone for us i.e. will serialize plain old data, as well as more advanced types like Set, Map etc. However, it can't handle Godot types. So before calling postMessage we descend through the message data structure and replace Godot objects with markers which are delivered via the transfer list (WASM side channel). If a message contains no Godot objects then process is particularly performant because neither the sender or the receiver need to cross the WASM bridge at all when sending/receiving the message. QuickJS-NG has been updated to the latest version. Also, implemented a test matrix for each of our runtimes: - V8 - QuickJS (NG) - JavaScriptCore - Web - QuickJS WASM on Web
40ff6e6 to
7f73626
Compare
Also: - Cleaned up "jsb.editor.codegen" APIs slightly. - Web build fixes. in particular addresses closure compiler (release) web build issues.
7f73626 to
f02ae77
Compare
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.
JSC and QuickJS now implement the V8 Serializer API in order to handle serialization of standard JS types intermingled with Godot variants.
On the web things are a bit more complex. We try take advantage of the web's built-in postMessage functionality as much as possible. The browser's postMessage handles structured clone for us i.e. will serialize plain old data, as well as more advanced types like Set, Map etc. However, it can't handle Godot types. So before calling postMessage we descend through the message data structure and replace Godot objects with markers which are delivered via the transfer list (WASM side channel). If a message contains no Godot objects then process is particularly performant because neither the sender or the receiver need to cross the WASM bridge at all when sending/receiving the message.
QuickJS-NG has been updated to the latest version.
Implemented a test matrix for each of our runtimes:
Godot/GodotJS executable can now be executed with
--headless --editor --generate-typesand it will populatetypings/andgen/directories with engine and project types. Projects may now optionally omit these directories from their Git repos and then perform a bootstrap process:tsc --noCheck) to generate.godotjs/with JavaScript.--headless --editor --generate-typesThe project will these be ready to build as per usual with full type checking. The GodotJS test project now takes this approach during CI as it makes it easier to run the test project against different Godot engine versions (which have different APIs and therefore different types).