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

Optimize dependencies #201

Closed
bkniffler opened this issue Feb 16, 2016 · 3 comments
Closed

Optimize dependencies #201

bkniffler opened this issue Feb 16, 2016 · 3 comments

Comments

@bkniffler
Copy link

Maybe victory should depend on radium, d3-shape, victory-utils and victory-animations, as these libraries are currently installed in every single victory-xxx package inside victorys node_modules.

Installation was a real pain, as there is a big number of postinstalls executed.

Also, history is present in node_modules, I thought that it was put into devdependencies some time ago. Was this released to npm?

victory@0.4.0 node_modules/victory
├── builder@2.4.0 (tree-kill@1.0.0, argv-split@1.0.0, async@1.5.2, nopt@3.0.6, chalk@1.1.1, js-yaml@3.5.3)
├── style-loader@0.8.3 (loader-utils@0.2.12)
├── victory-animation@0.1.0 (d3-timer@0.0.6, d3-ease@0.3.1, d3-interpolate@0.2.1, radium@0.16.6, builder@2.2.2)
├── victory-label@1.0.0 (radium@0.16.6, victory-util@4.0.0)
├── victory-chart@4.0.0 (radium@0.16.6, victory-util@4.0.0)
├── file-loader@0.8.5 (loader-utils@0.2.12)
├── url-loader@0.5.7 (mime@1.2.11, loader-utils@0.2.12)
├── builder-victory-component@0.2.1 (rimraf@2.5.2, babel-loader@5.4.0, babel@5.8.35, webpack@1.12.13, babel-core@5.8.35)
├── victory-bar@4.0.0 (radium@0.16.6, victory-util@4.0.0, victory-animation@0.0.13)
├── victory-line@1.0.0 (radium@0.16.6, d3-shape@0.2.2, victory-util@4.0.0, victory-animation@0.0.13)
├── victory-scatter@1.0.0 (radium@0.16.6, victory-util@4.0.0, victory-animation@0.0.13)
├── victory-pie@1.0.0 (d3-shape@0.2.2, radium@0.16.6, victory-util@4.0.0, victory-animation@0.0.13)
└── victory-axis@2.0.0 (radium@0.16.6, victory-label@0.1.9, victory-util@2.1.2, victory-animation@0.0.13)
@coopy
Copy link
Contributor

coopy commented Feb 21, 2016

The size requirements aren’t terrible when using npm3, but could be better;

  • victory installed with npm3: 326.6mb (install takes 3 minutes on my dual core MBP)
  • project depending on victory installed with npm3: 134.4mb (install takes 1 minute on my dual core MBP)
  • project depending on victory installed with npm2: 635.6mb

Some large parts:

  • dist takes up 5mb per victory component (due to source maps - we could npm ignore source maps.)
  • docs takes up 5mb per victory component due to docs/build bundle size (separate issue for ecology bundle size: Slim down bundle size ecology#16). We can npm ignore build since we build docs in victory from source (npm ignore docs/build in subcomponents #206).
  • when installing victory in a dependent project with with npm2, webpack and babel take up 50mb in each victory component’s node_modules.

@bkniffler
Copy link
Author

I think 320mb and 3 minutes install time for one module (consisting of different components) is unacceptable! Especially since it would be so easy to fix by adding radium, d3-shape, victory-utils and victory-animations to your victory package directly, so it won't get installed and post-installed multiple times.

Your other mentions could surely help reducing the time/size further. NPM3 installs dependencies in a flat way, so of course it will help. But lots of people still rely on NPM2.

@boygirl
Copy link
Contributor

boygirl commented Mar 1, 2016

closing in favor of specific issues #211 and #212

@boygirl boygirl closed this as completed Mar 1, 2016
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

No branches or pull requests

3 participants