Skip to content

feat(monaco-editor): add Octane binding - #441

Merged
leonidaz merged 14 commits into
octanejs:mainfrom
zhsama:feat/monaco-editor-binding
Aug 10, 2026
Merged

leonidaz merged 14 commits into
octanejs:mainfrom
zhsama:feat/monaco-editor-binding

Conversation

@zhsama

@zhsama zhsama commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add @octanejs/monaco-editor, matching the public @monaco-editor/[email protected] Editor, DiffEditor, loader, and useMonaco surface without a React runtime.
  • Support controlled values, model paths and languages, themes, options, validation callbacks, view-state restoration, and ownership-aware model cleanup.
  • Render deterministic SSR loading shells and initialize Monaco only in client effects.

Why

  • Echo desktop and web use Monaco as a heavy editor dependency that cannot be replaced by a trivial UI-runtime swap.
  • The binding gives Octane applications the same integration shape while preserving Octane lifecycle and SSR rules.

Changes

  • Add compiled Octane Editor and DiffEditor components plus public types and loader helpers.
  • Add model leasing, cross-remount view-state restoration keyed by model identity, latest-callback handling, and stale async guards.
  • Add focused behavior, race, public-surface, type, and creation-failure coverage.
  • Register the binding across CLI/MCP/docs/website inventories and add a changeset.
  • Merge current main workspace scripts and refresh generated/parity metadata required by CI.

Validation

  • pnpm --dir packages/monaco-editor test — 4 files / 25 tests
  • pnpm --dir packages/monaco-editor typecheck
  • website MCP content regression — 10 tests
  • eval user-app corpus regression — 6 tests
  • generated inventory/status/parity/CLI checks
  • pnpm changeset:check and pnpm tsrx-decls:check
  • pnpm test — 1,533 files / 16,243 tests
  • pnpm typecheck
  • pnpm react-parity:validate and pnpm react-parity:check
  • pnpm sync
  • pnpm format:check

Risk / follow-ups

  • Hydration is not yet separately verified; SSR currently guarantees the deterministic loading shell and browser-global isolation.
  • This PR is ready for maintainer review; Bugbot and the complete CI matrix have passed.

Provenance

  • An agent produced this diff (agent-authored)

Note

Medium Risk
New editor binding with complex async loader and model ownership semantics; SSR/hydration for live Monaco is explicitly not yet verified separately.

Overview
Introduces @octanejs/monaco-editor, a new framework binding that mirrors @monaco-editor/[email protected] (Editor, DiffEditor, loader, useMonaco, and the public prop/callback types) on compiled Octane components with no React runtime. monaco-editor and @monaco-editor/loader are consumed unchanged; the adapter layer is re-authored in TSRX with client-only Monaco construction behind a deterministic SSR loading shell.

The implementation adds controlled value/path/language/theme/options sync, view-state restoration keyed by model identity, validation callbacks, loader cancelation guards, and ownership-aware model leasing/disposal (including keepCurrent*Model and shared path models). Vitest coverage spans editor/diff behavior, loader races, public export parity vs upstream, and type tests; workspace CI wires bindings:typecheck, a vitest project, generated docs/inventory/status, CLI octane-data, and a patch changeset.

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

@vercel

vercel Bot commented Jul 31, 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 4, 2026 9:46am
octane-website-mcp Ready Ready Preview Aug 4, 2026 9:46am

Request Review

@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 31, 2026 09:05 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 31, 2026 09:06 Inactive
Comment thread packages/monaco-editor/src/Editor.tsrx Resolved
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 31, 2026 09:28 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 31, 2026 09:29 Inactive
Comment thread packages/monaco-editor/src/Editor.tsrx Resolved
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 31, 2026 09:39 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 31, 2026 09:39 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 31, 2026 09:51 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 31, 2026 09:52 Inactive
Comment thread packages/monaco-editor/src/model.ts Resolved
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 31, 2026 10:02 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 31, 2026 10:02 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 31, 2026 10:14 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 31, 2026 10:14 Inactive
@zhsama
zhsama marked this pull request as ready for review July 31, 2026 17:58
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 31, 2026 17:59 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 31, 2026 17:59 Inactive
@leonidaz
leonidaz marked this pull request as draft July 31, 2026 22:06
Preserve the latest root scripts while keeping Monaco in binding typechecks. Add Monaco to llms.txt, refresh eval lockfile digests, and update React parity integrity evidence.
@github-actions github-actions Bot added the feat PR: new feature or capability label Aug 4, 2026
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp August 4, 2026 09:45 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website August 4, 2026 09:46 Inactive
@github-actions github-actions Bot added the agent-authored Diff or issue body substantially produced by an AI agent label Aug 4, 2026
@zhsama
zhsama marked this pull request as ready for review August 4, 2026 09:52
…binding

# Conflicts:
#	docs/packages.md
#	packages/hook-form/audit/react-parity.json
#	packages/octane-evals/datasets/train/user-apps-v1/manifest.jsonl
#	pnpm-workspace.yaml

@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 324dc96. Configure here.

Comment thread packages/monaco-editor/src/Editor.tsrx Resolved
zhsama added 2 commits August 10, 2026 15:59
…binding

# Conflicts:
#	docs/binding-parity-gaps.md
#	docs/bindings-status.md
#	docs/packages.md
#	package.json
#	packages/hook-form/audit/react-parity.json
#	packages/octane-evals/datasets/train/user-apps-v1/manifest.jsonl
#	packages/octane-mcp-server/src/bridge.js
#	pnpm-lock.yaml
#	website/public/llms.txt
@zhsama

zhsama commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

I’ve resolved the merge conflicts against the latest main and addressed the remaining review feedback. The fixes are pushed, and the Monaco package tests (27/27), typecheck, generated-file checks, and formatting checks pass.

@leonidaz leonidaz left a comment

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.

thanks!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants