Skip to content

feat(zag): add Octane bindings - #428

Closed
jonkwheeler wants to merge 56 commits into
octanejs:mainfrom
jonkwheeler:feat/zag-binding
Closed

jonkwheeler wants to merge 56 commits into
octanejs:mainfrom
jonkwheeler:feat/zag-binding

Conversation

@jonkwheeler

@jonkwheeler jonkwheeler commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Octane applications can now consume Zag's framework-neutral state-machine runtime through a React-compatible binding surface without shipping React or React DOM.

This is the first prerequisite in the Chakra UI migration chain:

  1. @octanejs/zag (this PR)
  2. @octanejs/ark-ui
  3. @octanejs/chakra-ui

The adapter preserves the stable @zag-js/[email protected] root exports, forwards Octane hook slots through Zag's indirect callbacks, and adapts portals for both compiled children blocks and ordinary child values. The package contract pins the matching framework-neutral Zag dependencies and keeps React dependencies development-only for differential testing.

Validation

  • Octane conformance: 8 tests passed across machine transitions, bindable context, independent call sites, lifecycle cleanup, portal behavior, and the published surface.
  • Differential parity: matching React and Octane state/context traces.
  • SSR: initial machine rendering and disabled portal behavior passed.
  • Type surface: package and bidirectional useMachine assignability checks passed.
  • Repository metadata: bindings status (50), package inventory (62), binding parity gaps (0), changesets, formatting, and diff checks passed.
  • Package canary: @octanejs/[email protected] packed with source/docs only and no React imports or published React dependencies.

Pull request chain

Keep this PR draft until CI is green and the branch is current with main. Ark UI work begins after this prerequisite merges; Chakra UI follows Ark UI and will include central playground coverage.

Post-deploy monitoring and validation

No additional operational monitoring is required because this is a publishable library adapter, not a deployed service. During the next release cycle, package maintainers should treat green package checks, a React-free published dependency graph, and consumer CI as healthy signals. If those signals regress, withhold the package release or revert this PR.

Provenance

  • An agent produced this diff (agent-authored)

Compound Engineering


Note

Medium Risk
New public binding surface for state machines and host props used by future UI stacks; controlled-bindable and event-normalization behavior diverges slightly from upstream React.

Overview
Introduces @octanejs/zag (0.0.1) as the Octane port of @zag-js/[email protected], exposing useMachine, normalizeProps, Portal, plus mergeProps and useSyncExternalStore re-exports while reusing framework-neutral @zag-js/* packages unchanged.

The adapter wires compiler hook slots through composed hooks and Zag bindable / track paths, and pins controlled context so prop-driven values are not overwritten by internal set calls. normalizeProps maps React-style text onChange to native onInput on text-entry hosts; Portal handles Octane container refs and portals compiled children as a single block. SSR is covered for initial machine state and in-place disabled portals.

Evidence is vendored upstream source/tests under packages/zag/upstream, with pristine React and adapted Octane Vitest lanes (StrictMode cases pristine-only). Repo metadata moves to 61 bindings, adds @zag-js/react → @octanejs/zag in CLI/MCP data, extends bindings:typecheck, and ignores pristine suite scratch dirs.

Reviewed by Cursor Bugbot for commit 925941a. 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 Jul 31, 2026 1:29am
octane-website-mcp Ready Ready Preview Jul 31, 2026 1:29am

Request Review

@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 30, 2026 18:41 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 30, 2026 18:42 Inactive
Comment thread packages/zag/src/bindable.ts Resolved
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 30, 2026 19:56 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 30, 2026 19:57 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 30, 2026 20:25 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 30, 2026 20:26 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 30, 2026 20:28 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 30, 2026 20:28 Inactive
# Conflicts:
#	package.json
#	packages/octane-evals/datasets/train/user-apps-v1/manifest.jsonl
#	pnpm-lock.yaml
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 30, 2026 20:45 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 30, 2026 20:45 Inactive
Comment thread packages/zag/src/normalize-props.ts Resolved
# 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/zag/src/machine.ts Resolved
Comment thread packages/zag/src/normalize-props.ts Resolved
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 30, 2026 21:35 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 30, 2026 21:36 Inactive
Comment thread packages/zag/src/portal.ts Resolved
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 30, 2026 21:52 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 30, 2026 21:53 Inactive
Comment thread packages/zag/src/machine.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 b062e72. Configure here.

Comment thread packages/zag/src/normalize-props.ts Resolved
@jonkwheeler

Copy link
Copy Markdown
Contributor Author

REVIEW WITHDRAWN

Currency update brought a new unresolved Bugbot finding on normalizeProps; fixing before re-signaling ready.

@jonkwheeler

Copy link
Copy Markdown
Contributor Author

Branch currency restored via update-branch. Bugbot completed on the new head with one finding about normalizeProps callability; declined after verifying upstream createNormalizer also returns a non-callable Proxy over {}, matching Zag's object+methods usage. No unresolved threads remain.

READY FOR REVIEW

@jonkwheeler

Copy link
Copy Markdown
Contributor Author

REVIEW WITHDRAWN

Restoring merge currency: merged origin/main and resolving conflicts. Prior ready signal voided until Bugbot clears the new head.

@jonkwheeler

Copy link
Copy Markdown
Contributor Author

Merged origin/main to restore currency; conflicts resolved. Cursor Bugbot SUCCESS on current head; merge state CLEAN; no unresolved review threads.

READY FOR REVIEW

@jonkwheeler

Copy link
Copy Markdown
Contributor Author

REVIEW WITHDRAWN

Branch is behind main; restoring merge currency before re-signaling.

@jonkwheeler

Copy link
Copy Markdown
Contributor Author

READY FOR REVIEW

Merge currency restored via update-branch. Bugbot completed on current head with no unresolved findings; merge state CLEAN.

@jonkwheeler

Copy link
Copy Markdown
Contributor Author

REVIEW WITHDRAWN

Restoring merge currency: origin/main moved (Version Packages #682). Merging and resolving conflicts before re-signaling.

Absorb Version Packages (octanejs#682) and refresh sync artifacts after conflict resolution.

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

Copy link
Copy Markdown
Contributor Author

Merged origin/main (Version Packages #682), resolved conflicts, and refreshed sync artifacts. Cursor Bugbot SUCCESS on 3bc3210; merge state CLEAN; no unresolved review threads.

READY FOR REVIEW

@jonkwheeler

Copy link
Copy Markdown
Contributor Author

REVIEW WITHDRAWN

Branch is behind main; restoring merge currency via update-branch before re-signaling.

@jonkwheeler

Copy link
Copy Markdown
Contributor Author

Merge currency restored via update-branch. Cursor Bugbot SUCCESS on 925941a; merge state CLEAN; no unresolved review threads.

READY FOR REVIEW

@leonidaz

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! This pull request was incorporated into main as commit 44495b3221c3 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.

2 participants