Repository navigation
perf(desktop): leave unused dependency files out of the package - #7423
Open
reachjalil wants to merge 1 commit into
Open
reachjalil wants to merge 1 commit into
reachjalil wants to merge 1 commit into
Conversation
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>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
This branch was previously deployed
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.
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.asarshipped 57 MB of source maps, 10 MB of type declarations and all of TypeScript (compiler command, language server, translated messages), although computer use imports onlylib/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 infiles, repeated through YAML anchors in the staged.electron-runtime/node_modulesfilter so neither copy brings the files back.*.js.map,*.d.ts.map, ...) so it cannot match a package folder such asarray.prototype.map.apps/desktop/scripts/electron-after-pack.cjs:verifyUnusedDependencyFilesfails the package if those files return, or iftypescript/lib/typescript.jsis missing.app.asarplusapp.asar.unpackedgoes 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.What else changed?
native/.buildcache 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.