Live data from Hacker News

React v15.0

facebook.github.io

131–140 of 174 posts

Re: React v15.0

#131
post #21

Earlier quoted context omitted.

I don't think we've ever promoted React based on file size. Smaller files are better but people tend to overemphasize JS file size -- gzipped, this latest release is 43k which is comparable to the size of an image or two on most websites. (Also note that growing framework code can reduce your app code size overall; I don't want to make specific claims about React but at Facebook we often see code size increase when 1…

I feel it's important to point out that React is now an ecosystem. Relay is comparable in size to React, then we throw Immutable into the mix, and so on. These are all dependencies that will be used on practically every page on a website, so cannot benefit from code-splitting techniques. It's certainly my experience that using React over a mess of jQuery and its plugins leads to smaller file-sizes when enhancing func…

I should add, that if there's a truly blessed CDN for these dependencies (cdnjs is the closest we have to that) that everyone uses, it puts us in a much better place. So we should actively be encouraging people to use them.

Re: React v15.0

#132
post #3

The referenced pull request for removing the s ( https://github.com/facebook/react/pull/5753 ) is terrific - a real paragon of open-source professionalism.

Agreed. I'm really impressed by the professionalism shown by all members of the React ecosystem. Just the other day I had noticed a org member of the reactjs org (houses react-router, redux, etc) who was acting very unprofessional and expressed that it was a turn off seeing official members of the org basically telling a issue reporter/discussion was "annoying them" and Ryan Florence stepped up and said he was not to…

"professionalism", "reached out to me"? When will this blathering in open source stop?

Re: React v15.0

#133
post #68
post #21

Earlier quoted context omitted.

I don't think we've ever promoted React based on file size. Smaller files are better but people tend to overemphasize JS file size -- gzipped, this latest release is 43k which is comparable to the size of an image or two on most websites. (Also note that growing framework code can reduce your app code size overall; I don't want to make specific claims about React but at Facebook we often see code size increase when 1…

as a fan of react, i think file size should be a bigger priority. for comparison, mithril is 7.8 gzipped. i don't see react getting that small, but i'm sure there's room for slimming down, perhaps signicantly.

By the way, those 7.8Kb of Mithril include stuff that React doesn't have: router, fetcher, promise implementation.

Re: React v15.0

#134
post #19

Is there a reason why the file size has exploded? react.min.js is now 145.4kb. For comparioson, angular.min.js is 155.2kb. One of React's biggest selling points was that it was much smaller than Angular/Ember/Backbone etc, but I'm not sure that argument can be leveraged anymore. I think React is a culmination of some great ideas, but in my view this is a big step back. Especially since Angular/Ember/etc. offer a lot…

In my opinion, I don't think size is the big selling point for React. It's the simplicity and clarity of the programming model that it enables. For me, being able to write most of my code functionally (pure functions, immutable data) is a big win.

That said, I've been tinkering with this project on the side:

https://github.com/developit/preact

It's a 3-4K React-ish library. Pretty impressed with it so far, but it does lack the dev tools, event normalization, etc.

Re: React v15.0

#135

Earlier quoted context omitted.

I feel it's important to point out that React is now an ecosystem. Relay is comparable in size to React, then we throw Immutable into the mix, and so on. These are all dependencies that will be used on practically every page on a website, so cannot benefit from code-splitting techniques. It's certainly my experience that using React over a mess of jQuery and its plugins leads to smaller file-sizes when enhancing func…

I should add, that if there's a truly blessed CDN for these dependencies (cdnjs is the closest we have to that) that everyone uses, it puts us in a much better place. So we should actively be encouraging people to use them.

I'm very split on using these CDNs. I understand the advantage, but do I really want to make my site import Javascript from a third party source? Their downtime becomes my downtime, their security issues become my security issues, and I've now shared my visitor's usage patterns with a third party...

Re: React v15.0

#136
post #46
post #40

If you are using typescript, you should read: https://github.com/Microsoft/TypeScript/issues/7270 TLD'R: React 15.0 broke TSX in typescript but the workaround is easy.

We didn't realize this would break. We're looking at cutting a 15.0.1 that puts React.__spread back with a warning.

I realise it's a lot of work, but as more and more downstream projects come to depend on React, having a "community build" that would build those against your RCs and run some integration tests would be a great way to improve reliability of the overall ecosystem.

Re: React v15.0

#137
post #21

Earlier quoted context omitted.

I don't think we've ever promoted React based on file size. Smaller files are better but people tend to overemphasize JS file size -- gzipped, this latest release is 43k which is comparable to the size of an image or two on most websites. (Also note that growing framework code can reduce your app code size overall; I don't want to make specific claims about React but at Facebook we often see code size increase when 1…

This release gained 3k gzipped (it was 39k), in large part due to complete SVG support. In this case I think it was worth it because this was a longstanding pain point. There may be some ways to drop some dead code that we haven't eliminated efficiently yet. Here is a recent example I found that drops 1kb: https://github.com/facebook/react/pull/6401 It would be cool if somebody in the community could spare some time…

[deleted]

Re: React v15.0

#138
post #33

There's a bit of irony here, but in a good way: Switching back to DOM APIs (e.g. document.createElement) was a performance boost . ('cause the browser vendors have done a ton of awesome work speeding up DOM APIs in recent years)

Uhm, perhaps a stupid question, but how exactly would one build DOM elements without access to the DOM?

Re: React v15.0

#139
post #135

Earlier quoted context omitted.

I should add, that if there's a truly blessed CDN for these dependencies (cdnjs is the closest we have to that) that everyone uses, it puts us in a much better place. So we should actively be encouraging people to use them.

I'm very split on using these CDNs. I understand the advantage, but do I really want to make my site import Javascript from a third party source? Their downtime becomes my downtime, their security issues become my security issues, and I've now shared my visitor's usage patterns with a third party...

That's a good point, and they've also been my concerns with using them too, which I overlooked with my comment.

Re: React v15.0

#140
post #21

Earlier quoted context omitted.

I don't think we've ever promoted React based on file size. Smaller files are better but people tend to overemphasize JS file size -- gzipped, this latest release is 43k which is comparable to the size of an image or two on most websites. (Also note that growing framework code can reduce your app code size overall; I don't want to make specific claims about React but at Facebook we often see code size increase when 1…

I feel it's important to point out that React is now an ecosystem. Relay is comparable in size to React, then we throw Immutable into the mix, and so on. These are all dependencies that will be used on practically every page on a website, so cannot benefit from code-splitting techniques. It's certainly my experience that using React over a mess of jQuery and its plugins leads to smaller file-sizes when enhancing func…

I see your point. Indeed this does not sound very good. I don’t know enough about Relay or their plans so I can’t really say much.

Nevertheless it is an ecosystem precisely because you get to pick the pieces you need. For comparison, Redux + Redux Thunk is about 3kb. Immutable is not required either. Of course your app code would have to include data fetching logic which would make it much larger. But those are all tradeoffs you have the power to make.

Post reply on HN