FormidableLabs / builder-victory-component

Builder archetype for Victory components
MIT License
1 stars 6 forks source link

Webpack3 + ES6 Exports #92

Closed ryan-roemer closed 7 years ago

ryan-roemer commented 7 years ago

This PR modernizes the Victory build and offerings. Generally:

/cc @boygirl @chrisbolin

Cross-reference PRs

First, infrastructure:

Second, core:

Third, dependers:

Finally, parent:

Tickets

Implemented / fixed:

Opened / still open:

Bundles

The main goal here is not the victory bundle, but enabling webpack2+ users to get more efficient builds going off the es/ directory. And with the dedupe plugin being removed in webpack2+, our dev bundle is definitely bigger. But, fortunately, the prod minified bundles aren't that different:

Before / webpack1

$ find ../victory*/dist -type f -exec wc -c {} \;
  993198 ../victory-chart/dist/victory-chart.js
 1323555 ../victory-chart/dist/victory-chart.js.map
  438868 ../victory-chart/dist/victory-chart.min.js
 2634923 ../victory-chart/dist/victory-chart.min.js.map
  659513 ../victory-core/dist/victory-core.js
  915723 ../victory-core/dist/victory-core.js.map
  276427 ../victory-core/dist/victory-core.min.js
 1734458 ../victory-core/dist/victory-core.min.js.map
  674687 ../victory-pie/dist/victory-pie.js
  836742 ../victory-pie/dist/victory-pie.js.map
  284790 ../victory-pie/dist/victory-pie.min.js
 1814890 ../victory-pie/dist/victory-pie.min.js.map
 1013340 ../victory/dist/victory.js
 1235399 ../victory/dist/victory.js.map
  450323 ../victory/dist/victory.min.js
 2747731 ../victory/dist/victory.min.js.map

After / webpack3

$ find ../victory*/dist -type f -exec wc -c {} \;
 1663000 ../victory-chart/dist/victory-chart.js
 1602704 ../victory-chart/dist/victory-chart.js.map
  434851 ../victory-chart/dist/victory-chart.min.js
 3349108 ../victory-chart/dist/victory-chart.min.js.map
  975040 ../victory-core/dist/victory-core.js
  941706 ../victory-core/dist/victory-core.js.map
  265075 ../victory-core/dist/victory-core.min.js
 1930341 ../victory-core/dist/victory-core.min.js.map
 1219152 ../victory-pie/dist/victory-pie.js
 1092945 ../victory-pie/dist/victory-pie.js.map
  304427 ../victory-pie/dist/victory-pie.min.js
 2396990 ../victory-pie/dist/victory-pie.min.js.map
 1869374 ../victory/dist/victory.js
 1680468 ../victory/dist/victory.js.map
  487115 ../victory/dist/victory.min.js
 3846520 ../victory/dist/victory.min.js.map
boygirl commented 7 years ago

@ryan-roemer I think this is failing linting

ryan-roemer commented 7 years ago

@boygirl -- Yep. Fixed.

boygirl commented 7 years ago

@ryan-roemer once this goes in, I'd like to do a major version bump on the archetypes. Does that sounds appropriate?

ryan-roemer commented 7 years ago

@boygirl -- Yep. Major for archetypes. But fortunately, minor for victory repos.