Repository navigation
Use monaco-editor as the only Monaco package in playground-v2 - #3710
Merged
Merged
Conversation
Jake Bailey (jakebailey)
force-pushed
the
monaco-dedupe
branch
from
November 20, 2026 18:13
3439dd6 to
8855999
Compare
monaco-editor-core's editor.main already registers the links contribution through editor.all. Importing the contribution from monaco-editor pulls in that package's separate copy of the editor core, so the registration lands in an editor instance the playground never uses while adding hundreds of duplicate modules to the bundle.
monaco-editor ships its own copy of the editor core, so depending on both monaco-editor and monaco-editor-core bundles the core twice and requires keeping two sets of patches in sync. The playground only needs monaco-editor's Monarch definitions for TypeScript and JavaScript; everything else can come from monaco-editor's editor entry, minus the built-in language services, which would compete with the tsgo LSP. The LSP client declares monaco-editor-core as a peer, which pnpm would otherwise install alongside monaco-editor even though nothing uses it.
Jake Bailey (jakebailey)
force-pushed
the
monaco-dedupe
branch
from
November 20, 2026 18:41
8855999 to
8c8a1db
Compare
A pnpm override can remove the LSP client's monaco-editor-core peer dependency directly, which avoids keeping a pnpmfile hook and its lockfile checksum.
# Conflicts: # package.json # pnpm-lock.yaml
Jake Bailey (jakebailey)
requested review from
Daniel Rosenwasser (DanielRosenwasser) and
Andrew Branch (andrewbranch)
November 20, 2026 22:18
Andrew Branch (andrewbranch)
approved these changes
Nov 21, 2026
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.
playground-v2built its editor frommonaco-editor-corewhile importing the TypeScript/JavaScript Monarch definitions, the links contribution, and the editor worker frommonaco-editor.monaco-editorships its own complete copy of the core, so the bundle carried two copies of the editor with separate service and registry instances, and both packages needed matching patches.This switches playground-v2 to
monaco-editoralone:monaco-editor-coreimports (from playground code and@vscode/monaco-lsp-client) resolve tomonaco-editor's editor entry with its built-in CSS/HTML/JSON/TypeScript language services, bundled LSP client, and Monarch registrations removed, since those would compete with the tsgo LSP. The build fails if any of them end up in the bundle.patches/monaco-editor@0.56.0.patch, and themonaco-editor-corepatch and dependency are removed.monaco-editor-corepeer dependency, which pnpm would otherwise install even though nothing uses it.main.jsmain.csseditor.worker.js