Stop shipping build-only deps in the app - #23
Draft
mokagio wants to merge 1 commit into
Draft
Conversation
The renderer is esbuild-bundled at build time, so React, `@wordpress/*`, `@emotion/*`, and `xterm` are already inlined into `src/renderer`. Sitting in `dependencies`, electron-builder also shipped their full `node_modules` trees inside the app — dead weight the runtime never loads. Move them to `devDependencies` so packaging drops them, and remove `@xterm/xterm`, which has no references in `src` (the renderer imports the `xterm` package). Trims the packaged production tree from 1366 MB to 1196 MB (~170 MB, 12%). The bulk that remains is `@php-wasm` (PHP-WASM builds under `@wp-playground/cli`); reducing that needs a call on which PHP versions and execution strategies to support and is left as a follow-up. --- Generated with the help of Claude Code, https://claude.ai/code Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mokagio
changed the base branch from
ainfra-2597-fix-macos-code-signing-for-contributor-toolkit
to
trunk
July 10, 2026 11:05
mokagio
force-pushed
the
mokagio/trim-desktop-artifact-deps
branch
from
July 10, 2026 11:05
b6ae55b to
1f8ca57
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked on #22 (macOS code signing). Review/merge that first — GitHub will retarget this to
trunkonce it lands.Rationale
The packaged app was ~1 GB on every platform. The renderer is esbuild-bundled at build time, so React,
@wordpress/*,@emotion/*, andxtermare already inlined intosrc/renderer— yet they also sat independencies, so electron-builder shipped their fullnode_modulestrees inside the app too.@xterm/xtermwas a dependency with zero references insrc(the renderer imports thextermpackage).Moving the build-only libs to
devDependenciesand dropping@xterm/xtermtrims the packaged production tree 1366 MB → 1196 MB (~170 MB, 12%), 492 → 312 packages.Not addressed here
The remaining bulk is
@php-wasm(~1 GB:@php-wasm/node654 MB +@php-wasm/web406 MB), pulled transitively by@wp-playground/cli. It ships every PHP version (7.2–8.4) in two execution strategies (asyncify + jspi), plus a browser build (@php-wasm/web) thatsrcnever imports directly. Cutting it needs a product decision on supported PHP versions/strategies and whether@php-wasm/webis reachable — left as a follow-up.How to test
electron-store(runtimeimport()), the main process,preload.js, and the spawned runner scripts were checked — none import the moved libraries.npm run build:oncebundles the renderer cleanly with the libs as devDependencies. Confirm the macOS/Windows/Linux builds still produce working apps and that artifact sizes drop by ~170 MB on the Buildkite run.