Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unnecessary modules from npm-shrinkwrap.json #1017

Merged
merged 1 commit into from Jan 11, 2017

Conversation

jviotti
Copy link
Contributor

@jviotti jviotti commented Jan 11, 2017

Somehow some development dependencies slipped into the shrinkwrap file,
and in some cases, dependencies we don't use anymore didn't remove its
own now unneeded dependencies when running npm uninstall.

This PR carefully removes the packages that are not needed anymore,
which are a lot.

See: #820
Signed-off-by: Juan Cruz Viotti jviotti@openmailbox.org

Somehow some development dependencies slipped into the shrinkwrap file,
and in some cases, dependencies we don't use anymore didn't remove its
own now unneeded dependencies when running `npm uninstall`.

This PR carefully removes the packages that are not needed anymore,
which are a lot.

See: #820
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
@jviotti jviotti merged commit 6c8ddce into master Jan 11, 2017
@jviotti jviotti deleted the cleanup-shrinkwrap branch January 11, 2017 21:53
@alexandrosm
Copy link
Contributor

alexandrosm commented Jan 12, 2017 via email

@jviotti
Copy link
Contributor Author

jviotti commented Jan 12, 2017

The uncompressed size of the node_modules directory was reduced from 179M to 85M, which a huge win.

In terms of binary size, the GNU/Linux x86_64 AppImage was reduced from 68M to 54MB 🎉

I just noticed that the fact the development dependencies where included in the shrinkwrap file was caused by an NPM bug (v3). Upgrading to a later version (v4) correctly ignores dependencies of development dependencies, however it hangs at a later stage, causing the npm shrinkwrap command to be unusable.... I'll give yarn a try again. Hopefully the issues I encountered before were fixed and we can finally forget about this npm/shrinkwrap hell :/

@alexandrosm
Copy link
Contributor

alexandrosm commented Jan 13, 2017 via email

@jviotti
Copy link
Contributor Author

jviotti commented Jan 16, 2017

I think we can delete some ffmpeg stuff (although not sure its shipped on electron by default due to licensing issues). I'll definitely research if there is something more we can do. If we really want to reduce the Electron framework size by deleting unnecessary stuff, I think we can get REALLY good results by building Electron ourselves as part of an Etcher release, customizing certain build options and applying some patches to ignore certain stuff.

@lurch
Copy link
Contributor

lurch commented Jan 16, 2017

From what I can tell (I could be wrong) ffmpeg etc. is included because it's a runtime dependency of the Chrome/Chromium engine. So I wonder of there's scope for further size-reduction by disabling certain Chromium features and building that too? Although I suspect that'd massively increase build times? *shrug*
(or maybe that's already what @jviotti meant by building Electron ourselves?)

@jviotti
Copy link
Contributor Author

jviotti commented Jan 17, 2017

The Electron teams has pre-built Chromium packages that the Electron building system fetches from the internet to avoid having to re-compile the whole thing. Fiddling with Chromium might not be easy, but its certainly possible, and we can host our own pre-built versions of it so we only re-compile the Electron part.

@lurch
Copy link
Contributor

lurch commented Jan 17, 2017

OTOH, hopefully there's more low-hanging-fruit we can pluck to reduce the binary file-sizes, before we start needing to mess about with recompiling Chromium ;)

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.

None yet

3 participants