Files
openidea/src/settingsWindowBoot.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

38 lines
1.8 KiB
TypeScript

import type { ComponentType } from "react";
import { activateSettingsPages as agentsPages } from "./features/agents/settingsPages";
import { installLocaleSync } from "./features/app/locale";
import { activateSettingsPages as databasePages } from "./features/database/settingsPages";
import { activateSettingsPages as githubPages } from "./features/github/settingsPages";
import { activateSettingsPages as pluginsPages } from "./features/plugins/settingsPages";
import { activate as projectTrust } from "./features/project-trust";
import { activateSettingsWindow } from "./features/settings/settingsWindow";
import { SettingsWindow } from "./features/settings/window/SettingsWindow";
import { activateSettingsPages as templatesPages } from "./features/templates/settingsPages";
import { activateSettingsPages as todoPages } from "./features/todo/settingsPages";
import { activateSettingsPages as toolsPages } from "./features/tools/settingsPages";
import { activateSettingsPages as vcsPages } from "./features/vcs/settingsPages";
import { activateSettingsPages as vimPages } from "./features/vim/settingsPages";
import { activateList } from "./windowBoot";
/**
* Native Settings window of project window `parent`: only the settings pages
* (no workbench, project services, CodeMirror editors or tool windows).
*/
export function bootSettingsWindow(parent: string): ComponentType {
activateList("settings pages", [
["project-trust", projectTrust],
["locale", installLocaleSync],
["settings", () => activateSettingsWindow(parent)],
["templates", templatesPages],
["todo", todoPages],
["plugins", pluginsPages],
["tools", toolsPages],
["agents", agentsPages],
["vim", vimPages],
["vcs", vcsPages],
["github", githubPages],
["database", databasePages],
]);
return SettingsWindow;
}