Hacker News new | past | comments | ask | show | jobs | submit login
React v0.8 is out (facebook.github.io)
96 points by zpao on Dec 19, 2013 | hide | past | favorite | 15 comments



Any framework like React (which embeds html tightly with javascript) is flawed at its core.

HTML itself is declarative in nature. All frameworks should embrace this.

By looking at React docs, I can tell you from my experience that it'll be pain in the s to maintain a large scale React application.

AngularJs' declarative way gives an app maintainability and highly test-ability. These two things are not the luxury but a must have requirement for any large scale long-live application.


Here's my talk from JSConf EU that directly tackles those concerns. http://2013.jsconf.eu/speakers/pete-hunt-react-rethinking-be...


The React devs are well aware of what they are doing, and argue that they are merely coupling technologies, not coupling design concerns:

http://www.youtube.com/watch?v=x7cQ3mrcKaY&list=FLuFwYXJkbMi...

Of course you're free to agree or disagree with their argument, but I wouldn't assume they are just newbs who are unaware of standard best practices. They know the "rules" and are breaking them consciously.


1) I totally disagree about embedding HTML, but it's optional anyway. Cohesion counts. See Pete Hunt's video.

2) React programs tend to be very "dearative" in my eyes. Any declarative language still needs abstraction facilities: ie functions.

3) you can trivially implement any "more declarative" model you want on top of React's stellar core.

4) all of the benefits of test ability from angular apply to react too

Sorry about typos, on phone


<tabManager background=blue> <tab closeButton=true> Hello {{propertyName}} </tab> </tabManager>

This is what you typically get at the end in an Angular app. You don't need to "figure out" things where they are and what they are, and what they do in DOM.

Show me this declarative thing in React.

And this is just one part of Angular.


For what its worth,

<tabManager background={'blue'}> <tab closeButton={true}> Hello {this.props.Name} </tab> </tabManager>

Would be valid in react.

Check out http://facebook.github.io/react/#todoExample, specifically the render function.

I think this is pretty easy to understand:

      <div>
        <h3>TODO</h3>
        <TodoList items={this.state.items} />
        <form onSubmit={this.handleSubmit}>
          <input onChange={this.onChange} value={this.state.text} />
          <button>{'Add #' + (this.state.items.length + 1)}</button>
        </form>
      </div>


I don't have any practical experience with angular (but I'd like to, and definitely think its testability is a step in the right direction).

That said, I've found react to be very declarative, especially over the raw jQuery and Backbone I'd used before. Most of the components I write have no state, and render() declares how to render them from any state, without having to worry about how to change things on state changes.


With React, you get to choose the parts of your code that integrate tightly which each other. Choice is good.

And if you don't like html in js, you could always embed ClojureScript in ClojureScript :-):

https://github.com/holmsand/cloact


As I said here the last time a new React version came out, we're using React for more or less all new JS development at Khan Academy, and we're loving it.

Happy to answer questions.


What does it give you above other frameworks, specifically Angular?



I wrote a little bit about my experiences here:

http://benalpert.com/2013/06/09/using-react-to-speed-up-khan...

In short, it's simple (very little to learn) and very fast. One other big thing I love is that it encourages building reusable and composable components. Angular has a lot of the same structure, but if you end up building directives then you have to drop down to manual DOM manipulation again if you want speed.


I just read through all the React docs and the tutorial. My first impression is it looks and reads like Flex for Javascript, both for the JSX markup and the component lifecycle events. I'm not saying that is a bad thing, just an observation.


Damn, from misreading the headline I thought ReactOS had jumped up a few version numbers.


Sorry to get your hopes up! I'll try to remember to make it a bit more obvious next time.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: