Files
openidea/src/comparisonWindowBoot.ts
T
Deng Liuanddengliu 79accd1311 perf(settings): split Settings and auxiliary window boot out of the Workbench module (#4044)
Native auxiliary windows (settings, comparison, diff, deployment) all booted src/main.tsx, which statically imported the Workbench and every workbench feature (CodeMirror, xterm, editor extensions) even when the Settings window rendered none of them. main.tsx is now a small window-kind router with one boot module per window kind, and the settings pages, core plugin points and plugin theme runtime are registered from editor-free modules, so the Settings window loads no Workbench, @codemirror, @xterm or @/editor modules (about 57% less JS and a third less heap per Settings window). A static test keeps the Settings boot isolated.

Part of #3942

Co-authored-by: dengliu <5108773+dengliu@users.noreply.github.com>
2026-11-18 18:32:14 +08:00

28 lines
1.2 KiB
TypeScript

import type { ComponentType } from "react";
import { activate as editor } from "./editor/core";
import { confirmLeave } from "./features/app/closeGuard";
import { installLocaleSync } from "./features/app/locale";
import { installMenuBridge } from "./features/app/menuBridge";
import { trackRuntimeSettings } from "./features/settings/runtime";
import { activate as vcs } from "./features/vcs";
import { activateComparisonWindow, ComparisonWindow } from "./features/vcs/ComparisonWindow";
import { installKeyboardDispatcher } from "./platform/keymap";
import { activateList } from "./windowBoot";
/**
* Comparison window of project window `parent`: changed files between two
* revisions and their diffs, with the editor and Git but no workbench.
*/
export function bootComparisonWindow(parent: string): ComponentType {
activateList("comparison window", [
["locale", installLocaleSync],
["settings", trackRuntimeSettings],
["menu", installMenuBridge],
["editor", editor],
["vcs", vcs],
["comparison", () => activateComparisonWindow(parent, (project) => confirmLeave(undefined, project))],
]);
installKeyboardDispatcher();
return ComparisonWindow;
}