Re:Preact, a fast 3k React alternative
by rpedela on Thursday January 28, 2016 @11:11AM
(#10988982)
How big is React gzipped? How much are you saving with this library?
[ Parent
| on HN ]
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
Re:Preact, a fast 3k React alternative
by warfangle on Thursday January 28, 2016 @03:06PM
(#10990815)
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...
Re:Preact, a fast 3k React alternative
by warfangle on Thursday January 28, 2016 @05:27PM
(#10991933)
Cool.
Re:Preact, a fast 3k React alternative
by LaurensBER on Thursday January 28, 2016 @11:24AM
(#10989076)
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.
Re:Preact, a fast 3k React alternative
by pkozlowski_os on Thursday January 28, 2016 @01:02PM
(#10989919)
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).