Live data from Hacker News

React v15.0

facebook.github.io

161–170 of 174 posts

Re: React v15.0

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

Won't this break things that relied on span's being there? I'm thinking it should have been opt-in initially. Or is it that way since it is a major version?

Specifically, in the old way, there were spans, and we had css styles targeting the spans sometimes.

Re: React v15.0

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

Won't this break things that relied on span's being there? I'm thinking it should have been opt-in initially. Or is it that way since it is a major version? Specifically, in the old way, there were spans, and we had css styles targeting the spans sometimes.

On the other hand, it vastly simplifies some of my CSS. Those spans screw up whitespace in text. And can really throw a wrench into flexbox layouts.

That's the only time I'm targeting them... To fix what they screw up.

Re: React v15.0

#163

Earlier quoted context omitted.

FWIW I used TypeScript in anger with React, and hated it so much I rewrote all the React code in regular JavaScript. TypeScript and React, IMO, are a poor fit. To be clear: I do like TypeScript and use it almost exclusively on the server, so this isn't a case of me "not liking TypeScript". It's the combination of the two. Basically, all of the stuff I did to keep TypeScript happy when using React was worthless overhe…

What is exactly your problem with TSX? I've been using TSX for a while so maybe I can help. The only thing that TypeScript really adds to JSX is component parameter validation, which is quite neat to be honest.

TypeScript also validates the expressions that supply the values. And if you use Visual Studio you get intellisense and validation for HTML, and intellisense and instant validation of your javascript expressions. These benefits are awesome, and by the way, all this is independent of React. You can use TSX just as a templating library using UIBuilder, see: https://github.com/wisercoder/uibuilder

Re: React v15.0

#164
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.)

Yeah. Putting a warning should solve the problem because people will start complaining to the transform vendors about this and hopefully they will deprecate their transforms or use Babel internally.

Re: React v15.0

#165
post #5
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.

+1 to this. High-quality code from @mwiencek right out of the gate, and he was super responsive to my comments when I asked for changes. We're really grateful for the contribution.

Hey, I didn't expect that to get as much love as it has, but that's really wonderful. Being highlighted in the release notes is super cool. :) I'll just say, it was thanks to the constructive/encouraging help I got on the PR that I was able to finish it.

Re: React v15.0

#166

Earlier quoted context omitted.

Won't this break things that relied on span's being there? I'm thinking it should have been opt-in initially. Or is it that way since it is a major version? Specifically, in the old way, there were spans, and we had css styles targeting the spans sometimes.

On the other hand, it vastly simplifies some of my CSS. Those spans screw up whitespace in text. And can really throw a wrench into flexbox layouts. That's the only time I'm targeting them... To fix what they screw up.

That's true. Same in our case as well.

Re: React v15.0

#167
post #153
post #152

Earlier quoted context omitted.

For React you kind of have to use the minified file size, because the dev file size is SHOCK FULL of dev-only validation and error messages and other logic that is made to be minified away. The prod build isn't even close to the same code. With that said React + ReactDOM is 180kbish unminified. I can't find Relay's size as a single file. Is it really over 800kb?

React unminified is ~660kb.

You're totally right. I downloaded the latest release earlier and looked at the file size, and did it again right now, and you're correct.

I still can't figure out where the hell I saw the smaller numbers earlier. I must have been drunk.

Re: React v15.0

#168
post #73

Earlier quoted context omitted.

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...…

> I hate to think about all the time we spent trying to optimize the Angular digest cycle...

Yep. I spent a few days last week reimplementing a heavy part of our app in React, specifically because of this problem. "Make everything a component" is a great idea, but does not work so well in real-life Angular 1.5 when you're building a complex tree-like editor. The digest cycles grow longer and longer.

The code reimplemented in React is 30% smaller and 8x faster (with some other tweaks to cut down on the frequency of digest cycles). I'm really enjoying React so far.

Re: React v15.0

#169
post #108

Earlier quoted context omitted.

Yeah, you'd think that it would be a lot faster to avoid serializing and parsing everything, but it turns out to be not much difference. Not sure why.

Might depend on how you build the nodes. If you build all the nodes and then append it should be a lot faster. Maybe browsers have optimized for this use case better but I ran benchmarks on this a couple of years ago and createElement / appendChild was always a lot faster.

IE and Edge are much faster when appending nodes first (thus always appending empty nodes) but Chrome, Firefox, and Safari are similar speed regardless of the order. We do the former in IE and Edge only and the latter in all other browsers because it's more convenient (and makes more logical sense to me).

Re: React v15.0

#170
post #93
post #41

Can anyone say what this SVG support means for d3.js integration?

No direct implications. But it should provide solid ground for libraries like Victory. https://github.com/FormidableLabs/Victory

Wow, this is an awesome library. Thanks for sharing this.
Post reply on HN