Skip to content

perf(desktop): leave unused dependency files out of the package - #7423

Open
reachjalil wants to merge 1 commit into
devfrom
perf/desktop-smaller-package
Open

reachjalil wants to merge 1 commit into
devfrom
perf/desktop-smaller-package

Conversation

@reachjalil

Copy link
Copy Markdown
Member

What is this about?

The desktop package no longer carries dependency files that a running app never loads.

What problem does it solve?

OpenWork is large to download and install. About 88 MB of the installed app was files only a debugger or a compiler reads.

What was the situation before?

app.asar shipped 57 MB of source maps, 10 MB of type declarations and all of TypeScript (compiler command, language server, translated messages), although computer use imports only lib/typescript.js. SQLite shipped 10 MB of C source next to its prebuilt binary.

How is this implemented?

  • apps/desktop/electron-builder.base.yml: exclusion rules in files, repeated through YAML anchors in the staged .electron-runtime/node_modules filter so neither copy brings the files back.
  • The source-map rule names full suffixes (*.js.map, *.d.ts.map, ...) so it cannot match a package folder such as array.prototype.map.
  • apps/desktop/scripts/electron-after-pack.cjs: verifyUnusedDependencyFiles fails the package if those files return, or if typescript/lib/typescript.js is missing.
  • Measured on a macOS arm64 package of this commit: app.asar plus app.asar.unpacked goes from 291.0 MB to 106.4 MB. The same build inputs packaged with and without the rules differ only in files the rules name.
  • Other platforms' SQLite prebuilds stay; fix(desktop): omit foreign SQLite and PTY native binaries #6319 covers them.

What else changed?

  • The Swift helper's native/.build cache is excluded. Release builds never contained it; a package built from a checkout that compiled the helper carried 97 MB of it.

Release note

The installed desktop app is about 88 MB smaller.

Evidence

No E2E: packaging only. The after-pack check runs in every package build. Before: a package with source maps and type declarations passes; after: it fails and names the files.

The packaged app shipped every file its dependencies publish. A running
app never loads their source maps, type declarations, TypeScript's
compiler command and language server, or SQLite's C sources.

Filter those from both the collected and the staged copy of node_modules,
keep the one TypeScript file computer use imports, and make the after-pack
check fail if any of them returns. Also leave the Swift helper's build
cache out of packages built from a checkout that compiled it.

A macOS arm64 package of this commit goes from 291.0 MB to 106.4 MB of
app.asar plus app.asar.unpacked: 87.6 MB in every build, and 97.0 MB of
Swift build cache that only local builds carried.

Signed-off-by: Jalil <reachjalil@gmail.com>
@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated
openwork-app Skipped Skipped Nov 14, 2026 1:41am UTC
openwork-den Skipped Skipped Nov 14, 2026 1:41am UTC
openwork-landing Skipped Skipped v0 Nov 14, 2026 1:41am UTC

Request Review

@vercel
vercel Bot temporarily deployed to Preview – openwork-app November 14, 2026 01:41 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-landing November 14, 2026 01:41 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-den November 14, 2026 01:41 Inactive

This branch was previously deployed

3 inactive deployments
Preview – openwork-app — afa68853 Deployed Nov 14, 2026 by vercel[bot]
Preview – openwork-landing — afa68853 Deployed Nov 14, 2026 by vercel[bot]
Preview – openwork-den — afa68853 Deployed Nov 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant