Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Webpack3 + ES6 Exports #149

Merged
merged 8 commits into from
Jul 13, 2017
Merged

Webpack3 + ES6 Exports #149

merged 8 commits into from
Jul 13, 2017

Conversation

ryan-roemer
Copy link
Member

@ryan-roemer ryan-roemer commented Jul 13, 2017

This PR modernizes the Victory build and offerings. Generally:

  • Provide an es/ directory alongside lib/ that has ES module export / imports (but everything else babel built) per the redux model. This model allows webpack2+ to use ESM resolution and enable tree-shaking, while is still backwards compatible with webpack1 which will use lib/
  • Remove all references to .jsx since we don't use those anymore.
  • Clean up and hone down a lot of stuff.

/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 boygirl merged commit 51bc064 into master Jul 13, 2017
@boygirl boygirl deleted the infra/new-build branch July 13, 2017 22:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide efficient webpack helpers for tree-shaking + DCE Provide es6 build to use with Webpack 2
2 participants