feat: lazy load things which are low-risk from main#2386
Conversation
Greptile SummaryThis PR reduces the initial bundle size by converting ~20 eagerly-loaded modules to dynamic
Confidence Score: 5/5Safe to merge; all lazy-loading changes are behind user-triggered code paths and the refactored helper modules are straightforward extractions with no logic changes. The change is a mechanical conversion of eager imports to dynamic import() calls. Every converted path is behind a user action so there is no risk of breaking the initial render. The three new helper modules are clean extractions of existing logic. The one gap — showTutorials swallowing a potential async failure silently — is non-critical because the tutorial is purely informational. src/main.js — specifically the Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[App Start / main.js] --> B[Eager: core editor, settings, LSP connectionState]
A --> C[Lazy on first use]
C --> D[welcome chunk\npages/welcome]
C --> E[terminal chunk\ncomponents/terminal]
C --> F[prettierFormatter chunk\nlib/prettierFormatter]
C --> G[fileBrowser chunk\npages/fileBrowser]
C --> H[checkPluginsUpdate chunk\nlib/checkPluginsUpdate]
C --> I[tutorial + appSettings chunks\nshowTutorials]
B --> J[commands.js async handlers]
J --> K[commandPalette / changeMode / changeTheme / changeEncoding]
J --> L[problems / plugins / about / mainSettings / helpSettings]
J --> M[fileBrowser via lazyImports.js]
J --> N[color dialog / browser plugin]
B --> O[registerPrettierFormatter.js]
O --> |on format invoke| F
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[App Start / main.js] --> B[Eager: core editor, settings, LSP connectionState]
A --> C[Lazy on first use]
C --> D[welcome chunk\npages/welcome]
C --> E[terminal chunk\ncomponents/terminal]
C --> F[prettierFormatter chunk\nlib/prettierFormatter]
C --> G[fileBrowser chunk\npages/fileBrowser]
C --> H[checkPluginsUpdate chunk\nlib/checkPluginsUpdate]
C --> I[tutorial + appSettings chunks\nshowTutorials]
B --> J[commands.js async handlers]
J --> K[commandPalette / changeMode / changeTheme / changeEncoding]
J --> L[problems / plugins / about / mainSettings / helpSettings]
J --> M[fileBrowser via lazyImports.js]
J --> N[color dialog / browser plugin]
B --> O[registerPrettierFormatter.js]
O --> |on format invoke| F
Reviews (2): Last reviewed commit: "fix" | Re-trigger Greptile |
No description provided.