-
Notifications
You must be signed in to change notification settings - Fork 715
fix: changed code-mirror to monaco-editor #8047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Summary
This pull request implements a complete migration from CodeMirror to Monaco Editor for the web application's code editing functionality. The changes encompass several key areas:
Dependency Management: The package.json removes 16 CodeMirror-related packages (including @codemirror/autocomplete, @codemirror/commands, language packages, themes, and core codemirror) and replaces them with monaco-editor (v0.52.2) and vite-plugin-monaco-editor (v1.1.0).
Build Configuration: The vite.config.ts is updated to integrate Monaco Editor with a custom plugin configuration that specifies a distribution path for Monaco's web workers, and updates chunk configurations to handle Monaco Editor bundles instead of CodeMirror.
Component Rewrite: The CodeQueryEditor.vue component undergoes a complete rewrite, replacing CodeMirror's EditorView API with Monaco's editor instance. The component maintains the same external interface but changes internal implementation including editor initialization, content handling, and theme management.
Theme Removal: Both CodeQueryEditorLightTheme.ts and CodeQueryEditorDarkTheme.ts files are removed entirely, as Monaco Editor provides built-in theming (vs and vs-dark) that replaces the custom CodeMirror theme configurations.
This migration aligns the codebase with Monaco Editor's more robust feature set, including better TypeScript support, enhanced IntelliSense, and the familiar VS Code editing experience. The change affects code editing functionality throughout the application, particularly in query editors and log analysis interfaces.
Confidence score: 2/5
- This PR has significant implementation issues that could cause runtime errors and functionality problems
- Score lowered due to missing null checks, removed debouncing logic, potential memory leaks, and incomplete error handling in the main editor component
- Pay close attention to
web/src/components/CodeQueryEditor.vuewhich contains several critical issues including unsafe editor object access and missing cleanup logic
5 files reviewed, 2 comments
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
663111d to
a3bc0d0
Compare
PR Code Suggestions ✨Explore these optional code suggestions:
|
bef657c to
ac05008
Compare
980d040 to
5e17100
Compare
5e17100 to
3a877f7
Compare
45a9909 to
c39e0f4
Compare
c39e0f4 to
df0f801
Compare
685aae0 to
080ffa2
Compare
080ffa2 to
11f2765
Compare
PR Type
Enhancement, Bug fix
Description
Replace CodeMirror with Monaco editor
Add Monaco autocomplete and markers
Update build to bundle Monaco
Remove re-render key from logs UI
Diagram Walkthrough
File Walkthrough
3 files
Replace CodeMirror with Monaco, add featuresCleanups, visualization flow, formatting tweaksEditor placeholder, menus, toggle guards3 files
Remove legacy CodeMirror dark themeRemove legacy CodeMirror light themeRemove CodeMirror deps; add Monaco and plugin1 files
Integrate Monaco plugin and chunking