Repository navigation
Conversation
Runtime (React parity): - useReducer dispatch no longer eagerly bails on Object.is-equal state; a no-op action renders the component once, per ReactHooksWithNoopRenderer-test.js:3889. - Unguarded render-phase setState now throws "Too many re-renders" after 25 same-block re-renders in one drain (catchable by @try/ErrorBoundary) instead of hanging the flush. Conformance tests: - conformance/derived-state.test.ts: guarded render-phase updates (derived state from props, multi-step convergence), the new re-render cap, initial value is mount-only, same-value sets skip renders and effects, bail-then-change, updater queues observe pending state, set-then-revert, cleanup/setup closure freshness. - conformance/eager-bailout.test.ts: ReactHooks-test.internal.js edges: same-state sets skip child renders/effects/commit and bail repeatedly, context change defeats the bailout, no-op reducer actions apply in order within a batch. React's extra post-update render (double-buffering artifact) is documented as a benign divergence. - tests/_helpers.ts: a throwing initial mount detaches its container so leaked duplicate ids cannot break later #id selector queries. SSR: - renderToString(component, props?, options?) is the public entry (render kept as deprecated alias) with RenderOptions: signal (AbortSignal), nonce (CSP nonce on inline style/seed tags), timeoutMs (per-render suspense deadline). Covered in ssr-render-api.test.ts. - Fixed stale "head is empty" docstrings, marked the ssr* exports as the compiler's private ABI, fixed the vite plugin dev RPC handler referencing a nonexistent executeServerFunction export, new docs/ssr.md with the missing-features roadmap (streaming, selective hydration, production build). MCP server (0.2.0): - Skills now ship inside the npm package (bridge-react-package, migrate-react-component, react-divergences, setup-ssr) so the server works outside the monorepo checkout. - New octane_bridge_react_package tool: scans a React package or source dir for React API usage and returns an Octane compatibility report (verdict, vanilla-core detection, existing @octanejs binding, step-by-step plan); octane_bindings lists the official ports. - Maintainer tools (project map, triage, validate plan, benchmarks, issue context) register only when an octane monorepo checkout is detected. - Staleness fixes: radix binding in path triage, project map, skills, and the root README package list.
The interim executeServerFunction used JSON, but the RPC stack is built on
@ripple-ts/adapter, whose client stub encodes the argument array with
devalue and reads the response as a devalue-encoded { value } envelope.
The formats are silently incompatible (devalue's indexed-graph output is
itself valid JSON, so JSON.parse would produce wrong arguments instead of
throwing). Mirror ripple's server implementation with devalue so rich
values (Dates, Maps, undefined, cycles) round-trip and the future compiler
client stub stays compatible.
WebEferen
force-pushed
the
hooks-parity-ssr-mcp
branch
from
July 3, 2026 19:57
e68e04d to
c4c8ad2
Compare
Revert the renderToString rename from earlier in this branch: render( component, props?, options?) stays the single public name, per review decision. The RenderOptions additions (signal, nonce, timeoutMs) and the docs/ssr.md guide are unchanged apart from the name; the deprecated alias and its tests are dropped, and the hacker-news examples return to their original local `render as renderToString` import.
The vite plugin's original ssrLoadModule('octane/server') wiring was the
intended architecture (mirroring ripple/server, which exports the executor
from the framework so it runs inside the SSR module graph); the bug was
only the missing export on the octane side. Restore the plugin's original
line, implement executeServerFunction in octane/server with the devalue
wire format ripple's client stub defines, move the devalue dependency from
the plugin to octane, and pin the executor with tests including a
client-stub round-trip of Dates/Maps/Sets/undefined and a guard that the
encoding really is devalue, not plain JSON.
Collaborator
|
Mind fixing the conflicts please? |
Brings PR #6 up to date with main. All of this PR's content (module-server RPC, SSR RenderOptions, render-phase cap + useReducer parity, MCP rework) already landed on main via PR #7 (the reconciliation onto the new renderToString/ prerender SSR API), so the merged tree equals main and the branch is now conflict-free. Dropped the stale ssr-render-api.test.ts (superseded on main by ssr-render-options.test.ts, ported to the new API). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Merged
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
Three streams of work: React-parity fixes and new conformance coverage for
useState/useReducer/useEffect(including render-phase derived state and the ReactHooks eager-bailout edge cases), an SSR options/cleanup pass, and a rework of the MCP server around Octane users.Runtime fixes (React parity)
useReducerno longer eagerly bails. React only eager-bailsuseState's setter; a dispatch whose reducer returnsObject.is-equal state still renders the component once (children then bail). PerReactHooksWithNoopRenderer-test.js:3889, listed as a High gap in the parity plan. The old test that encoded the eager bail as parity is corrected.setStateduring render used to grow the queue forever and hang the flush.drainQueuenow counts per-block renders per drain and throwsToo many re-renders. Octane limits the number of renders to prevent an infinite loop.at 25 (React's cap), routed through@try/ErrorBoundarylike any render error. Guarded derived-state patterns are unaffected.New conformance coverage
conformance/derived-state.test.ts(+ fixture): derived state from props during render (converged before commit, exact body-run counts), multi-step convergence, the new re-render cap (bare and caught by@try), initial value is mount-only, same-value sets skip renders and[state]-keyed effects, NaN bail then real change, chained updaters observing pending state, set-then-revert renders once, cleanup sees the previous closure while setup sees the fresh one.conformance/eager-bailout.test.ts(+ fixture), ported fromReactHooks-test.internal.js: same-state sets do not re-render children, re-fire deps-less layout effects, or commit; bail repeatedly; a later real change still renders; a context change in the same batch defeats the bailout; no-op reducer actions apply in order when batched with real ones. One benign divergence is documented inline: React re-enters the render phase once more after the last real update (fiber double-buffering) before bailing; Octane skips that extra parent-body run. Rebase-of-skipped-updates cases are concurrent-only and N/A to the sync scheduler.tests/_helpers.ts: a throwing initial mount now detaches its container; a leaked duplicateidwas breaking jsdom's#idselector fast path for later tests in the same file.SSR
render(component, props?, options?)gains aRenderOptionsthird argument (an earlier commit on this branch renamed the entry torenderToString; that rename was reverted per review,renderstays the public name):signal(AbortSignal; rejects a suspended render when the request dies),nonce(CSP nonce stamped on the inline<style>tags and the suspense seed script, attribute-escaped),timeoutMs(per-render suspense settle deadline). Covered byssr-render-api.test.ts.headis always empty (head hoisting shipped long ago);octane/servernow documents which exports are the compiler's private ABI.executeServerFunctionviassrLoadModule('octane/server')(the intended architecture, mirroringripple/server), butoctane/servernever exported it, so anymodule servercall crashed. The executor is now implemented inoctane/serverwith the devalue wire format@ripple-ts/adapter's client stub defines (devalue-encoded argument array in, devalue-encoded{ value }envelope out), pinned byserver-rpc.test.tsincluding a guard that the encoding is devalue, not plain JSON.docs/ssr.md: full server API guide plus the honest roadmap of missing pieces (streaming, out-of-order Suspense flushing, selective hydration, framework-level data serialization, production server build, error hooks).MCP server (0.2.0)
The published package was broken outside the monorepo (it shipped only
src/but read skills from.ai/at the repo root) and everything it served was maintainer-facing. Reworked around Octane users:bridge-react-package(full porting workflow incl. thesubSlotpattern),migrate-react-component(JSX to.tsrxconversion table),react-divergences,setup-ssr.octane_bridge_react_package: statically scans an installed React package (or any source dir) and returns a compatibility report: per-API mapping (same / rewrite / unsupported), class-component detection, vanilla-core detection, whether an official@octanejs/*binding exists, a verdict, and a step-by-step plan.octane_bindingslists the eight official ports.radixin path triage/project map/skills/root README.Validation
pnpm test: full workspace green (all bindings included)pnpm typecheck,pnpm format:check: clean