Live data from Hacker News

React v0.12

facebook.github.io

11–20 of 79 posts

Re: React v0.12

#12
post #5

I don't know if I'm reading the changes wrong, but I'm not liking how I have to do an extra step if I don't use jsx. I want to use coffescript and not have to do extra stuff. I definitely feel this forced vibe around making everyone use jsx, but have yet to hear any compelling reasons why it's better.

Where did you see the increased difficulty if you weren't using JSX?

I haven't used React, but maybe he's referring to this: "Composite Component functions can no longer be called directly - they must be wrapped with React.createFactory first. This is handled for you when using JSX."

Re: React v0.12

#13
post #5

I don't know if I'm reading the changes wrong, but I'm not liking how I have to do an extra step if I don't use jsx. I want to use coffescript and not have to do extra stuff. I definitely feel this forced vibe around making everyone use jsx, but have yet to hear any compelling reasons why it's better.

You don't need to do a separate step to use JSX. JSX is a still a superset of JS and you can still opt to not use it with no additional steps.

"...but I'm not liking how I have to do an extra step if I don't use jsx."

http://facebook.github.io/react/blog/2014/10/14/introducing-...

Re: React v0.12

#14
post #5

I don't know if I'm reading the changes wrong, but I'm not liking how I have to do an extra step if I don't use jsx. I want to use coffescript and not have to do extra stuff. I definitely feel this forced vibe around making everyone use jsx, but have yet to hear any compelling reasons why it's better.

You don't need to do a separate step to use JSX. JSX is a still a superset of JS and you can still opt to not use it with no additional steps.

He's referring to the createFactory stuff. The new JSX transformer automatically generates that boilerplate for you, but if you don't use JSX you'll need to add it everywhere yourself before you upgrade.

Re: React v0.12

#15
post #2

off topic a bit, but why do the CDN urls 301 redirect?

Mostly what @BinaryBullet said. fb.me is a urlshortener and then it hits real CDNed files. I (as maintainer of React) suggest not actually using fb.me urls in production. Use cdnjs or jsdelivr. Or host it yourself. We've been meaning to put together a proper CDN hosting setup for JS libraries but just haven't gotten around to it.

Re: React v0.12

#16
post #5

I don't know if I'm reading the changes wrong, but I'm not liking how I have to do an extra step if I don't use jsx. I want to use coffescript and not have to do extra stuff. I definitely feel this forced vibe around making everyone use jsx, but have yet to hear any compelling reasons why it's better.

You don't need to do a separate step to use JSX. JSX is a still a superset of JS and you can still opt to not use it with no additional steps.

"Composite Component functions can no longer be called directly - they must be wrapped with React.createFactory first. This is handled for you when using JSX."

Re: React v0.12

#17
post #5

I don't know if I'm reading the changes wrong, but I'm not liking how I have to do an extra step if I don't use jsx. I want to use coffescript and not have to do extra stuff. I definitely feel this forced vibe around making everyone use jsx, but have yet to hear any compelling reasons why it's better.

Where did you see the increased difficulty if you weren't using JSX?

As the others have stated, react requires me to add this line: var MyComponent = React.createFactory(require('MyComponent'));

It's not a huge deal, but I keep getting this sense that jsx is strongly tied to react and this reaffirms that they are going to keep it that way. I do trust the react team still, but it makes me weary of future releases.

Re: React v0.12

#18

As a person who is using react, this is a welcome change! I'm glad they're taking time to get rid of the kludgy code that wasn't quite consistent.

Hey can you explain how they improved consistency because I just don't understand how the new changes help. I may just not understand what they did at a fundamental level.

Re: React v0.12

#19

So are ES6 classes for components coming in 0.13?

Maybe. We're still working on the details about what that will look like. Chances are we'll have some basic support if you're doing a limited set of things. Stay tuned.

Re: React v0.12

#20
post #5

I don't know if I'm reading the changes wrong, but I'm not liking how I have to do an extra step if I don't use jsx. I want to use coffescript and not have to do extra stuff. I definitely feel this forced vibe around making everyone use jsx, but have yet to hear any compelling reasons why it's better.

Hi, this was a tough call for us to make. We wanted to everything we could to avoid extra bloat for everyone. In the end, most people tend to use some kind of extra helper, even if it's not JSX. E.g. a custom library or another third party language.

One reason for this change is to make it possible to use object literals or record syntax where that is more appropriate than function calls. We don't currently recommend it because there's no validation in that case, so you probably want static analysis to catch errors. I would encourage you to play with the idea of using object literals instead of function calls though.

One compelling reason for this change is that in 0.13 you will be able to build components using plain CoffeeScript classes instead of relying on React.createClass. So, in the end, you will be getting some of that bloat/overhead back.

We're definitely not making React depend on JSX. We will continue to support non-JSX and fully support compile-to-JS languages. Unfortunately, that sometimes means a trade-off. In this case trading React.createClass for React.createFactory. Some would've preferred it be the opposite tradeoff but React.createFactory gives us more benefits than the opposite.

Post reply on HN