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.
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.
…dger A separate package exploring how far "install a React package and use it as-is" can go without AI. Three thin, extensible layers: - shim: the react / react-dom / jsx-runtime a bridged package resolves to (absorbs forwardRef→refs-as-props, useDebugValue→no-op, react-dom re-home) - codemod: import-reconciliation transforms (strip the builtin hooks the compiler re-injects; re-home the rest to the shim) - detector: extensible rule registry over the MCP's REACT_API_MAP + the compiler's HOOK_NAMES; classifies bridgeable → needs-rework, emits an MCP work-list 8 graduated example "React packages" (E1 useState → E4 the wall → E7 Suspense → E8 reducer-store app). Tests bridge the unmodified React source through the Octane compiler and mount it (11 runtime/detector), plus a differential oracle asserting byte-equal DOM vs real React for 7 examples. Adds a react-compat vitest project and an esbuild devDep for the React oracle. Includes a runnable repro for a @tsrx/core parser bug found while bridging E5 (known-issues/), fixed upstream in Ripple-TS/ripple#1321.
… react-compat the default path
Two directions, one story:
- New @octanejs/react-wrapper: mount compiled Octane components inside a
real React app (react/react-dom as peers). Props forward on every React
commit through the Octane root's same-body fast path (Octane state,
effects and DOM survive React re-renders); renders flush synchronously
before paint; React children bridge into the Octane `children` hole via
a stable-identity display:contents portal slot, so React state, context
and events keep working inside Octane DOM and React → Octane → React
nesting composes. wrapOctane() turns an Octane component into a
first-class React component. StrictMode-safe teardown.
- @octanejs/react-compat is the out-of-the-box direction: the MCP bridge
tool now reports runtime-compat verdicts (works-out-of-the-box /
works-with-caveats / has-unsupported-apis), scans for legacy class
lifecycles, and its plan leads with octane({ compat: [react()] }) —
native @octanejs/* ports become the optional performance path. The
bridge-react-package skill, MCP README/tool descriptions and the
maintainer port skill are rewritten accordingly; the pre-runtime-compat
framing in docs/react-library-compat-plan.md gets a status note.
Repo docs (README, RuleSync rules, project map) position the two packages
as one bi-directional bridge. Drops react-compat's unused esbuild devDep
(leftover from the deleted differential oracle).
- examples/octane-in-react: a real React app (react-dom, StrictMode, @vitejs/plugin-react) adopting Octane incrementally through @octanejs/react-wrapper — wrapped .tsrx counter driven by a React slider (props flow, Octane state survives), a React form rendered inside an Octane card via the children bridge, and a toggled Octane clock proving effect cleanup on unmount. - examples/react-in-octane: an Octane app with no React installed running unmodified jotai (one atom shared by two islands) and react-hook-form (validation, watch, submit) through @octanejs/react-compat; islands authored as plain React .tsx via the automatic JSX runtime, crossing into .tsrx through resolveCompatType. - octane/compiler/vite accepts tsx: false so React can own .tsx while octane compiles only .tsrx — the setup both mixed-renderer examples build on. - react-wrapper split by responsibility: useOctaneRoot owns the Octane root lifecycle, useChildSlot owns the children bridge (the stable-descriptor invariant lives with it), index.ts is the public surface. Both examples are verified end-to-end in Chromium: 13 interaction assertions covering cross-renderer props, state survival, shared package state, form semantics, and teardown.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit eb48020. Configure here.
| { cause }, | ||
| ); | ||
| } | ||
| } |
There was a problem hiding this comment.
Suspense wrapper breaks fallback suspend
High Severity
The SSR Suspense facade catches every throw from OctaneSuspense and replaces it with a hard compatibility error. When a fallback itself suspends, Octane rethrows SSR_SUSPENSE so render() can await and retry; this wrapper turns that into a normal Error, so nested/fallback suspension fails the request instead of settling.
Reviewed by Cursor Bugbot for commit eb48020. Configure here.


What this is
Octane's React adoption story, in both directions, with runnable proof — rebased onto current
main(the parity fixes, SSR API, and MCP rework from the original branch already landed via the React-parity waves; this PR brings only what main lacks: the bridge itself).@octanejs/react-compatoctane({ compat: [react()] })@octanejs/react-wrapperwrapOctane(Component)The goal is adoption from both sides: an Octane app gets the React ecosystem out of the box (99%-compatibility target — no codemods, no ports), and a React app can adopt Octane one component at a time.
Direction 1 — unmodified React packages run on Octane
Package code keeps importing
react,react/jsx-runtime,react-dom; the plugin resolves those to Octane facades (separate server facades under SSR). Hooks dispatch by call order into Octane slots, class components (state, commit lifecycles,contextType, Error Boundaries) are adapted, text-inputonChangeand SyntheticEvent semantics are translated, thrown-Promise Suspense andlazyroute to Octane boundaries — andReactDOMServer.renderToString/renderToStaticMarkupnow delegate tooctane/server's React-parity renderers.Verified against the real npm builds (not ports):
react-redux,jotai,react-hook-form,react-error-boundary,tailwindcssv4 — plus a 670-line edge-case contract suite (Error Boundaries, classes, refs, portals, SSR/hydration, identity, events). What does not run fails with targeted errors instead of silently approximating React (legacy class lifecycles, streamingreact-dom/server, RSC, StrictMode double-invoke).At a
.tsrxJSX site, a React-package component crosses the boundary throughresolveCompatType(Component).Direction 2 — Octane components inside a React app
Real
react/react-domstay the host (peer deps). The wrapper mounts an Octane root into a container element and keeps the renderers glued:flushSync) from a layout effect, before the browser paints the React commit.childrenas a layout-neutraldisplay: contentshost slot; the wrapper portals the React children into it. The slot descriptor is minted once per instance — stable element identity is what keeps Octane's reconciler out of the React-owned portal content.Internals split by responsibility:
useOctaneRoot(root lifecycle),useChildSlot(children bridge + the identity invariant),index.ts(public surface).Runtime & compiler support (small, opt-in)
beginCompatHookRender/nextCompatHookSlot/finishCompatHookRender) with Rules-of-Hooks validation — zero fields added to native scopes.use()).octane({ tsx: false })(bundler core + Vite adapter): React owns.tsx, Octane compiles only.tsrx— the mixed-renderer setup both example apps build on.Runnable demos (both verified in Chromium)
playground/octane-in-react— a plain React app (StrictMode,@vitejs/plugin-react) hosting compiled.tsrx: a React slider drives an Octane counter'sstepwhile its OctaneuseStatesurvives, a React form lives inside an Octane card, a toggled Octane clock proves effect cleanup.playground/react-in-octane— an Octane app with no React installed: two React islands share onejotaiatom (the real package's store wiring keeps them in sync) and areact-hook-formsignup form runs with validation,watch()and submit — islands authored as plain React.tsx.A Playwright smoke run drives 13 cross-renderer interactions across both apps (props flow, state survival, shared package state, form semantics, teardown) — all passing.
Tooling repositioned around the new story
octane_bridge_react_packagetool now reports runtime-compat verdicts (works-out-of-the-box/works-with-caveats/has-unsupported-apis), scans for legacy class lifecycles, and its plan leads with the compat one-liner; native@octanejs/*ports become the optional performance path (via theoctaneexport condition).Validation
react-compat-native,react-compat-ssr,react-wrapper, plus the MCP verdict tests) against main's runtimebase-uidifferential timeouts,lucidedynamic-icon,threebrowser bundlers — reproduce identically on pristineorigin/main)pnpm typecheck(including the two new packages),pnpm format:check, changeset check, package inventory, and examples catalog: all cleanvite buildcleanly and pass the browser smoke run