docs: add structured clone and transferable API reference#3101
Open
bartlomieju wants to merge 2 commits into
Open
docs: add structured clone and transferable API reference#3101bartlomieju wants to merge 2 commits into
bartlomieju wants to merge 2 commits into
Conversation
Document which Web API types support structuredClone()/postMessage() serialization and which support transfer, following the addition of Blob and File structured clone support in denoland/deno#33827.
lunadogbot
requested changes
May 14, 2026
Contributor
lunadogbot
left a comment
There was a problem hiding this comment.
Two blockers:
-
deno fmt --checkfails on both new tables — column alignment. Runningdeno fmt api/web/index.md runtime/reference/web_platform_apis.mdfixes it. -
The "Clone a Blob" sample doesn't run on current stable. denoland/deno#33827 merged 2026-05-07, but the most recent release is 2.7.14 (2026-04-28), so on stable
structuredClone(new Blob([...]))returns{}and the example throwsTypeError: cloned.text is not a function. Same for theFilerow. Either gate this on the next release (note "Requires Deno 2.8+" near Blob/File) or hold the PR until 2.8 ships.
- nit:
runtime/reference/web_platform_apis.mdhaslast_modified: 2025-05-09— bump it on substantive additions. - nit: the transfer example uses a
workersymbol that isn't defined in the snippet.const ch = new MessageChannel(); ch.port1.postMessage(buffer, [buffer]);is self-contained and demonstrates the same point.
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.
Summary
structuredClone()/postMessage()) and which are transferableapi/web/index.md) and the runtime reference page (runtime/reference/web_platform_apis.md)Serializable types documented
Primitives, Array, Object, Map, Set, Date, RegExp, ArrayBuffer, TypedArray, DataView, Error types, Blob, File, DOMException, CryptoKey
Transferable types documented
ArrayBuffer, MessagePort, ReadableStream, WritableStream, TransformStream
Test plan