News for hackers. Stuff that matters.
Re:Integrating React with Meteor by pgm8705 on Thursday July 02, 2015 @02:35PM (#9820715)
Interesting to see this implemented as a mixin when they just announced yesterday they are fully supporting es6. Looking forward to building some side projects with this and seeing how it compares to using react + flux.
Re:Integrating React with Meteor by avital on Thursday July 02, 2015 @03:02PM (#9820896)
Hi, I wrote this blog post.

We were trying to keep our API surface area small with one way to load data into components, but you're right -- we should probably /also/ add a ES6 base class as a second option, and let the people choose which they prefer.

A lot of React developers still prefer mixins -- react-router recently switched from mixins to ES6 classes and then changed their mind "until ES6 classes have better answers to replace what mixins do (like decorators).": https://github.com/rackt/react-router/blob/master/UPGRADE_GU...

Re:Integrating React with Meteor by clessg on Thursday July 02, 2015 @03:13PM (#9820972)
> we should probably /also/ add a ES6 base class as a second option, and let the people choose which they prefer.

Please provide a higher-order component or ES7 decorator (assuming ES7 will be supported?), would rather not use inheritance.

Re:Integrating React with Meteor by jxm262 on Thursday July 02, 2015 @07:08PM (#9822347)
^ this. Id much rather use a decorator with ES7 then extending out classes. Although, i thought i heard that react is working on making some better alternative to mixins
Re:Integrating React with Meteor by anarchy8 on Thursday July 02, 2015 @03:20PM (#9821001)
That is very disappointing. Decorators already exist in Babel and they work perfectly. I don't know what they're waiting for
Re:Integrating React with Meteor by pspeter3 on Thursday July 02, 2015 @03:58PM (#9821225)
I suspect they're waiting for the proposal to be more stable for the official integration. This seems like a great opportunity for the community to write a decorator and let a convention form before it gets merged into the core framework
Re:Integrating React with Meteor by djmashko2 on Thursday July 02, 2015 @05:30PM (#9821788)
There's a more detailed discussion about mixins vs. other data loading methods on this GitHub issue: https://github.com/meteor/react-packages/issues/25#issuecomm...
Re:Integrating React with Meteor by phoenixmatrix on Thursday July 02, 2015 @03:23PM (#9821013)
The community is pretty divided and es6 classes are fairly controversial. Don't be too surprised to see a lot of people avoid them. On purpose. And it's not because they aren't familiar with OOP.
Re:Integrating React with Meteor by spion on Thursday July 02, 2015 @03:38PM (#9821111)
That may be the case with the node community, however AFAICT the React community seems much more open to fully utilizing ES6
Re:Integrating React with Meteor by phoenixmatrix on Thursday July 02, 2015 @03:58PM (#9821224)
Its the javascript community as a whole that is divided, generally between imperative/OOP and functional devs. Has nothing to do with Node or otherwise.

Even if you like classical inheritance, the Class keyword is poorly implemented for it, from both a normal OOP language's point of view OR from a prototypal inheritance point of view. It's bad at both.

Re:Integrating React with Meteor by pluma on Thursday July 02, 2015 @07:06PM (#9822335)
Classes are fine if you understand they're just syntactic sugar for the already extremely widespread constructor+prototype pattern.

The primary reason a significant part of the community hates the ES6 classes is that the class keyword is misleading for people who don't understand prototypal inheritance.

The OOP vs FP divide is orthogonal to that as the FP devs in question generally disagree with the constructor+prototype pattern to begin with (and often shun prototypal inheritance entirely).

There's also the people who want JS to be more like Haskell/Lisp, but they've mostly moved to LiveScript and ClojureScript and only occasionally complain from the sidelines.

Re:Integrating React with Meteor by codygman on Thursday July 02, 2015 @07:37PM (#9822458)
> There's also the people who want JS to be more like Haskell/Lisp, but they've mostly moved to LiveScript and ClojureScript

You forgot about Purescript:

http://purescript.org/

Re:Integrating React with Meteor by natrius on Thursday July 02, 2015 @04:54PM (#9821565)
What exactly is bad about ES6's `class` from a classical inheritance point of view?
Re:Integrating React with Meteor by alexgaribay on Thursday July 02, 2015 @02:39PM (#9820742)
I've been creating an application with Meteor and React* and it has been pretty easy thus far. Although I'm not using the official Meteor-React package, it does a lot of the same things that the official package does. The unofficial package also uses a mixin to use with React classes.

*edit: Meant to say React instead of flux

Re:Integrating React with Meteor by jbhatab on Thursday July 02, 2015 @02:48PM (#9820802)
I would love to see this. I really love flux and want to get flux into it, not just react. If it's open source, I'd really appreciate a github link :D.