Two GitHub IPC handlers (handleGitHubGetRepoStats and handleGitHubGetProjectHealth) dynamically import path and fs/promises inside their handler bodies, even though path is already statically imported at the top of the same file.
// Line 2 — static import
import path from "path";
// Lines 66-68 inside handleGitHubGetRepoStats
const fs = await import("fs/promises");
const pathModule = await import("path");
// Lines 123-125 inside handleGitHubGetProjectHealth — same thing
const fs = await import("fs/promises");
const pathModule = await import("path");
The static path is used for validation (path.isAbsolute(cwd)) in the same handlers, while the dynamic pathModule is used for pathModule.resolve(cwd) — two references to the same module in the same function.
Dynamic imports of Node built-ins add unnecessary microtask overhead on every IPC call with zero lazy-loading benefit. The fs/promises import should also be hoisted to a static import since it's a built-in with no startup cost.
See electron/ipc/handlers/github.ts — static import at line 2, dynamic re-imports at lines 66-68 and 123-125.
Two GitHub IPC handlers (
handleGitHubGetRepoStatsandhandleGitHubGetProjectHealth) dynamically importpathandfs/promisesinside their handler bodies, even thoughpathis already statically imported at the top of the same file.The static
pathis used for validation (path.isAbsolute(cwd)) in the same handlers, while the dynamicpathModuleis used forpathModule.resolve(cwd)— two references to the same module in the same function.Dynamic imports of Node built-ins add unnecessary microtask overhead on every IPC call with zero lazy-loading benefit. The
fs/promisesimport should also be hoisted to a static import since it's a built-in with no startup cost.See
electron/ipc/handlers/github.ts— static import at line 2, dynamic re-imports at lines 66-68 and 123-125.