Private
Public Access
1
0

重构:CodeMirror 架构优化

核心优化:
- 新增统一导出避免多实例问题
- 语言加载器从动态改为静态导入
- 使用 Compartment 实现主题/语言动态切换

依赖清理:
- 移除废弃的 @codemirror/highlight
- 移除不再使用的 @codemirror/legacy-modes

组件优化:
- CodeEditor 添加内容更新防抖
- 改进亮色主题样式
- 移除不必要的编辑器重建逻辑

构建配置:
- 简化 Vite manualChunks 配置
- 优化依赖预加载列表

文档清理:
- 删除过期的代码审查文档
- 更新版本号 0.3.0 → 0.3.2
This commit is contained in:
2026-02-06 11:32:27 +08:00
parent 9eb39fbb8f
commit 0229cab550
30 changed files with 592 additions and 3971 deletions

View File

@@ -82,6 +82,7 @@ import SettingsPanel from './components/SettingsPanel.vue'
import UpdateNotification from './components/UpdateNotification.vue'
import { useUpdateStore } from './stores/update'
import { useConfigStore } from './stores/config'
import { preloadCommonLanguages } from './utils/codeMirrorLoader'
// 存储键
const ACTIVE_TAB_STORAGE_KEY = 'app-active-tab'
@@ -138,6 +139,9 @@ const getComponent = (key) => {
onMounted(() => {
loadConfig()
// 预加载常用编辑器语言包
preloadCommonLanguages()
// 设置更新事件监听
updateStore.setupEventListeners()