Skip to content

refactor: share wire protocol literals across runtimes - #1169

Merged
domgan-oai merged 8 commits into
octanejs:mainfrom
openai-oss-forks:codex/repair-pr1136-fork-20260920
Sep 20, 2026
Merged

domgan-oai merged 8 commits into
octanejs:mainfrom
openai-oss-forks:codex/repair-pr1136-fork-20260920

Conversation

@domgan-oai

@domgan-oai domgan-oai commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Share hydration attributes, marker formats, runtime registry tags, useId spelling, and element-scoped ViewTransition CSS between their client, server, and pre-root capture consumers. Public wire values and exports remain compatible.

This carries @WebEferen's original work from #1136, preserving its commits, through a branch in openai-oss-forks/octane. The repair incorporates current upstream main and includes both initial and resumed independent-island attribute lookups. The landed primitive-local compiler, streamed-signal cancellation, and pending-lazy hydration fixes are preserved.

Validation

  • Feedback regression: the strengthened source-ownership guard fails on the actual previously published constructor source, and passes after the shared-marker fix.
  • Development/production protocol checks, 36 tests; focused client construction, structural updates, keyed identity, native edits, SSR adoption and recovery controls, 20 tests (290 unrelated tests excluded by the case filter).
  • Scoped formatting and TypeScript checks for both feedback paths.
  • Three unchanged production root/hooks/context bundle budgets and semantic snapshots; feedback repair adds zero raw/gzip/Brotli bytes relative to the prior published head. Relative to upstream main, the largest original refactor delta remains context: +22 raw / +18 gzip / +62 Brotli bytes.
  • The exact previously failing stock WebKit case passes on both upstream 1e7188e and this candidate in matched fresh processes (1 passed / 18 filtered cases per tree). Both used Node 24.13.0, macOS 26.7 arm64, Playwright 1.61.1 and WebKit 26.5 revision 2311, with unchanged 30-second locator / 60-second case deadlines. CI runs Linux x64; the initial cached-SSR timeout at the prior published head remains unlocalized. The new-head remote package-build lane subsequently passed all of its integration cases; the earlier timeout remains unlocalized.
  • Final canonical pnpm sync; source/index preservation review and zero generated drift.
  • Current-head remote CI: all 26 jobs passed in run 35506570827 at 13e34bf45033159d855f86924d92fc003257ae1d; Cursor Bugbot passed and the feedback thread is resolved.

The initial refactor at 8cce777 passed 405 protocol/island/streaming/event/signal controls, 262 workflow controls, formatting for its 18 paths and scoped types for 17 paths. The feedback repair extends scope to the presentation-binding constructor and strengthens an existing regression; those broader unchanged checks were not repeated locally. Repository-wide format/type/test and packed-consumer validation remain remote CI scope. Production commits retain the configured signer and hooks; only temporary workflow Git fixtures disabled signing. Bundle and JSDOM checks do not establish CPU performance or physical-device qualification.

Provenance

  • An agent produced this diff (agent-authored)

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Note

Medium Risk
Touches hydration markers, binding comments, useId, and Symbol.for identity across client/SSR boundaries; behavior is intended to be byte-identical, with a small runtime fix for missing presentation view ids.

Overview
Consolidates hydration wire literals that were duplicated across client, SSR, and pre-root capture into a small set of leaf modules, with octane/constants still re-exporting the same public names.

hydration-markers.ts now owns block/@for comment payloads, deferred-boundary data-octane-hydrate-* attributes, the boundary selector, and shared formatUseId. dom-binding-protocol.ts derives presentation-binding comment prefixes and adds bindingRootMarker / isForBindingOpenComment so binding stamps are not re-typed inline. css.ts owns element-scoped <ViewTransition> stylesheet id/CSS. New runtime-tags.ts is the single owner of cross-realm Symbol.for keys (element, portal, Fragment, context, lazy, etc.).

Client runtime, runtime.server, DOM binding program, stream protocol, React compat, universal core, and hydration capture modules import these owners instead of local copies. Presentation view adoption fails fast when a view id is missing rather than comparing against a bogus [b;undefined;root marker.

Adds wire-protocol-single-owner.test.ts, which scans src (excluding verbatim compiler JS) to ensure each protocol string/symbol key is spelled in only one module.

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

WebEferen and others added 7 commits September 18, 2026 23:27
The @for arm markers, presentation-binding comment prefixes,
deferred-boundary attribute names, useId spelling, element-scoped
ViewTransition stylesheet, and the cross-realm Symbol.for tags were each
re-typed in two to five modules. A change on one side of a hydration
boundary could diverge from the other with no test noticing.

Give each one an owning module: hydration-markers.js for the payloads,
attributes and useId (it stays off the dom-tables.js graph so the pre-root
capture bundle can share them), dom-binding-protocol.js for the binding
marker producer next to its parser, css.js for the ViewTransition
stylesheet, and a new runtime-tags.js for the registry keys.
octane/constants re-exports the same names and values.

Payloads stay plain literals: a bundler does not constant-fold a
cross-module template literal, and a derived spelling measured roughly
twice the bundle cost on the pre-root capture entry.

Adopting a presentation view whose range carries no view id is now
rejected outright instead of compared against "[b;undefined;root".
@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent refactor PR: internal restructuring, no behavior change labels Sep 20, 2026
@domgan-oai
domgan-oai marked this pull request as ready for review September 20, 2026 10:35

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit 8cce777. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent refactor PR: internal restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants