Hacker News new | ask | show | jobs
by rpedela 3799 days ago
How big is React gzipped? How much are you saving with this library?
2 comments

Looks like React 0.14.6 is about 38k gzipped:

curl --silent --output /dev/null -H "Accept-Encoding: gzip,deflate" --write-out "size_download=%{size_download}\n" https://cdnjs.cloudflare.com/ajax/libs/react/0.14.6/react.mi...

>> size_download=39542

That doesn't remove everything behind process.env.NODE_ENV !== 'production' though.

Though, you do need webpack/browserify/etc to take advantage of that.

FYI, react.min.js does do exactly what browserify + envify would do.[1]

[1]: https://github.com/facebook/react/blob/401e6f10587b09d4e7257...

Cool.
Perhaps even more important, does library size still matter once dead-code elimination is an option in Webpack2?

See: https://twitter.com/dan_abramov/status/656970508005736448

Just take a look, how many libraries are written in ES6, clearly not much. So dead code Elimination only works if you have ES6 libs and that will take some time.
If you test currently available dead-code elimination tools for JS you will discover that there are tricks that those tools can't play, most important one being eliminating unused methods on object / classes.

AFAIK Webpack2 is using Rollup under the hood. While rollup is great and can build smaller outputs (biggest win seems to be elimination of the module system overhead) it can't perform miracles.

In short: size still matters, even with dead-code elimination tools (at least as they are today).