Skip to content

Share browser hibernation host helpers - #39

Merged
MiguelsPizza merged 1 commit into
mainfrom
alex/browser-hibernation-host-helpers
Aug 29, 2026
Merged

Share browser hibernation host helpers#39
MiguelsPizza merged 1 commit into
mainfrom
alex/browser-hibernation-host-helpers

Conversation

@MiguelsPizza

Copy link
Copy Markdown
Contributor

Why

Rook hibernation integration #146 proved that two pieces of the reference embedder were being copied into downstream hosts: the in-memory hibernation mirror and the browser Request/Response upgrade accommodation. Those copies contain lifecycle-sensitive behavior, so the package should own and test them once.

This follows the hibernatable WebSocket runtime added in do-runtime #37 and matches Cloudflare documentation that acceptWebSocket() keeps clients connected while the Durable Object is evicted and reconstructed: https://developers.cloudflare.com/durable-objects/best-practices/websockets/

What changed

  • export HibernationMirror from the package root, including copied metadata snapshots and rehydration seeding
  • add @mcp-b/do-runtime/browser for the clone-safe Request marker and status-101 Response socket
  • switch the Node/browser conformance hosts and extension example to those published APIs
  • delete the two example-only shim copies
  • add a patch changeset so Rook can consume this without a local link or vendor patch

Verification

  • unit: 852/852
  • conformance: workerd 69/69, Node 69/69, browser 77/77
  • typecheck: package, conformance, and all example projects
  • package: publint, Are the Types Wrong, and 69-file smoke test
  • extension and vibe-platform E2Es: green
  • workerd oracle pin: green

Downstream

Once the Changesets release publishes, Rook can delete its local WorkerHibernationMirror and browser upgrade shim and import these owners directly.

Promote the reference HibernationMirror and browser WebSocket upgrade globals into the package API so extension hosts do not copy lifecycle-sensitive shims. The examples and conformance lanes now consume the same exports downstream embedders will use, which makes their passing coverage validate the published path.
@MiguelsPizza
MiguelsPizza merged commit a470698 into main Aug 29, 2026
1 check passed
@MiguelsPizza
MiguelsPizza deleted the alex/browser-hibernation-host-helpers branch August 29, 2026 00:16
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.

1 participant