Live data from Hacker News

React v0.13.0 Beta 1

facebook.github.io

41–50 of 77 posts

Re: React v0.13.0 Beta 1

#41
post #31

I'm disappointed to see this prioritized over, say, a focus on reduced library size or simply getting to a stable 1.0 release. I'm not sure how this moves React forward, though I'm sure it's a "nice to have" for some people. Still, perhaps we'll learn more about the roadmap and goals of the team at the React conference this week.

1.0 implies API stability, so now is exactly the time they should be prioritising things that potentially change the API going forwards. Also, is 40kb gzipped really something to lose sleep over? Especially when the mere act of moving from old jQuery/Backbone soup to React reduces the size of my real code by a far greater amount.

I don't know React, and use and love Backbone.

It's my (perhaps flawed) understanding that React deals only with the "view" part of an app, and that you can use Backbone and React concurrently.

Could you elaborate on what you call "Backbone soup" and how React helps solve this problem?

Re: React v0.13.0 Beta 1

#42
It's funny React gets bashed in this thread for pushing out createClass crutch, mixins, autobinding into userland, when usually it is being modularity shamed[0].

The change is subtle and easy to misinterpret. It's not that React drank ES6 class kool-aid and we're now gonna use inheritance over composition. (Nope[1], in fact pretty much the opposite[2].)

The real change is that React.createClass is no longer the way to create components. It's just a fancy wrapper (which is not even being deprecated). You want magic, you opt-in to it.

ES6 classes are also not the way to create components. As mentioned at the end of the article, you can even use ES3 module pattern:

    function MyComponent(initialProps) {
      return {
        state: { value: initialProps.initialValue },
        render: function() {
          return 
        }
      };
    }
React.createClass stops being special/required and becomes a (handy) utility. Can potentially be moved into a separate package.

Competition for mixin systems is now possible.

Finally, this change opens up more possibilities for potential React-like frameworks to “interpret” React components. Of course we don't do that today, but it's still a nice property and may be handy later when you decide to switch to future React-like competitor.

It's the anti-lock-in.

[0]: http://jlongster.com/Modularity

[1]: https://github.com/facebook/react/issues/613#issuecomment-29...

[2]: https://github.com/reactjs/react-future/blob/master/01%20-%2...

Re: React v0.13.0 Beta 1

#43
Excited for the release, but disappointed in the embracing of OO programming in Javascript. Object oriented programming is a poor way to express logic and gets away from the beauty of languages like Javascript (and Perl) - functional composition.

I deeply regret the day when all job postings for Javascript say "Looking for an object-oriented Javascript developer", since like lemmings companies think object-oriented programming is a good thing.

Re: React v0.13.0 Beta 1

#44
post #15

I'm actually looking for a system that allows me to write Javascript code in the normal imperative way, and automatically makes it reactive. So, for example, calling a function f(a, b) is first done normally, and then, when e.g. "b" changes value, the function f(a, b) is re-evaluated incrementally. Note that this means that not simply f is invoked again, but that f is recursively re-evaluated. Anybody here aware of s…

http://elm-lang.org

Re: React v0.13.0 Beta 1

#45

Excited for the release, but disappointed in the embracing of OO programming in Javascript. Object oriented programming is a poor way to express logic and gets away from the beauty of languages like Javascript (and Perl) - functional composition. I deeply regret the day when all job postings for Javascript say "Looking for an object-oriented Javascript developer", since like lemmings companies think object-oriented p…

OO tends to work pretty well for widgets fwiw.

Re: React v0.13.0 Beta 1

#46
post #41

Earlier quoted context omitted.

1.0 implies API stability, so now is exactly the time they should be prioritising things that potentially change the API going forwards. Also, is 40kb gzipped really something to lose sleep over? Especially when the mere act of moving from old jQuery/Backbone soup to React reduces the size of my real code by a far greater amount.

I don't know React, and use and love Backbone. It's my (perhaps flawed) understanding that React deals only with the "view" part of an app, and that you can use Backbone and React concurrently. Could you elaborate on what you call "Backbone soup" and how React helps solve this problem?

