7 ms·
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
by pgm8705 11y ago
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.
- phoenixmatrix 11y agoThe 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.
- spion 11y agoThat may be the case with the node community, however AFAICT the React community seems much more open to fully utilizing ES6
- phoenixmatrix 11y agoIts 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.
- natrius 11y agoWhat exactly is bad about ES6's `class` from a classical inheritance point of view?
- pluma 11y agoClasses 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.
- codygman 11y ago> 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/ http://purescript.org/
- deleted 11y ago[deleted]
- alexgaribay 11y agoI'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
- jbhatab 11y agoI 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.
- avital 11y agoHi, 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_GUIDE.md#0132---0133 https://github.com/rackt/react-router/blob/master/UPGRADE_GU...
- clessg 11y ago> 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.
- jxm262 11y ago^ 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
- anarchy8 11y agoThat is very disappointing. Decorators already exist in Babel and they work perfectly. I don't know what they're waiting for
- pspeter3 11y agoI 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
- deleted 11y ago[deleted]
- 11y ago