You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Desktop app: taking a lot of space after a fresh install (812 MB)
What is the impact of this on end-users?
Faster app download and install
Users might be reluctant to install a large desktop app
List any benchmarks that show the severity of the issue
App installer size: 326MB
Slack installer size: 90MB (Also uses Electron / Chromium)
Chrome installer size: 1MB
Proposed solution (if any)
Research ways to reduce the installer size
For example Chrome's installer is so small because it downloads more data as part of the installation process
Research Electron documentation on ways to reduce size
List any benchmarks after implementing the changes to show impacts of the proposed solution (if any)
Note: These should be the same as the benchmarks collected before any changes.
Thanks for the investigation! Just my opinion, but doesn't seem super high priority considering contributors and Expensify staff are the main users of the desktop app at the moment and large installer sizes are not likely to inhibit anyone motivated to install and use the app. I would recommend we wait until there are more usage statistics to address the problem of a large installer. Just my 2 cents though - will leave this open and let others share their thoughts.
But by default dist is also what electron uses to build the desktop package, and while building it adds temporary stuff to it
This temporary stuff gets added to the package because we're telling Electron to put everything from dist in the package
Let's see what's actually packed in App:
- note: this is App after the node_modules fix, Content used to be 800+ MB before
Frameworks (180MB) - can't really do anything about this it's mostly electron
Resources (213 MB) on the other hand is where our bundle is
Let's see what's inside this `app.asar` archive
This is evidence of the dist/mac folder getting packed in - we don't need that
Electron using the output folder (dist) for a temporary build which we unintentionally add to the package and this is worth another 180MB
End result of fixing this is the installer becomes 88MB
I don't know how the app is built and distributed. From package.json and electron.config.js I see an arch is not specified - when not specified it would be the arch of the current computer (x64 Intel mac?)
Here's the result from building the `x64` (same as the one shared in the previous post)
This works perfectly fine on my M1 mac, though it's emulated through Rosetta
A `arm64` app is about the same size and works without emulation
And finally there's the option to build an Universal app that works on both architectures, but takes 2x the size
Nice! Thanks for the explanations!!
Let's get those changes in.
As for the platform, I would think it makes the most sense to build for the 2 different architectures and then somehow detect them when downloading them, so you always download the correct one.
@iwiznia
I think others might be confused as well when all of the sudden dependencies become devDependencies, shouldn't we prepare for that with a slack comment or something?
It might be a good idea to update documentation so that we don't make the same mistake when new packages are installed
They should be installed in devDependencies otherwise they'll again get packed in vain
We decided to go in another direction and create a 2nd package.json for the ./desktop app
This way we can isolate dependencies there
It's know as the Two package.json Structure
There's another way to make the Desktop app much smaller
By making web comply with Progressive Web App (PWA) standards, Chrome would allow you to install the website as a Desktop App: https://caniuse.com/web-app-manifest
By default the app is kept up to date the same way a website is - when you launch/refresh you see the updated version
Expensify.PWA.mp4
Installing and removing the app
Expensify.PWA.installing.mp4
About 200 line changes were necessary to achieve what's presented in the video
@kidroca you were able to reduce the desktop size some, right? Can you provide a quick update for auditing purposes (or... let me know if you think it should be reopened)
@mallenexpensify
It's ok to close this one, the work was done quite some time ago
I've posted some other options here and on slack and was waiting in case they get picked up, but they didn't
What I'm demoing here is removing the desktop app entirely and make the web app inatallable as PWA (Progressive web app): #6927 (comment)
The experience is very similar to what we have with the electron desktop app, but without the need to download the app (and maintain desktop specific code)
But it has some caveats
Like App (PWAs) can only be installed if you open web on Chrome (so far)
Activity
MelvinBot commentedon Dec 29, 2021
Triggered auto assignment to @marcaaron (
Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.kidroca commentedon Dec 29, 2021
This issue was requested by @mallenexpensify: https://expensify.slack.com/archives/C01GTK53T8Q/p1640735769186600?thread_ts=1640642055.143300&cid=C01GTK53T8Q
parasharrajat commentedon Dec 29, 2021
This article seems helpful https://medium.com/gowombat/how-to-reduce-the-size-of-an-electron-app-installer-a2bc88a37732
iwiznia commentedon Dec 29, 2021
I don't think we should go the chrome route. Either we make the app smaller or we don't, making the installer seem small is not worth it IMO.
marcaaron commentedon Dec 29, 2021
Thanks for the investigation! Just my opinion, but doesn't seem super high priority considering contributors and Expensify staff are the main users of the desktop app at the moment and large installer sizes are not likely to inhibit anyone motivated to install and use the app. I would recommend we wait until there are more usage statistics to address the problem of a large installer. Just my 2 cents though - will leave this open and let others share their thoughts.
MelvinBot commentedon Dec 29, 2021
Triggered auto assignment to @mallenexpensify (
External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.17 remaining items
kidroca commentedon Jan 28, 2022
Found another improvement - we're double adding the compiled
appwhich is another 2x size bumpThis config rule adds the
distfolder to the desktop packageApp/config/electron.config.js
Lines 25 to 26 in b93c6d3
But by default
distis also what electron uses to build the desktop package, and while building it adds temporary stuff to itThis temporary stuff gets added to the package because we're telling Electron to put everything from
distin the packageLet's see what's actually packed in App:

- note: this is App after the
node_modulesfix, Content used to be 800+ MB beforeFrameworks (180MB) - can't really do anything about this it's mostly electron
Resources (213 MB) on the other hand is where our bundle is
Let's see what's inside this `app.asar` archive
This is evidence of the
dist/macfolder getting packed in - we don't need thatElectron using the output folder (dist) for a temporary build which we unintentionally add to the package and this is worth another 180MB
End result of fixing this is the installer becomes 88MB
I've provided a link - you can see for yourself that the app is working same as before but it's 4x less size
It's easy to fix this by specifying an output directory for Electron
kidroca commentedon Jan 28, 2022
Note on architectures
I don't know how the app is built and distributed. From
package.jsonandelectron.config.jsI see an arch is not specified - when not specified it would be the arch of the current computer (x64 Intel mac?)Here's the result from building the `x64` (same as the one shared in the previous post)
This works perfectly fine on my M1 mac, though it's emulated through Rosetta
A `arm64` app is about the same size and works without emulation
And finally there's the option to build an Universal app that works on both architectures, but takes 2x the size
Architectures and sizes
.dmgs are installer sizesiwiznia commentedon Jan 28, 2022
Nice! Thanks for the explanations!!
Let's get those changes in.
As for the platform, I would think it makes the most sense to build for the 2 different architectures and then somehow detect them when downloading them, so you always download the correct one.
kidroca commentedon Jan 31, 2022
@iwiznia
I think others might be confused as well when all of the sudden
dependenciesbecomedevDependencies, shouldn't we prepare for that with a slack comment or something?It might be a good idea to update documentation so that we don't make the same mistake when new packages are installed
They should be installed in
devDependenciesotherwise they'll again get packed in vainkidroca commentedon Jan 31, 2022
Posted a thread on slack: https://expensify.slack.com/archives/C01GTK53T8Q/p1643645168448979
We decided to go in another direction and create a 2nd
package.jsonfor the./desktopappThis way we can isolate dependencies there
It's know as the Two package.json Structure
kidroca commentedon Feb 15, 2022
Pull Request is ready for review: #7744
kidroca commentedon Mar 16, 2022
There's another way to make the Desktop app much smaller
By making web comply with Progressive Web App (PWA) standards, Chrome would allow you to install the website as a Desktop App: https://caniuse.com/web-app-manifest
By default the app is kept up to date the same way a website is - when you launch/refresh you see the updated version
Expensify.PWA.mp4
Installing and removing the app
Expensify.PWA.installing.mp4
About 200 line changes were necessary to achieve what's presented in the video
melvin-bot commentedon May 30, 2022
@kidroca, this Monthly task hasn't been acted upon in 6 weeks; closing.
If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead.
mallenexpensify commentedon May 31, 2022
@kidroca you were able to reduce the desktop size some, right? Can you provide a quick update for auditing purposes (or... let me know if you think it should be reopened)
kidroca commentedon Jun 1, 2022
@mallenexpensify
It's ok to close this one, the work was done quite some time ago
I've posted some other options here and on slack and was waiting in case they get picked up, but they didn't
Summary
mallenexpensify commentedon Jun 1, 2022
@kidroca were we able to reduce the size at all? Are the After #s where we're currently at or where we could be?
kidroca commentedon Jun 1, 2022
Sorry for the confusion. The size is considerably reduced - "after" is the result of this ticket and the current size of the desktop app
kidroca commentedon Jun 1, 2022
What I'm demoing here is removing the desktop app entirely and make the web app inatallable as PWA (Progressive web app): #6927 (comment)
The experience is very similar to what we have with the electron desktop app, but without the need to download the app (and maintain desktop specific code)
But it has some caveats
Like App (PWAs) can only be installed if you open web on Chrome (so far)