Our experience with Backbone, was that the majority of code in your models and views is about keeping the two in sync. i.e. if a field on a model changes, how to update the element that the view controls in the most efficient possible way. We experimented with several methods of handling data-binding (two-way at the time) for us, but weren't satisfied with any of them.

I was building a particularly complicated content editor with Backbone, and was getting frustrated. So I spent the next morning learning React, then re-implemented the whole thing that afternoon. All the complexities I was grappling with disappeared. Obviously there were new challenges to replace the old ones, but we've found it's much easier for someone to pick up work on a React project than it ever was with Backbone.

To start with we were using Backbone models with React views, but now we just use a flux implementation (Fluxxor), and don't bother with much else. Our client-side JS stack is essentially React, Immutable, Fluxxor, superagent, moment and mousetrap, with only the first three being core ingredients.

Re: React v0.13.0 Beta 1

#47
post #41

Earlier quoted context omitted.

I don't know React, and use and love Backbone. It's my (perhaps flawed) understanding that React deals only with the "view" part of an app, and that you can use Backbone and React concurrently. Could you elaborate on what you call "Backbone soup" and how React helps solve this problem?

Our experience with Backbone, was that the majority of code in your models and views is about keeping the two in sync. i.e. if a field on a model changes, how to update the element that the view controls in the most efficient possible way. We experimented with several methods of handling data-binding (two-way at the time) for us, but weren't satisfied with any of them. I was building a particularly complicated conten…

This repeats my experience too. Backbone gets nasty too soon: nested entities, pagination, invalidation, caching have to be ad-hoc ugly solutions because Backbone is just too rigid where it better be flexible, and too flexible where it should have been rigid.

We gradually moved from Backbone to React+Backbone, and finally to React+Flux. It's been amazing since.

Re: React v0.13.0 Beta 1

#48
post #29

Earlier quoted context omitted.

In my opinion, the current way of doing things with reactive mechanisms really doesn't make it clear what the program is doing. There's lots of things happening at the same time, and also glitches can occur (variables rapidly changing after eachother), and also non-optimal efficiency (things being recomputed unnecessarily). If my program just gets re-evaluated in an optimal way (without any other side-effects) then t…

SAC is quite different from reactive programming in the sense that it is not, well, reactive or interactive. SAC deals with incremental recomputation on change, whereas most reactive programming systems out their don't support incremental recomputation (maybe some DOM diffing and that's about it). Check out Adapton though, which is trying to bridge the gap.

Very interesting! Thanks.

I just hope there will be a browser-implementation soon :)

Re: React v0.13.0 Beta 1

#49
post #45

Excited for the release, but disappointed in the embracing of OO programming in Javascript. Object oriented programming is a poor way to express logic and gets away from the beauty of languages like Javascript (and Perl) - functional composition. I deeply regret the day when all job postings for Javascript say "Looking for an object-oriented Javascript developer", since like lemmings companies think object-oriented p…

OO tends to work pretty well for widgets fwiw.

I don't get why your parent is being downvoted.

React's position is to avoid inheritance in favor of composition: https://github.com/facebook/react/issues/613#issuecomment-29...

This hasn't changed.

The change in 0.13 has nothing to do with inheritance though.

It's neither about classes nor about ES6. I wrote a comment explaining why: https://news.ycombinator.com/item?id=8959691

Re: React v0.13.0 Beta 1

#50

Earlier quoted context omitted.

Maybe off topic but I've been wondering whether many people are finding spending time on TS worthwhile? Given the improvements in ES6, the fact that the JS community in general is so active, and the fact that I've seen some truly awful TS code (mainly where the devs want to pretend the web doesn't exist) I've been put off exploring TS too far much (beyond looking at the basic language features). I'm not sure if I sho…

After quite some consideration I chose to convert my ActionScript3 project to TypeScript. I knew I had to move away from flash for a while, and personally I really prefer to code big framework-like projects with static typing, so I gave it a go and it I have to say it has been really enjoyable. My code looks really neat, and unlike many other comments here, my code is very much targeted at the web and bound to how js…

Our problem with TypeScript is not TypeScript but its community and ecosystem for the most part (I think that's a way I would put it).
Post reply on HN