Skip to content

docs: when-to-use guide for webjs-frame + webjs-stream (Turbo lineage)#479

Merged
vivek7405 merged 2 commits into
mainfrom
docs/region-primitives-guide
Jun 12, 2026
Merged

docs: when-to-use guide for webjs-frame + webjs-stream (Turbo lineage)#479
vivek7405 merged 2 commits into
mainfrom
docs/region-primitives-guide

Conversation

@vivek7405

Copy link
Copy Markdown
Collaborator

Region-primitives when-to-use guide (originally #476, reopened against main after the #470 base branch was merged + deleted).

A single "which one when" guide for the four data / region primitives (async render(), <webjs-suspense>, <webjs-frame>, <webjs-stream>), plus the Turbo lineage so agents can transfer Hotwire muscle memory.

  • <webjs-frame>: a server-rendered, URL-addressable sub-region that loads / reloads INDEPENDENTLY of a full-page navigation and ships zero component JS (self-refreshing widgets, below-the-fold lazy regions, URL-addressable panels). Truly inspired by Turbo Frames.
  • <webjs-frame> + <webjs-suspense>: a deferred frame whose route is itself slow wraps that data in <webjs-suspense>, so the frame defers the load and the slow data streams in behind a fallback inside the frame. Caveat documented: a streamed framed route skips the frame's byte-saving subtree extraction.
  • <webjs-stream>: the only SURGICAL element-level update primitive (append / prepend / before / after / replace / update / remove) AND the live-channel applier (connectWS / broadcast to renderStream). Truly inspired by Turbo Streams.

Surfaces updated: the data-fetching doc page (decision boundary + the frame/stream sections), the client-router doc page, agent-docs/advanced.md, and the scaffold AGENTS.md. Docs only, no code changes. Fresh-context reviewed; fixed a dead data-fetching.md cross-reference found in review.

t added 2 commits June 12, 2026 11:23
Document the two region primitives that solve cases a page/layout cannot,
and surface their Hotwire lineage so AI agents transfer Turbo muscle
memory. The data-fetching guide gets a deferred/self-refreshing
<webjs-frame> section (with the <webjs-suspense> composition + the
streamed-frame byte caveat), a surgical-update <webjs-stream> section,
and the four-way decision boundary (async render vs webjs-suspense vs
webjs-frame vs webjs-stream). <webjs-frame> is noted as webjs's take on
Turbo Frames and <webjs-stream> on Turbo Streams across the data-fetching
guide, the client-router doc page, agent-docs/advanced.md, and the
scaffold AGENTS.md.

Closes #475.
The webjs-frame section pointed at a nonexistent agent-docs/data-fetching.md;
the decision-boundary content lives in the docs-site page. Point at it.
@vivek7405 vivek7405 merged commit 35014c3 into main Jun 12, 2026
7 checks passed
@vivek7405 vivek7405 deleted the docs/region-primitives-guide branch June 12, 2026 05:54
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