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

Use tree shaking #237

Closed
doug-wade opened this issue May 31, 2016 · 10 comments
Closed

Use tree shaking #237

doug-wade opened this issue May 31, 2016 · 10 comments
Labels
enhancement New functionality.
Milestone

Comments

@doug-wade
Copy link
Collaborator

doug-wade commented May 31, 2016

This could in theory reduce the size of the initial bundle. Webpack 2 is not out of beta, yet, though, so we'd have to migrate to rollup.

Migrated from #50

@gigabo gigabo added the enhancement New functionality. label Jun 1, 2016
@doug-wade
Copy link
Collaborator Author

More evidence in favor of rollup instead of webpack https://nolanlawson.com/2016/08/15/the-cost-of-small-modules/

@drewpc
Copy link
Collaborator

drewpc commented Jan 9, 2017

Webpack 2 is out of beta now...maybe worth taking a look at migrating from Webpack 1 to Webpack 2 and using the tree shaking stuff there: https://medium.com/modus-create-front-end-development/webpack-2-tree-shaking-configuration-9f1de90f3233

@roblg
Copy link
Member

roblg commented Jan 10, 2017

FYI, I started this upgrade for Redfin's code internally, and one issue that I ran into that I haven't figured out yet is that the ExtractTextPlugin is still busted in watch mode, and the little hack we use in react-server-cli to "subclass" ETWP and make in non-cacheable didn't seem to work to fix it this time. :(

@karlhorky
Copy link
Contributor

webpack 2 has released a final release candidate before shipping the final version 2: https://twitter.com/TheLarkInn/status/819215334590783489

@doug-wade
Copy link
Collaborator Author

doug-wade commented Jan 11, 2017

Maybe even today 😏

Woah. Let's land #809 so that @drewpc doesn't have to entirely rewrite that super awesome pr, and then jump on this.

@drewpc
Copy link
Collaborator

drewpc commented Jan 11, 2017

@doug-wade thanks for the shout out! Unfortunately....that super awesome PR was kinda thrown out. I'll need to rewrite it anyway. There's a number of architecture decisions that need to be made first, including when/if to move to Webpack 2.

@roblg
Copy link
Member

roblg commented Jan 11, 2017

Oh! One other thing I just remembered about webpack 2 that we should be careful about: I can't find the exact numbers, but it slowed down our internal 90s build by >1min. For now, it's just an FYI, but I'd hate to force all users to suffer through perf problems because of us upgrading from webpack 1-2.

@karlhorky
Copy link
Contributor

cc @jhnns regarding v2 performance problems

@jhnns
Copy link
Contributor

jhnns commented Jan 12, 2017

I haven't heard of such a big increase in build time, but it can be. We still don't have big test projects to check performance regressions in build times 😢

One thing I wanted to point out is that tree shaking will currently have little effect because many libs are still published in CommonJS. So, this optimization will still take some time to be effective.

@drewpc drewpc added this to the 1.0 milestone Apr 24, 2019
@drewpc
Copy link
Collaborator

drewpc commented Apr 30, 2019

This is addressed in #1003

@drewpc drewpc closed this as completed Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New functionality.
Projects
None yet
Development

No branches or pull requests

6 participants