Skip to content

feat(swr): add exact binding - #526

Closed
jonkwheeler wants to merge 50 commits into
octanejs:mainfrom
jonkwheeler:jon/swr-binding
Closed

jonkwheeler wants to merge 50 commits into
octanejs:mainfrom
jonkwheeler:jon/swr-binding

Conversation

@jonkwheeler

@jonkwheeler jonkwheeler commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Octane applications can now replace [email protected] with @octanejs/swr without redesigning the public root, infinite, immutable, mutation, subscription, or _internal APIs. The port preserves cache scoping, request deduplication and races, mutation, retry/poll/focus/reconnect behavior, Suspense, conditional server exports, and the pinned release's type surface while mapping the React-only devtools marker to an explicitly documented Octane contract.

Parity is fail-closed rather than inferred from API similarity: the unchanged React Jest suite, three pristine TypeScript projects, adapted Octane lanes, differential traces, SSR/stream/hydration probes, packed conditional exports, and evidence mutation controls all execute from pinned upstream artifacts. The package also includes migration guidance, an offline playground example, release metadata, and catalog integration.

Validation

  • pnpm format:check
  • pnpm typecheck
  • pnpm test
  • targeted tests:
    • pristine React Jest: 34 suites, 362 passing tests, 5 upstream-pending cases, 6 snapshots
    • pristine types: all 3 upstream TypeScript projects
    • adapted Octane: 8 executable parity lanes and 34 adapted tests
    • global React parity: 5,345 stable / 5,413 canary cases
    • package validation: 70 tarballs, 585 raw TSRX sources, strict packed TSRX, React-free consumer, Lynx native bundle, Pulseboard, and Wayfinder
    • playground production build: 8,439 modules
    • generated inventories, provenance hashes, package/status/catalog checks, and independent correctness review

Risk / follow-ups

The port intentionally does not claim unreleased SWR behavior or React devtools metadata compatibility. Fetchers, middleware, cache providers, subscribers, retry handlers, and devtools middleware remain trusted consumer code, matching the upstream execution model. No production network or credential-bearing fixture is used.

Provenance

  • An agent produced this diff (agent-authored)

Compound Engineering


Note

Medium Risk
Large new data-fetching binding touches cache, mutations, Suspense, and SSR/hydration; behavior is heavily tested but any subtle race or hydration mismatch would affect migrated apps.

Overview
Introduces @octanejs/swr as a drop-in Octane port of [email protected], covering the root hook plus infinite, immutable, mutation, subscription, _internal, and react-server export conditions, with Octane hooks replacing the React seam while keeping upstream cache and request semantics.

Repository integration bumps binding/package inventories to 61 bindings, adds a patch changeset, wires packages/swr into bindings:typecheck and global react-parity classification checks, excludes selected SWR .tsrx modules from Prettier, and documents the binding in bindings status, CLI catalog data, and a full implementation plan.

Documented divergences: devtools expose window.__SWR_DEVTOOLS_OCTANE__ instead of React’s global, and the pin does not add automatic fetch abort on unmount. Parity is backed by pristine upstream Jest/TS lanes, adapted Octane tests, differential/SSR/hydration probes, and audit manifests under packages/swr.

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

@vercel

vercel Bot commented Aug 3, 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 3, 2026 3:56am
octane-website-mcp Ready Ready Preview Aug 3, 2026 3:56am

Request Review

@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent feat PR: new feature or capability labels Aug 3, 2026
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp August 3, 2026 02:00 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website August 3, 2026 02:01 Inactive
jonkwheeler added a commit to jonkwheeler/octane that referenced this pull request Aug 3, 2026
Address PR review feedback (octanejs#526)

- strip trailing Octane hook metadata at the shared normalizer

- cover root overloads and middleware wrapping

- refresh executable parity inventories
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp August 3, 2026 02:55 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website August 3, 2026 02:56 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp August 3, 2026 03:55 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website August 3, 2026 03:56 Inactive
@jonkwheeler
jonkwheeler marked this pull request as ready for review August 3, 2026 04:12
@jonkwheeler
jonkwheeler marked this pull request as draft August 3, 2026 04:15
jonkwheeler and others added 2 commits August 7, 2026 13:26
Resolve inventory, eval manifest, hook-form parity lockfile, and root
package scripts while keeping SWR bindings:typecheck coverage.

Co-authored-by: Cursor <[email protected]>
Restore root package.json, align SWR engines with workspace baseline,
refresh react-parity lockfile/vitest hashes, and regenerate inventory.

Co-authored-by: Cursor <[email protected]>
Extend the SWR classification gate so discovery includes adapted suites under
tests/upstream and compiler-executed typetest programs, fail-closed on any
unclassified file, and keep the ledger complete for review readiness.

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

Copy link
Copy Markdown
Contributor Author

READY FOR REVIEW

@jonkwheeler

Copy link
Copy Markdown
Contributor Author

READY FOR REVIEW

@jonkwheeler

Copy link
Copy Markdown
Contributor Author

REVIEW WITHDRAWN

@jonkwheeler

Copy link
Copy Markdown
Contributor Author

READY FOR REVIEW

@jonkwheeler

Copy link
Copy Markdown
Contributor Author

Merging origin/main to clear conflicts; prior ready signal is void.

REVIEW WITHDRAWN

@jonkwheeler

Copy link
Copy Markdown
Contributor Author

READY FOR REVIEW

Keep main's eval manifest digests; refresh catalogs after merge if needed.

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

Copy link
Copy Markdown
Contributor Author

REVIEW WITHDRAWN

Merging origin/main to clear DIRTY conflicts; prior ready signal is void until Bugbot and the ready checklist pass on the new head.

@jonkwheeler

Copy link
Copy Markdown
Contributor Author

READY FOR REVIEW

Resolve docs/packages.md and evals manifest conflicts via pnpm sync after
Version Packages (octanejs#682) landed on main.

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

Copy link
Copy Markdown
Contributor Author

Merged origin/main (Version Packages #682); conflicts in docs/packages.md and evals manifest resolved via pnpm sync. Bugbot clean on current head.

READY FOR REVIEW

@leonidaz

Copy link
Copy Markdown
Collaborator

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

@leonidaz leonidaz closed this Aug 12, 2026
kotarotaniguchi0523 pushed a commit to kotarotaniguchi0523/octane that referenced this pull request Aug 12, 2026
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 feat PR: new feature or capability READY FOR REVIEW REVIEW COMPLETE

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants