Repository navigation
chore(deps): bump @fc-components/monaco-editor to 0.6.0 - #2296
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThe KQL input migrated from CodeMirror to ChangesKQL editor migration
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant KQLInput
participant KQLMonacoEditor
participant ESCachedClient
participant ESHTTPClient
KQLInput->>KQLMonacoEditor: Render query and callbacks
KQLMonacoEditor->>KQLInput: Send editor events
KQLInput->>ESCachedClient: Fetch field names or values
ESCachedClient->>ESHTTPClient: Request completion data
Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Replace the CodeMirror-based KQL editor with KQLMonacoEditor from @fc-components/monaco-editor (bumped to ^0.6.2). Reuse the existing elasticsearch completion client for field/value suggestions. Drop the now-unused CMTheme, completion, grammar, kql, style and utils modules.
There was a problem hiding this comment.
🔵 Needs a closer look
It includes a significant editor migration and behavioral surface-area change beyond a dependency bump, warranting explicit PR scoping and focused manual verification.
Pull request overview
This PR updates @fc-components/monaco-editor and migrates KQLInput from a CodeMirror-based implementation to the KQLMonacoEditor component, removing the now-unused CodeMirror KQL language/completion/theme assets under src/components/KQLInput/.
Changes:
- Bump
@fc-components/monaco-editordependency (package + lockfile). - Replace
src/components/KQLInputCodeMirror editor wiring withKQLMonacoEditorand ES-backed field name/value fetchers. - Delete KQLInput’s CodeMirror-specific completion, grammar, theming, styles, and local-history utilities.
File summaries
| File | Description |
|---|---|
| src/components/KQLInput/index.tsx | Switch KQL input editor to KQLMonacoEditor, rewire completion data fetching, and adjust trigger behavior types. |
| src/components/KQLInput/utils.ts | Remove local query-history helpers previously used by the CodeMirror implementation. |
| src/components/KQLInput/style.less | Remove CodeMirror highlight CSS classes for KQL. |
| src/components/KQLInput/kql.ts | Remove CodeMirror LRLanguage definition and extension wrapper. |
| src/components/KQLInput/grammar/parser.js | Remove generated Lezer parser used by CodeMirror completion/highlighting. |
| src/components/KQLInput/complete/index.ts | Remove CodeMirror completion strategy factory. |
| src/components/KQLInput/complete/hybrid.ts | Remove hybrid completion implementation tied to CodeMirror syntax tree analysis. |
| src/components/KQLInput/CMTheme.tsx | Remove CodeMirror theme/highlighter definitions. |
| package.json | Update @fc-components/monaco-editor version range. |
| package-lock.json | Update lockfile entries for @fc-components/monaco-editor to the new resolved version. |
Review details
Suppressed comments (1)
src/components/KQLInput/index.tsx:47
- 这里解构了 historicalRecords 但后续未使用;这会增加阅读负担,也可能触发 no-unused-vars / noUnusedLocals。既然要保留该 prop 兼容旧调用方,可以只保留说明注释而不解构出变量。
const {
datasourceValue,
query,
historicalRecords, // 新编辑器暂不支持历史记录补全,保留 prop 以兼容旧调用方
value,
- Files reviewed: 9/10 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "@fc-components/codemirror-promql": "^0.19.13", | ||
| "@fc-components/es-query": "^0.0.3", | ||
| "@fc-components/monaco-editor": "^0.5.12", | ||
| "@fc-components/monaco-editor": "^0.6.2", |
| import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react'; | ||
| import _ from 'lodash'; | ||
| import i18next from 'i18next'; | ||
| import { KQLMonacoEditor } from '@fc-components/monaco-editor'; | ||
| import { IRawTimeRange } from '@/components/TimeRangePicker'; |
Summary by CodeRabbit
New Features
onChangetrigger option.Changes