Skip to content

feat: add React Spring web binding - #424

Closed
jonkwheeler wants to merge 59 commits into
octanejs:mainfrom
jonkwheeler:feat/react-spring-binding
Closed

jonkwheeler wants to merge 59 commits into
octanejs:mainfrom
jonkwheeler:feat/react-spring-binding

Conversation

@jonkwheeler

@jonkwheeler jonkwheeler commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Octane applications can now use the React Spring 10.1.2 web animation surface without React, including imperative springs, controller-backed hooks, animated DOM hosts, keyed transitions, browser utilities, and Parallax.

The port keeps @react-spring/rafz as the scheduling dependency and replaces React integration at the binding boundary with Octane state, effects, refs-as-props, and direct coherent host writes. The published surface includes @octanejs/react-spring and @octanejs/react-spring/parallax; the renderer-agnostic upstream meta-package remains intentionally out of scope.

The migration is grounded in a byte-verified upstream snapshot and an explicit export/test disposition. Browser, SSR, hydration, type, packed-consumer, and playground coverage exercise the shipped package rather than only its source modules.

Plan: docs/plans/2026-07-30-001-feat-react-spring-binding-plan.md

Design decisions

  • Preserve upstream spring/controller lifecycle semantics while keeping the runtime React-free.
  • Hand-forward Octane hook slots only in binding source; package tests remain auto-slotted.
  • Apply animated values directly to DOM properties, attributes, styles, transforms, scroll positions, and refs through one scheduled host update.
  • Ship Parallax as a separate public subpath with SSR/hydration-safe markup and resize/scroll cleanup.
  • Pin and verify the upstream source/test inventory so future parity work cannot silently drift.

Validation

  • React Spring typecheck and public API typetests pass.
  • 55 focused conformance, SSR, and hydration tests pass.
  • Real Chromium coverage passes against playground development and production builds, including interruption, transitions, reduced motion, Parallax, and route-away cleanup.
  • The packed-package consumer validates both root and Parallax imports and their declarations.
  • The 167-file upstream snapshot and all 26 upstream test dispositions verify exactly.
  • Repository formatting, typecheck, generated metadata, package inventory, changeset, and pack-canary gates pass.

Post-Deploy Monitoring & Validation

  • For the first seven days, binding maintainers should watch consumer reports and console logs for @octanejs/react-spring errors, hydration mismatches, stalled animations, observer cleanup errors, or unexpected RAF work after unmount.
  • Healthy behavior means package installation/builds succeed, SSR hydrates without replacement warnings, animations settle or cancel correctly, and route changes leave no listeners, observers, or frame callbacks behind.
  • Treat hydration replacement, springs that never resolve, persistent RAF activity after teardown, or packed-install failures as rollback signals. Revert the release or issue a corrective patch before expanding usage.

Note

Medium Risk
New animation binding with frame loops, observers, SSR/hydration, and teardown paths; regressions could show as stuck RAF, listener leaks, or hydration mismatches, though coverage is extensive.

Overview
Introduces @octanejs/react-spring (0.0.1), a React-free port of @react-spring/[email protected] at the package root and Parallax at ./parallax. The binding keeps @react-spring/rafz and reimplements controllers, hooks, animated hosts, transitions, browser observers, SSR/hydration, and scroll Parallax on Octane primitives (refs-as-props, direct host writes, no React runtime).

Tooling and discovery: CI installs Playwright Chromium for browser parity lanes; generated inventories, docs/bindings-status.md, CLI/MCP mappings (@react-spring/web / @react-spring/parallax → @octanejs/react-spring), playground demo, packed-consumer checks, and a patch changeset register the 57th binding. The all-renderer react-spring meta-package stays unmapped by design.

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

@vercel

vercel Bot commented Jul 30, 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 Aug 2, 2026 10:18am
octane-website-mcp Ready Ready Preview Aug 2, 2026 10:18am

Request Review

@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 30, 2026 16:44 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 30, 2026 16:45 Inactive
Comment thread packages/react-spring/src/hooks.ts Resolved
Comment thread packages/react-spring/src/hooks.ts Resolved
Comment thread packages/react-spring/src/engine.ts Resolved
Comment thread packages/react-spring/src/hooks.ts Resolved
Comment thread packages/react-spring/src/index.ts Resolved
Comment thread packages/react-spring/src/index.ts Resolved
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 30, 2026 19:37 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 30, 2026 19:37 Inactive
Comment thread packages/react-spring/src/browser.ts Resolved
Comment thread packages/react-spring/src/engine.ts Resolved
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 30, 2026 19:45 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 30, 2026 19:46 Inactive
…ding

# Conflicts:
#	docs/binding-parity-gaps.md
#	docs/bindings-status.md
#	packages/cli/src/data/octane-data.json
#	packages/octane-evals/datasets/train/user-apps-v1/manifest.jsonl
#	playground/octane/package.json
#	playground/octane/src/catalog.ts
#	pnpm-lock.yaml
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 30, 2026 20:53 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 30, 2026 20:54 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 30, 2026 20:56 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 30, 2026 20:57 Inactive
Comment thread packages/react-spring/src/engine.ts Resolved
Comment thread packages/react-spring/src/browser.ts Resolved
…ding

# Conflicts:
#	packages/octane-evals/datasets/train/user-apps-v1/manifest.jsonl
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 30, 2026 21:03 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 30, 2026 21:03 Inactive
Comment thread packages/react-spring/src/hooks.ts Resolved
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 30, 2026 21:06 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 30, 2026 21:07 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 30, 2026 21:08 Inactive
@jonkwheeler

Copy link
Copy Markdown
Contributor Author

READY FOR REVIEW

Comment thread vitest.config.js Resolved
Comment thread vitest.config.js Resolved
Admit the vendored upstream suite as present: run a pristine browser Vitest
lane, map every runtime identity in case-level dispositions, land one-for-one
adapted upstream cases under tests/upstream, execute pristine type programs,
and keep repo-authored conformance/browser out of react-parity ownership.
Also fix AnimationConfig frequency sanitization, number-less string
interpolation, and reserved-prop handling that the adapted helpers exposed.

Co-authored-by: Cursor <[email protected]>
Port PickAnimated/ForwardProps/ReservedProps and hook/component inference so
the present-suite adapted type lane typechecks one-for-one against the pin.

Co-authored-by: Cursor <[email protected]>
jonkwheeler and others added 2 commits August 9, 2026 02:05
…tanejs#424)

Generate one-for-one upstream/adapted type inventories referenced by
type-parity.json, verify them in the upstream check, and fix the pristine
runtime regenerator main-module guard so `node path/to/script.mjs` writes.

Co-authored-by: Cursor <[email protected]>
…ctanejs#424)

Start constructor props like upstream, and implement the interpolate range
shortcut overload that the public Interpolator type already advertised.

Co-authored-by: Cursor <[email protected]>
)

Only constructor props (or from+props) call start. A bare `new SpringValue(0)`
must not set hasAnimated, or later from updates are ignored without reset.

Co-authored-by: Cursor <[email protected]>
@jonkwheeler

Copy link
Copy Markdown
Contributor Author

READY FOR REVIEW

…nejs#424)

Positional from wins over props.from. Constructor/event-only props no longer
call start or set hasAnimated, so later from updates still apply.

Co-authored-by: Cursor <[email protected]>
@jonkwheeler

Copy link
Copy Markdown
Contributor Author

REVIEW WITHDRAWN

@jonkwheeler

Copy link
Copy Markdown
Contributor Author

READY FOR REVIEW

"id": "runtime:6cdf6a4cc127c1d9",
"upstreamFile": "packages/animated/src/createHost.test.ts",
"upstreamFullName": "createHost caches the animated wrapper on the component itself",
"disposition": "awaiting-adaptation",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This still does not provide the one-for-one adapted full suite claimed by the manifest: the pristine inventory contains 273 identities, the adapted inventory contains 10, and the remaining 263 entries are accepted as awaiting-adaptation. A pending-work marker is not an executable disposition or parity oracle. Adapt every applicable identity (or give a concrete inapplicable React/Octane rationale), and make the crosswalk reject unresolved awaiting-adaptation entries before calling this lane required/full-suite evidence.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Adapt every applicable identity (or give a concrete inapplicable React/Octane rationale), and make the crosswalk reject unresolved awaiting-adaptation entries before calling this lane required/full-suite evidence.

Needs human product call — cannot auto-READY with this open

Current ledger: pristine 273 / adapted 10 / reused-dependency 5 / awaiting-adaptation 258. The prior awaiting-adaptation placeholder was rejected as a pending-work marker, not an executable disposition.

Options:

  1. Adapt all remaining applicable identities (SpringValue ~95, Controller ~31, createInterpolator ~26, animated web ~21, hooks suites, etc.) and then reject awaiting-adaptation in the crosswalk for any required/full-suite adapted lane. Lean: this is the correct parity bar leonidaz stated.
  2. Case-by-case inapplicable dispositions with concrete React/Octane rationales only where a case truly cannot apply (not “not yet landed”). Most of the 258 look in-scope for this web binding, so this is a small residual set after (1), not a substitute for (1).
  3. Split the PR: keep pristine + differential + types + the 10 adapted cases here; move the remaining adapted full-suite work to a follow-on PR — only if maintainers accept that this PR’s adapted lane must stop claiming required/full-suite evidence until that follow-on lands.

Lean: (1), possibly staged as follow-on commits on this branch rather than faking READY. Adapting ~258 snapshot/RAF/browser identities is multi-day porting and outside a mechanical babysit pass; please confirm whether to continue full adaptation on this PR or take option (3).

Comment thread packages/react-spring/src/hooks.ts Resolved
Comment thread packages/react-spring/src/index.ts Resolved

@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 10433b9. Configure here.

@jonkwheeler

Copy link
Copy Markdown
Contributor Author

Babysit loop-back report (pipeline): currency and Bugbot findings cleared on 4b30a7808 (draft, CLEAN, Bugbot SUCCESS, no open Bugbot threads). Remaining blocker is maintainer feedback on upstream-case-dispositions.json: adapted full-suite claim with 258 awaiting-adaptation identities still needs a product call (adapt remaining cases / concrete inapplicable rationales / split follow-on). Not posting READY FOR REVIEW while that thread is open.

@leonidaz

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! This pull request was incorporated into main as commit 720a87850c12 through consolidated PR #699.

@leonidaz leonidaz closed this Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat PR: new feature or capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants