Repository navigation
feat(editor): replace monaco with pierre's editor, parse user code with babel - #10250
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
All reported issues were addressed across 9 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
[High impact] The latest changes appear safe to merge, with no new actionable issue found. SummaryReplaces Monaco with Pierre’s editor and moves user-code parsing to Babel. The latest change runs menu Cut and Copy through native clipboard commands instead of copying and deleting in separate steps.
Reviews (4) · Last reviewed commit: "fix(editor): run the context menu's cut ..." · Reviewed by Greptile |
… compiler TypeScript 7 ships no compiler API, so the server kept @typescript/typescript6 only to parse and transpile code users write. Three of its four runtime uses move to libraries built for the job: - MCP code mode strips types with sucrase after Babel checks the syntax, so a program that does not parse still reports every error with its own line. - The Function block's import scan and the document file-reference scanner parse with Babel through one shared parser for user JavaScript. A Function body that does not parse now runs where its syntax error is reported, instead of first starting a remote sandbox for the imports found in it.
… from broken code - A template literal with nothing substituted into it is one string token again, so getFileBase64(`photo-1`) keeps its file reference. - The import scan parses strictly: a recoverable error is still an error, so imports are never hoisted out of code that will not run.
…and the Code tab One CodeEditor on @pierre/diffs (already shipped for diffs) replaces Monaco in both places: the editable file viewer and the read-only workflow Code tab. - Lighter and faster: opening a .ts file loads ~460 KB instead of ~1.25 MB plus up to 9 MB of language workers; first paint is 4x faster, the heap a third to a half of Monaco's up to 30k lines, and highlighting never blocks the main thread. - Highlighting runs on Pierre's WebAssembly highlighter, so the CSP allows 'wasm-unsafe-eval' (WebAssembly compilation only); Shiki is the fallback. - Read-only is a guard in front of a live editor, so search, selection and copy keep working; Tab leaves the editor, every edit is refused. - External updates (streaming, refresh, reload) keep the scroll position and never join the undo history; a growing document follows its end. - Chrome uses the app's tokens: a --surface-hover caret line, ::selection and find colors, a quiet bracket match, and one syntax palette for Shiki and Zed themes. - Removes the Monaco wrapper, its themes and workers, the Code tab's language registration and minimal-edit helper, and the Monaco-only PostHog filter.
08267f0 to
3bae054
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 29 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
…ithin engine limits - The context menu's Cut and Copy take every selected passage, and Cut deletes only after the clipboard write succeeds, so nothing is removed that never reached it. - The import scan sees require?.() calls and walks array children one push at a time, so a 100,000-element literal stays under Bun's argument limit. - The Code tab e2e seeds the clipboard before pasting into the read-only view.
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 29 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
…commands Cut and Copy run as native commands on the refocused editor, like ⌘X and ⌘C: one synchronous step that copies every selection, cuts exactly what it copied, keeps the chat selection reference, and leaves focus in the editor. Copy all returns focus too.
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
Two related moves off heavyweight editor and compiler dependencies.
1. Monaco → Pierre's editor. One
CodeEditorbuilt on@pierre/diffs, which we already ship for diffs, replaces Monaco in the file viewer (editable) and the workflow Code tab (read-only)..tsfile'wasm-unsafe-eval'toscript-src. That keyword allows WebAssembly compilation only, not JS eval.--surface-hoverband, not an outlined row;::selectiontint (--selection-muted);--highlight-match-bg, as chat's find does;--surface-activefill with no underline.--bg, as Monaco did. Diffs keep--surface-2.@sim/emcn/syntax-themegains a Zed-format theme whose colors are the samecode.cssvariables.Canceledfilter;monaco-editorand@monaco-editor/reactdependencies.2. User code is parsed by Babel, not the TypeScript 6 compiler. TypeScript 7 has no compiler API, and the 7.1 API is project-based on the Go compiler.
@babel/parserchecks the syntax. Each error keeps its own line number.code-placeholders/javascript.tsstill uses TS6. It parses source with raw{{NAME}}placeholders and relies on TS6's error tolerance to find secret reads, so porting it is a redesign.Type of Change
Testing
CodeEditorandTextEditor, run in a browser harness in light and dark, pass 27 checks with no page errors:workflow-code-uiscript now drives the Pierre editor (text, focus, read-only typing and paste).Checklist