Live data from Hacker News

React Makes You Sad?

github.com

131–140 of 211 posts

Re: React Makes You Sad?

#131

Earlier quoted context omitted.

> Even better, I can now create both iOS apps and Android apps at the same time Are you referring to native apps, or do you mean by making a Web app with React you don't need to make native apps?

React Native [0]. Your view-specific code still has to be done per-platform, but your core logic can be shared, and all of it is written with Javascript using React as the framework. The JS creates and controls native elements, with the native parts mostly abstracted away. [0] https://facebook.github.io/react-native/

Exactly this, made even simpler by the naming scheme that lets you have iOS and Android versions of the same component.

Re: React Makes You Sad?

#132

There is an abundance of poorly written react apps popping up everywhere. Go to netflix and search for movies... the experience is terrible. The search box lags typing by a long shot. So much so its almost impossible to type in the full text of a movie name. I'm sure there is the correct way to do this (not making the field a controlled component?) but the problem being there on such a major site is a sign that its h…

I just went to netflix and it's not at all how you describe. It's incredibly fast and live filters as I type. There may be an abundance of poorly written react apps out there but netflix does not appear to be one.

maybe i'm just typing too fast. I tried "the best marigold" (for the best marigold hotel). I watched the i in marigold disappear from the search box. Deleting the string (by holding down the delete key, the X works just fine) takes forever as well. I'm using chrome if it matters.

Re: React Makes You Sad?

#133
post #115

Earlier quoted context omitted.

Are any breaking changes coming?

I'm planning to keep the basic, most used APIs the same, but yes, there will be some breaking changes. Promises will follow ES6 API and advanced redraw control APIs will likely be changed to improve ergonomics and leverage good ideas from other vdom libraries.

Will there be changes to the vdom structure that might break MSX?

Re: React Makes You Sad?

#135
post #30

This reminds me of that Netflix talk on React [1]. In it, the guy first praises React to the heavens, then spends the rest of the session explaining all the ways they had to disable and work around React to get what they wanted with decent performance. It seemed to me like their use case could have been done with jQuery in a few hundred lines. Maybe I missed something. [1] https://www.youtube.com/watch?v=g01dGsKbXOk

just curious how you arrived at jQuery comparison. isn't that just a library for DOM utilities while react is a view engine optimized for minimum dom manipulation using observable pattern?

Re: React Makes You Sad?

#136
post #30

This reminds me of that Netflix talk on React [1]. In it, the guy first praises React to the heavens, then spends the rest of the session explaining all the ways they had to disable and work around React to get what they wanted with decent performance. It seemed to me like their use case could have been done with jQuery in a few hundred lines. Maybe I missed something. [1] https://www.youtube.com/watch?v=g01dGsKbXOk

just curious how you arrived at jQuery comparison. isn't that just a library for DOM utilities while react is a view engine optimized for minimum dom manipulation using observable pattern?

I made the comparison because at the beginning of the video, he talks about how they split into two teams; one used jQuery and the other React. Apparently the jQuery team moved significantly slower. I found that hard to believe given all the hacks they had to with React later on.

Re: React Makes You Sad?

#137
post #30

This reminds me of that Netflix talk on React [1]. In it, the guy first praises React to the heavens, then spends the rest of the session explaining all the ways they had to disable and work around React to get what they wanted with decent performance. It seemed to me like their use case could have been done with jQuery in a few hundred lines. Maybe I missed something. [1] https://www.youtube.com/watch?v=g01dGsKbXOk

He praises React because it makes it easy to change the UI design at any time in response to new requests from the designers. The hard parts he talks about are animations, pre-loading, and virtual rendering, which require some higher level orchestration to get right in any framework. You have to have some component keeping track of this stuff. They mentioned that they had to extend the standard transition component to make it more reliable.

He also talks about writing code in a way that will work on both the server and client side, which is something you have to think about no matter what library you're using.

Re: React Makes You Sad?

#138
post #136

Earlier quoted context omitted.

just curious how you arrived at jQuery comparison. isn't that just a library for DOM utilities while react is a view engine optimized for minimum dom manipulation using observable pattern?

I made the comparison because at the beginning of the video, he talks about how they split into two teams; one used jQuery and the other React. Apparently the jQuery team moved significantly slower. I found that hard to believe given all the hacks they had to with React later on.

The React team was probably quicker at responding to the designers' ideas. The stuff that took a longer time was getting all the transition animations to work, which can be difficult in any higher-level framework.

Re: React Makes You Sad?

#139
post #115

Earlier quoted context omitted.

I'm planning to keep the basic, most used APIs the same, but yes, there will be some breaking changes. Promises will follow ES6 API and advanced redraw control APIs will likely be changed to improve ergonomics and leverage good ideas from other vdom libraries.

Will there be changes to the vdom structure that might break MSX?

I don't think so. Even if there ends up being one, I'd send a PR to insin. Planning to keep it @pragma jsx friendly, though.

Re: React Makes You Sad?

#140

It makes me sad looking at apps made with React. I am currently using Knockout.js and Router.js which is working out very well. I like that your code is concerned with maintaining the state of the VM, not rendering the view. What is gained by building an app in React, and are there certain scenarios where it really shines?

Having built a rather large SPA with Knockout, these are advantages I've found with React:

1) I don't have to worry about whether a property should be observable or not. 2) When changing a property from non-observable to observable, adding parens to most (or all) references is a burden 3) Screens with a large amount of state become difficult to manage and reason about with knockout. Should I use .subscribe, .computed, .pureComputed etc. With React, call .setState, and write plain javascript for everything else. 4) Mapping large objects to observable view models manually isn't fun and the knockout mapping plugin isn't good. React deals with plain objects. 5) Knockout components perform poorly compared to react components with large amounts of data. 6) Knockout is not intelligent in the way it renders. If you replace the value of an observableArray, Knockout will completely re-render any piece of UI bound to that array. This is especially bad when paired with #5. React does a virtual DOM diff and only renders the bits that have changed. 7) With knockout, I have to concern myself with how to go about importing html templates into my components. React is javascript-only. Just use React.createElement, or JSX if you're OK with transpiling. 8) React tooling is infinitely better. I waste a lot of time trying to figure out why some binding is throwing errors in knockout. I've never experienced this issue in react, especially when using PropTypes. 9) Custom knockout bindings to implement 3rd party libraries can be an absolute disaster - especially when attempting to support 2-way binding. It felt like every custom binding I wrote in knockout was full of hacks and terrible code. I haven't felt this way at all with React, and I only have to worry about binding in one direction.

Post reply on HN