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

Build is smaller on second install? #3263

Closed
wants to merge 2 commits into from
Closed

Conversation

cgewecke
Copy link
Collaborator

@cgewecke cgewecke commented Dec 8, 2019

Description

NB: PR targets #3262 which standardizes the bn.js version across the project

PR reduces the bundlesize ~20%, but in a way that is super weird. Suggests something is wrong with the way browserify de-duplicates things in a lerna monorepo.

TLDR; if you install the project and then go to packages/web3 (the bundle entry point) and install the most widely duplicated deps there, there's a big bundle reduction.

Also tried browserify's preserveSymlinks option to address this and was quickly OOM within 4GB - @nivida was this the same thing you were seeing when you looked at this in October?

[EDITED notes...]

  • treat the published min as a convenience and not worry about it's size too much (although it would be great to get something on the CDN that was small)
  • Actually, this PR and Standardize bn.js dep across monorepo #3262 show rollup is the best approach. Browserify is not bundling correctly.
  • We could also try to measure size by :
    • running virtual npm publish,
    • create a tiny fake project with installed web3,
    • webpack with minnification
    • measure size of webpack build.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 84.811% when pulling 3aeddd5 on issue/1178-experiment into 6b79678 on issue/1178.

@cgewecke cgewecke requested a review from nivida December 8, 2019 21:31
@cgewecke
Copy link
Collaborator Author

cgewecke commented Dec 9, 2019

My question for the initial view is: what is going on here?!

@nivida
Copy link
Contributor

nivida commented Dec 9, 2019

@nivida was this the same thing you were seeing when you looked at this in October?

I had the same experience when I started to improve the build pipeline. The OOM issue does especially occur if you try to create bundles for each package web3.js does have.
But I was able to run the build pipeline (it still sometimes failed) if I executed npm dedupe in the root of the project. This does remove all duplications and will install all dependencies in the root node_modules.

My question for the initial view is: what is going on here?!

I was asking me the same and tried several ways until I've decided to back-port and extend the rollup setup from 2.x.

@cgewecke
Copy link
Collaborator Author

cgewecke commented Dec 9, 2019

Ok thanks for answering my question 😄 Closing...

@cgewecke cgewecke closed this Dec 9, 2019
@nivida nivida deleted the issue/1178-experiment branch December 12, 2019 08:35
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.

3 participants