Live data from Hacker News

React v15.0

facebook.github.io

71–80 of 174 posts

Re: React v15.0

#71
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…

When React is big pretty much all their selling points go out the window. I strongly disagree. If React's API were to get all big and complicated, that would be a concern. The tight scope and clean interface are definitely selling points for React compared to many larger (in scope and interface) frameworks and rendering libraries. But I really don't care about the file size, as it's far too small to be anything but n…

Additionally, React is intended for highly complex, highly interactive applications, time-to-content is less important than on, say, a news reader. It might take 2 or 3 seconds to get the first page, but once you're there your interactions will be quick. Even if you do code splitting, well-bundled code will have a "commons" chunk, so fetching a new page won't redownload React and other large libraries.

Re: React v15.0

#72
post #23

Earlier quoted context omitted.

It is time to deploy common JS libraries out of band, like native libraries. Download them once, precompile them once, and then use precompiled version at any site, which requires it.

I thought there was a proposal in the works for adding checksums on script tags. Something like: Which would allow the browser to use cached copies of files even if from different domains. Not sure where I saw that.

You are thinking of the integrity="" attribute that's part of SRI: https://developer.mozilla.org/en-US/docs/Web/Security/Subres...

That attribute is meant to verify resource contents. The strategy of using it as a cache ID is still being discussed, but last I looked into it, there were some cache poisoning concerns.

You might find this thread useful: https://news.ycombinator.com/item?id=10311020

Re: React v15.0

#73
post #6

Earlier quoted context omitted.

Angular two lost me.

Yeah I wasn't too thrilled with Angular 2.x either. I had always been watching React and liking it, but I had no experience with it. So one day I decided to give it a whirl and see how far I could get converting the Angular 1.5 app I had already started and get it to the equivalent state in React. Long story short, I took 40+ hours of Angular 1.5 code and converted it to React code in a single 8 hour work day without…

I went through a similar experience with our code base and saw similar results. Our project is quite a bit larger (some 20k loc) but converting it to React has been a huge win. Performance has improved without all the custom code needed in Angular, bugs are easier to find and fix, and reasoning about the code is a ton simpler. I hate to think about all the time we spent trying to optimize the Angular digest cycle... .

We also discovered that since writing components is so much easier in React than with Angular 1.5 we tend to write a lot more of them. This makes the components easier to test and has greatly improved reuse across the code base. Which in turn makes adding features possible that would have destabilized the old code base.

I did look at Angular 2 and just saw more of the same and didn't want to deal with it anymore. I found that I personally aligned well with the React ecosystem (Redux, JSX, CSS in Javascript) which probably colored some of my decision.

Re: React v15.0

#74
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…

The react community is great, in stark contrast to the angular community.

Re: React v15.0

#75
post #72

Earlier quoted context omitted.

I thought there was a proposal in the works for adding checksums on script tags. Something like: Which would allow the browser to use cached copies of files even if from different domains. Not sure where I saw that.

You are thinking of the integrity="" attribute that's part of SRI: https://developer.mozilla.org/en-US/docs/Web/Security/Subres... That attribute is meant to verify resource contents. The strategy of using it as a cache ID is still being discussed, but last I looked into it, there were some cache poisoning concerns. You might find this thread useful: https://news.ycombinator.com/item?id=10311020

Great, thanks for that info!

Re: React v15.0

#76
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…

You sound like you don't actually know anything about react... I have never heard anyone promote react based on file size, and angular does not provide 'a lot' more tools out of the box. React is better than angular pretty much in every single respect.

Re: React v15.0

#79
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.

Also note, if anyone is using "reactify" and has used the spread operator in JSX, as 15.0.0 removed React.__spread, your build will break. (Reactify uses the deprecated react-tools which uses React.__spread.)

Re: React v15.0

#80

I just tried the new release. The data-reactid is indeed gone when rendering on the client side. But on the server side, the html string generate by ReactDOMServer.renderToString still has data-reactid. Is it because client side can validate the server result and decide if it needs to re-render the page?

Not quite -- it's so that the client can know which node is which. (When rendering on the client, it can just store a direct reference to each created node.)
Post reply on HN