This repository was archived by the owner on Oct 13, 2026. It is now read-only.
Repository navigation
[codex] Prune renderer dependencies from production manifest #463
Merged
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2b551b8
Prune renderer dependencies from production manifest
ffdaf06
Verify renderer dependency pruning in thin smoke
4a95793
Keep runtime transitive deps in production manifest
e76f65b
Guard renderer prune package list
d12f31d
Expand renderer dependency import audit
1961c0e
Tighten renderer prune smoke verification
b0207f7
Cover nested renderer dependency leaks
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Workbench Renderer Dependency Ledger | ||
|
|
||
| This ledger supports #452. Its purpose is to keep renderer-only libraries out of production raw `app.asar/node_modules` while preserving the runtime packages used by the main process, preload scripts, native modules, MCP servers, packaged resources, and updater/release flows. | ||
|
|
||
| ## Rule | ||
|
|
||
| Move a root package from `dependencies` to `devDependencies` only when all of these are true: | ||
|
|
||
| - It is imported only by `packages/desktop/src/renderer/**` or renderer-focused tests. | ||
| - It is bundled by the renderer Vite build into `out/renderer`. | ||
| - It is not imported by `packages/desktop/src/process/**`, `packages/desktop/src/preload/**`, `packages/desktop/src/common/**`, `packages/web-host/**`, `packages/web-cli/**`, or `scripts/**`. | ||
| - It is not explicitly included in `packages/desktop/electron-builder.yml` as a raw runtime `node_modules` or `asarUnpack` resource. | ||
|
|
||
| ## Moved Renderer-Only Packages | ||
|
|
||
| | Package | Renderer evidence | Runtime evidence | Notes | | ||
| | ------------------------------------------------------------------------------------------ | ------------------------------------------------ | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | | ||
| | `@arco-design/web-react` | 204 renderer imports plus DOM tests | no process/preload/common/script imports | UI component library; bundled into renderer. | | ||
| | `@icon-park/react` | 122 renderer imports | no process/preload/common/script imports | Icon library; bundled into renderer. | | ||
| | `mermaid` | `components/Markdown/MermaidBlock.tsx` | no process/preload/common/script imports | Large diagram renderer; bundled into renderer. | | ||
| | `react-syntax-highlighter` | Markdown, diff, and code preview renderers | no process/preload/common/script imports | Code highlighting stays in renderer chunks. | | ||
| | `@monaco-editor/react` | HTML preview viewer | no process/preload/common/script imports | Editor surface stays renderer-bundled. | | ||
| | `@uiw/react-codemirror`, `@uiw/codemirror-extensions-langs`, `@codemirror/*` | settings editors and preview editors | no process/preload/common/script imports | CodeMirror editor dependencies stay build-time/renderer only. | | ||
| | `diff`, `diff2html` | diff viewer and renderer message diff UI | no process/preload/common/script imports | Diff UI stays renderer-bundled. | | ||
| | `katex`, `react-markdown`, `rehype-*`, `remark-*`, `streamdown` | Markdown and preview rendering | no process/preload/common/script imports | Markdown/math rendering stays renderer-bundled. | | ||
| | `react`, `react-dom`, `react-i18next`, `react-router-dom`, `react-virtuoso`, `swr` | renderer app, router, list, i18n, and data hooks | no process/preload/common/script imports | Runtime UI libraries are bundled into `out/renderer`; the app does not require raw React from `app.asar/node_modules`. | | ||
| | `@dnd-kit/*`, `@floating-ui/react`, `classnames`, `dayjs`, `eventemitter3`, `qrcode.react` | renderer UI helpers | no process/preload/common/script imports | Small direct dependencies kept out of production raw shipping when used only by renderer. | | ||
|
|
||
| ## Kept Or Deferred Packages | ||
|
|
||
| These package families stay in `dependencies` for this PR. Some are proven runtime keepers; others are deferred because #452 is intentionally limited to renderer-only direct dependency moves, not broad unused-dependency removal. | ||
|
|
||
| - Proven main/process/preload/updater keepers: `electron-log`, `electron-squirrel-startup`, `electron-updater`, `fix-path`, `i18next`, `semver`, `zod`. | ||
| - Proven native or explicit package-shape keepers: `better-sqlite3`, `web-tree-sitter`, plus the explicit `electron-builder.yml` `node_modules` and `asarUnpack` allowlist. | ||
| - Proven API, bridge, agent, or preload keepers: `@anthropic-ai/sdk`, `@google/genai`, `@modelcontextprotocol/sdk`, `@office-ai/aioncli-core`, `@office-ai/platform`, `@sentry/electron`, `openai`. | ||
| - Deferred latent or ambiguous common/runtime packages: `docx`, `html-to-text`, `jsonrepair`, `jsonwebtoken`, `mammoth`, `officeparser`, `pptx2json`, `qrcode-terminal`, `smol-toml`, `strip-json-comments`, `turndown`, `turndown-plugin-gfm`, `xlsx-republish`, `@xmldom/xmldom`. | ||
| - Deferred unused-looking server/channel/runtime packages that need a separate removal issue and package proof: `@agentclientprotocol/sdk`, `@aws-sdk/client-bedrock`, `@grammyjs/transformer-throttler`, `@larksuiteoapi/node-sdk`, `@wecom/aibot-node-sdk`, `bcryptjs`, `cookie`, `cookie-parser`, `cors`, `dingtalk-stream`, `express`, `express-rate-limit`, `grammy`, `multer`, `sharp`, `tiny-csrf`, `ws`, `yauzl`. | ||
| - Browser/node polyfill packages that need a separate audit before removal: `buffer`, `process`, `stream-browserify`. | ||
|
|
||
| ## Verification | ||
|
|
||
| Local source checks: | ||
|
|
||
| ```bash | ||
| rg -n "from ['\"](@arco-design/web-react|@icon-park/react|mermaid|react-syntax-highlighter|@monaco-editor/react|@uiw/react-codemirror|diff2html|react-markdown|streamdown|swr)" \ | ||
| packages/desktop/src/common packages/desktop/src/process packages/desktop/src/preload packages/web-host/src packages/web-cli/src scripts | ||
| ``` | ||
|
|
||
| Remote package proof should inspect the packaged app after `electron-builder --dir` or a thin/functional smoke artifact: | ||
|
|
||
| ```bash | ||
| npx asar list "out/mac-arm64/AionUi.app/Contents/Resources/app.asar" \ | ||
| | grep -E '^/node_modules/(@arco-design|@icon-park|mermaid|react-syntax-highlighter|@monaco-editor|@uiw|react-markdown|streamdown|diff2html)(/|$)' && exit 1 || true | ||
| ``` | ||
|
|
||
| Also inspect `app.asar.unpacked/node_modules`. Absence from `app.asar` alone is not enough because native/WASM/runtime packages are intentionally unpacked. | ||
|
|
||
| The renderer bundle must still launch and cover Markdown, diff UI, Mermaid diagrams, code highlighting, editor surfaces, settings, and updater UI. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.