Skip to content

Fix permanent-static and streamed deferred hydration - #229

Merged
trueadm merged 2 commits into
mainfrom
codex/issue-228-tests
Jul 22, 2026
Merged

trueadm merged 2 commits into
mainfrom
codex/issue-228-tests

Conversation

@trueadm

@trueadm trueadm commented Jul 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • compile the exact direct-import <Hydrate split={false} when={never()}> form into a wrapper-free server-owned range, reserve IDs without client evaluation, and prune only private module-scope descendants proven exclusive to it
  • make deferred activation wait for authenticated renderer-owned streamed Suspense reveals, preserving replay targets across swaps while respecting nested Hydrate/static ownership
  • retain static fallbacks on late stream rejection or abort, omit unconsumable static seeds, and reject forged protocol lookalikes
  • document the contract and add a patch changeset plus dev/prod compiler, SSR, hydration, bundle, type, collision, and failure regressions

Addresses #228.

Scope note

Existing externally patched descendants remain preserved across hydration and surrounding updates while Octane's private ownership markers remain intact. This PR does not invent a public behavior-adoption, conflict, or disposal API; that remains separate API design work.

Validation

  • pnpm test — 1,280 files / 12,348 tests passed
  • pnpm typecheck
  • pnpm format:check
  • focused dev/prod deferred-hydration matrix — 20 files / 312 tests passed

Performance and conservatism

The common activation path uses a native selector rejection before ownership-aware scanning, and stream tokens are emitted only for Hydrate ranges containing pending renderer work. Static declaration pruning deliberately retains exported, shared, coupled, unsupported runtime-TypeScript, and direct-eval shapes.


Note

High Risk
Touches hydration compiler graph pruning, SSR streaming error paths, and client activation/replay—areas where subtle ordering bugs affect DOM adoption and interactivity.

Overview
Adds the permanent-static contract for the exact <Hydrate split={false} when={never()}> form: the client compiler erases that subtree, prunes private module-scope declarations/imports used only there, and rewrites the tag to Hydrate.__octanePermanentStatic with children={null} while retaining owning scoped <style> for hash parity. SSR renders wrapper-free content bounded by <!--octane-static-hydrate:…--> markers (with optional stream tokens); the client reserves useId slots without evaluating or reconciling those nodes, and client-only mounts render no static children.

Streaming SSR marks boundaries under permanent-static depth as serverOwnedStatic (no per-boundary client seeds, sync errors reach authored catches). Pending stream failures use $OCTRX(id,1) to drop the sentinel and keep the flushed fallback instead of client recovery.

Deferred activation no longer races renderer-owned Suspense: dormant boundaries with a stream token wait via MutationObserver until owned template[data-oct-b] reveals complete or degrade; nested dormant Hydrate and permanent-static ranges do not block ancestors. Event paths and interaction replay skip stream sentinels and prefer the original event target when it still lives in the tree.

Introduces dependency-free stream-protocol.ts for shared stream/Hydrate token helpers (including pre-root capture), documents the new behavior, and expands compiler, hydration, streaming, bundle, and collision tests.

Reviewed by Cursor Bugbot for commit ba0fa99. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
octane-website Ready Ready Preview, Comment Jul 22, 2026 2:37am
octane-website-mcp Ready Ready Preview, Comment Jul 22, 2026 2:37am

Request Review

@vercel
vercel Bot temporarily deployed to Preview – octane-website July 22, 2026 00:43 Inactive
@trueadm
trueadm marked this pull request as ready for review July 22, 2026 00:48
@trueadm trueadm changed the title Add regressions for issue #228 deferred hydration gaps Fix permanent-static and streamed deferred hydration Jul 22, 2026
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 22, 2026 02:36 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 22, 2026 02:37 Inactive
@trueadm
trueadm merged commit c36608c into main Jul 22, 2026
22 checks passed
@trueadm
trueadm deleted the codex/issue-228-tests branch July 22, 2026 09:12
mrdiyorbek-juraev added a commit to mrdiyorbek-juraev/octane that referenced this pull request Jul 22, 2026
Brings in 12 upstream commits, including the shared TSRX semantic analysis
across client/server/universal/Volar compilation (octanejs#230), the deferred
hydration fix (octanejs#229), Lynx Milestone 7 worklets (octanejs#227), template-free
production hydration (octanejs#218), and the dependency/TSRX toolchain refresh
(octanejs#223) with the release that followed it.

Two conflicts, both in generated files, resolved by taking upstream and
regenerating from the merged tree:

- docs/packages.md — 47 publishable packages upstream, 48 here. Verified
  as a strict superset: every package upstream lists is still present,
  and the only additions are `@octanejs/cmdk` and `packages/cmdk`.
- packages/octane-evals/.../manifest.jsonl — all 19 task ids match
  upstream, and a field-level comparison shows only
  environment.overlayLockfileHash and grader.graderDigest differ. No
  prompt, policy, reference or grader command changed, so task semantics
  are untouched; both fields derive from the lockfile, which necessarily
  moved.

pnpm install also rewrote pnpm-workspace.yaml as a side effect — it
flattened upstream's `*esrap_common` YAML anchor and appended
[email protected] to minimumReleaseAgeExclude. Both are reverted, so the file
differs from upstream by exactly one line: the `cmdk: 1.1.1` catalog pin
this package needs.

packages/cmdk is unchanged apart from one comparator re-wrapped by the
refreshed prettier; the whitespace-only diff is the entire delta.

Verified: 43/43 cmdk and cmdk-ssr against the new compiler, 48/48 evals
(including the corpus freshness gate), tsrx-tsc, tsgo, prettier, and all
five generated-artifact gates current.

This branch was previously deployed

2 inactive deployments
Preview – octane-website — ba0fa994 Deployed Jul 22, 2026 by vercel[bot]
Preview – octane-website-mcp — ba0fa994 Deployed Jul 22, 2026 by vercel[bot]
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