refactor(rolldown): migrate codemirror to modern-monaco#185
Merged
webfansplz merged 3 commits intomainfrom Mar 9, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the Rolldown DevTools code viewer/diff viewer from CodeMirror 5 to modern-monaco, updating both dependencies and the UI implementation to use Monaco editors with custom theming and scrollbar styling.
Changes:
- Replace CodeMirror-based viewer/diff components with Monaco equivalents and introduce a new Monaco composable.
- Update styles to target Monaco editor DOM and align scrollbars with app styling.
- Remove CodeMirror dependencies/types and add
modern-monacoto workspace/package deps (plus lockfile updates).
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Removes CodeMirror entries from catalogs; adds modern-monaco. |
| pnpm-lock.yaml | Reflects dependency swap to modern-monaco and related lock updates. |
| packages/rolldown/src/uno.config.ts | Minor formatting cleanup. |
| packages/rolldown/src/nuxt.config.ts | Updates optimizeDeps.include to preload modern-monaco instead of CodeMirror modules. |
| packages/rolldown/src/app/styles/global.css | Adds app scrollbar CSS vars and Monaco scrollbar styling overrides. |
| packages/rolldown/src/app/styles/cm.css | Repurposes editor styling from CodeMirror to Monaco while keeping shared font vars. |
| packages/rolldown/src/app/composables/monaco.ts | New shared Monaco initialization, theme application, editor factory, language guessing, and scroll sync helpers. |
| packages/rolldown/src/app/composables/codemirror.ts | Removes CodeMirror composable. |
| packages/rolldown/src/app/components/code/Viewer.vue | Reimplements the code viewer using a read-only Monaco editor with auto-height. |
| packages/rolldown/src/app/components/code/DiffEditor.vue | Reimplements the diff viewer using two Monaco editors + decoration-based diff highlighting + scroll sync. |
| packages/rolldown/package.json | Drops CodeMirror deps/types and adds modern-monaco. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
commit: |
Member
|
Awesome! Thank you! |
antfu
approved these changes
Mar 9, 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.
Screenshot:
