Repository navigation
perf(editor): stop shipping the TypeScript, CSS, HTML and JSON workers - #667
Merged
Merged
Conversation
`import * as monaco from "monaco-editor"` is the `editor.main` barrel, which carries the TypeScript, CSS, HTML and JSON *language services*. Vite then builds and ships their web workers — ts.worker alone is 8 MB — in a SQL client that never edits any of those languages. Importing `editor.all` (every editor feature, no language services) plus the SQL and MySQL contributions instead: dist total 17 MB -> 5.3 MB monaco chunk 4.25 MB -> 3.69 MB workers 10.8 MB -> 352 KB (the editor worker alone) Checked in a real browser rather than assumed: SQL still tokenises (`keyword.sql`, `number.sql`, `identifier.sql`), two languages are registered instead of ninety, and find, fold, suggest, uppercase and comment-line — every action the toolbar and the shortcuts drive — are all still there. One test-only consequence: Monaco's clipboard contribution asks `document.queryCommandSupported` at import time, which jsdom does not have at all. Stubbed in the shared setup; a real browser has it. ARCHITECTURE's technology table listed monaco-sql-languages, React Flow, Recharts and cmdk, none of which are dependencies, and the system diagram drew an ERD canvas, a dashboard and a command palette, none of which exist. Replaced with what is there.
EVWorth
force-pushed
the
perf/monaco-bundle
branch
from
September 12, 2026 12:48
329077e to
f7d0324
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From the full-project review: I built the app and looked at what came out.
import * as monaco from "monaco-editor"is theeditor.mainbarrel, which carries the TypeScript, CSS, HTML and JSON language services. Vite then builds and ships their web workers — in a SQL client that never edits any of those languages.Importing
editor.all(every editor feature, no language services) plus the SQL and MySQL contributions instead:disttotalVerified in a real browser, not assumed
Loaded the trimmed Monaco in Chromium and asked it:
monaco.editor.tokenize("SELECT 1 FROM t", "sql")→keyword.sql,number.sql,identifier.sql— the grammar is theregetLanguages()→ 2 (sql, mysql), instead of ~90actions.find,editor.foldAll,editor.action.triggerSuggest,editor.action.transformToUppercase,editor.action.commentLine— every action the toolbar and the shortcuts driveOne test-only consequence
Monaco's clipboard contribution asks
document.queryCommandSupportedat import time, and jsdom does not implement it at all. Stubbed in the shared test setup; a real browser has it.Docs
ARCHITECTURE's technology table listed
monaco-sql-languages, React Flow, Recharts and cmdk — none of which are dependencies — and the system diagram drew an ERD canvas, a dashboard and a command palette, none of which exist. Replaced with what is actually there.