Live data from Hacker News

React v0.14 Beta 1 released

facebook.github.io

41–50 of 62 posts

Re: React v0.14 Beta 1 released

#41
post #11

If you haven't already, you should be betting on React. It's the future: > More importantly, this paves the way to writing components that can be shared between the web version of React and React Native. This isn't yet easily possible, but we intend to make this easy in a future version so you can share React code between your website and native apps. Isn't this what we have all been waiting for? Writing components t…

I just copied that quote so I could comment on it. I appreciate the React team's vision.

Re: React v0.14 Beta 1 released

#42
post #11

If you haven't already, you should be betting on React. It's the future: > More importantly, this paves the way to writing components that can be shared between the web version of React and React Native. This isn't yet easily possible, but we intend to make this easy in a future version so you can share React code between your website and native apps. Isn't this what we have all been waiting for? Writing components t…

I would say that React is the present but that the future is a circle back to progressive enhancement. I'm seeing more high-profile JS developers jumping off the front-end framework bandwagon and back towards progressively enhancing existing HTML. I think we're going to see frameworks emerge which make progressive enhancement the priority and make it easier. So the whole JS templating engine race that has been going on for the last few years will simply not be important any more.

Re: React v0.14 Beta 1 released

#43
post #42
post #11

If you haven't already, you should be betting on React. It's the future: > More importantly, this paves the way to writing components that can be shared between the web version of React and React Native. This isn't yet easily possible, but we intend to make this easy in a future version so you can share React code between your website and native apps. Isn't this what we have all been waiting for? Writing components t…

I would say that React is the present but that the future is a circle back to progressive enhancement. I'm seeing more high-profile JS developers jumping off the front-end framework bandwagon and back towards progressively enhancing existing HTML. I think we're going to see frameworks emerge which make progressive enhancement the priority and make it easier. So the whole JS templating engine race that has been going…

I feel like React - or something like it - is part of the path back to progressive enhancement, as you can use the same components to generate the initial HTML on the server and to enhance it when JavaScript is available on the client.

As you say, React is the present, and it's making progressive enhancement easier right now.

Re: React v0.14 Beta 1 released

#44
post #11

If you haven't already, you should be betting on React. It's the future: > More importantly, this paves the way to writing components that can be shared between the web version of React and React Native. This isn't yet easily possible, but we intend to make this easy in a future version so you can share React code between your website and native apps. Isn't this what we have all been waiting for? Writing components t…

If you haven't already, you should be betting on React. It's the future But last week the future was AngularJS, and the week before that it was Ember or Backbone or Knockout, and a few days earlier it was jQuery. Next week it will be Angular 2.0, maybe, or something with Web Components, and the week after that we're all abandoning JS in favour of some declarative functional language that hasn't been written yet but w…

Well, jQuery has been the future for a very short time, and has been the "present" for years now.

Re: React v0.14 Beta 1 released

#45
post #9
post #6

We're considering trying react for a new project, and just read about the adoption of Babel [1] instead of the internal transpiler previously used for JSX. One question: does this mean that JSX will be able to use ES6 syntax supported by Babel out of the box? If so, will this be the default for this new version of React? I ask the questions also because we would really like to be able to use React with CoffeeScript,…

You don't need to use Babel, though we do recommend it. We're just no longer going to maintain our own JSX transformer since there's no point. (If you want just Babel's JSX transformation without any other features, that's possible too.) There's a CoffeeScript JSX transformer here if you're interested: https://github.com/jsdf/coffee-react and we'll continue to support using React without JSX, and though we use Babel…

Thanks for the answer. It would be great to have an officially sanctioned toolchain for using coffee and react from Rails, but I think that asking too much :)

Re: React v0.14 Beta 1 released

#46
post #6

We're considering trying react for a new project, and just read about the adoption of Babel [1] instead of the internal transpiler previously used for JSX. One question: does this mean that JSX will be able to use ES6 syntax supported by Babel out of the box? If so, will this be the default for this new version of React? I ask the questions also because we would really like to be able to use React with CoffeeScript,…

I've been using babel instead of the internal transpiler and yes you can use all the ES6 syntax out of the box. I think the JSX transpiler was deprecated some time ago and pretty much all the react starter templates and examples have been using Babel. I don't think adopting babel is going to compromise your use of coffeescript, in then babel is just transpiling down to old style javascript.

So you were using babel with a JSX module? Did they just make the JSX module the default? Sorry but I know babel only by name yet!

Re: React v0.14 Beta 1 released

#47

we looked at what you can do with a ref to a DOM component and realized that the only useful thing you can do with it is call this.refs.giraffe.getDOMNode() to get the underlying DOM node. In this release, this.refs.giraffe is the actual DOM node. This only holds if you use Facebook's particular flavour of Flux, I guess. Personally, I use refs a lot to bubble events down the component hierarchy. For example, when the…

Personally, I use refs a lot to bubble events down the component hierarchy. For example, when the browser window loses focus and gains it again, some sub sub component of the root component might want to do set some local state. Whatever, display a "welcome back!" message or something Isn't that a bit of an antipattern? It seems that sending events down the hierarchy is something that React goes out of its way to mak…

Props are awkward on purpose but not to discourage their use, they're awkward so you're explicit about how you're modeling your data and how your data flows through your app/component tree.

Re: React v0.14 Beta 1 released

#48
I'm extremely excited about this release because of the change to context from Owner-based to Parent-based.

Authoring react-resolver meant jumping through weird hoops to avoid context changing, but this release should mean things will work as expected, rather than having to sort out "gotchas".

There goes my July 4th weekend :)

Re: React v0.14 Beta 1 released

#50
post #6

We're considering trying react for a new project, and just read about the adoption of Babel [1] instead of the internal transpiler previously used for JSX. One question: does this mean that JSX will be able to use ES6 syntax supported by Babel out of the box? If so, will this be the default for this new version of React? I ask the questions also because we would really like to be able to use React with CoffeeScript,…

From personal experience I'll just use ES6.

It's not about the HTML-like JSX part using ES6 or using native classes to extend React.component(with limitations), but simpler object literals, fat arrows and { foo: foo } becoming { foo } make React code look much better. I can endure the ending semicolons, parens and brackets.

Now you don't really gain too much by opting for CS over ES6 for React. And with React's adoption of Babel I think ES6 is going to become the primary way of writing React apps.

Post reply on HN