I've used Angular 2, React+Redux, and now Vuejs on different projects (and on personal projects, stuff like om, elm, etc).
Vuejs feels like they cheated somehow.
For people in Redux-land: they took the reactivity of MobX and gave it Redux' level of debuggability. One important way, I think, is that Vuex formalizes the 'actions-dispatching-actions' use case of Redux middlewares (which redux says 'is not a part of the architecture, but is important enough to be in core'); in Vuex, all action creators can dispatch other actions, and it throws an error in dev mode if you try to mutate state in a non-safe way.
I've used redux for a couple of years, and felt the pain of juggling different libraries (especially the struggles to manage router state) -- Vue is a delightful experience. Its chrome plugin is ridiculously useful; its documentation always seems clear and helpful; things work together.
I can't wait to see what Alibaba does with Weex -- essentially React Native for Vuejs. I did a test spike with it a month ago, and am trying to keeping tabs on it ...
The downside is the ceremony around it all but everything is so predictable and reliable it's a huge relief. Velocity is now good. We didn't choose this combination first off (via GraphQL, MobX, thunks), but the team decided that this combination was the best way for us to solve the issues we had encounter in the past.
However, in my experience, Vuex also has explicit stores and clear points for mutation -- Vuex stores are really clear and composable. It's also about 10 lines to get redux-sagas to working with Vuex.
If it weren't for react-native, I'd be pushing to use Vue + Vuex whenever possible. So I'm watching Weex with bated breath :) -- it's very cool that it's recently become an Apache Foundation project!
Polymer is basically an inverted version of React (and it achieves a similar outcome). In React, template markup is nested inside the code. In Polymer, code is nested inside the template markup.
I really like React but I wouldn't use it for a personal project knowing that Polymer exists. I hope Polymer will gain more traction because I would love to be able to use it professionally.
Except that Vue doesn't ship with all the Polyfill baggage that Polymer does. Polymer has came a long way, but it still feels slow on anything but Chrome.
Once the Web Component spec is finalized, and built into browsers, I think Polymer will be a great choice. Today though, I gotta give the nod to Vue.
Early explosive growth means that the technology is hype-driven; adopters haven't given themselves the time to critically and objectively evaluate the solution - It's not so different from economic bubbles. People get excited and buy into it without thinking and then at some point in the future when they realise that it won't live up to their expectations they all start selling at the same time.
My biggest hangup with trying new platforms is finding a good UI framework to go with it, I like handing off styling to people who know what their doing.
This react below is not JavaScript... it's a reverse template language with a mix of not-quite-html and not-quite-JavaScript. jQuery style code is nicer than that! I hate the enterprise boilerplate in react projects. No wonder they're all failing!
class Square extends React.Component {
constructor() {
super();
this.state = {
value: null,
};
}
render() {
return (
<button className="square" onClick={() => this.setState({value: 'X'})}>
{this.state.value}
</button>
);
}
}
It's like facebook is a php shop or something... Oh wait. Not for me thanks.Or could you not hear me over the sound of that axe you're grinding? :)
Wrong. It's a template language, even if Facebook tells you otherwise.
return React.createElement(
button,
{ className: "square", onClick: () => this.setState({value: 'X'}) },
this.state.value
);
If you think your code is written in a template language, then the code I just wrote must also be written in a template language (with different syntax).I want to write this, and have it actually be HTML:
<div>
<div>
</div>
<div>
I like HTML.[1]: http://sgmljs.net/docs/templating.html
Disclaimer: my project, and SGML is most certainly not a "lightweight template engine" by any measure
Most use the html+javascript language which is compiled and then spits out JavaScript and html. This is pretty much identical to PHP - which is a preprocessor template language.
Anyway, facebook says it reminds me of a template language, so I'll believe them.
No, it spits out javascript (the exact same javascript that I wrote), which returns shadow DOM trees (which are javascript objects), which the renderer looks at to modify the actual DOM.
Also not sure what you mean by "looks like" javascript. It's clearly javascript - just a function call with 4 arguments.
JSX by its nature statically checks for tag balance, etc. The non-JavaScript part of its syntax has actual semantics. In a template language the non-Turing-complete part of the syntax is just strings.
JSX is a perfectly good notation for describing how data maps to its presentation in a DOM tree.
So far Polymer is my go to solution, but Vue is close second. I like the fact that everything (web components) is native to browser platform.
Yeah, Vue.js is for people who make things. React is for enterprises who don't seem to mind being 3 months late shipping basic stuff.
In react everything is done in the template language. It's a sort of reverse template language, that doesn't even really use proper html for things. So weird.
Vue is just all together, and is based on web standards. Not a weird thing by facebook enterprise developers who think that documents are dead and everything should be a slow loading monster single page thingo. Vue does components properly.
React components aren't. They tell you to move state from the child to the parents. That's not a component, and probably one of the biggest reasons many of the react projects are giant messes.
React is sort of like the old enterprise thing that doesn't solve any of the real issues with Angular style frameworks.
React does have a pretty good marketing budget though. Lots of evangelists paid to talk it up. Plus lots of developers who have invested so much time learning useless non-standard framework stuff. Also, there's plenty of freelance gigs cleaning up failed messy react projects.
The good components, and the docs are the biggest reasons. But also it's a very well thought through thing based on web specs, using html technology. People can get useful work done almost right away, and what they made is self contained by default, limiting their damage. It also works for the document case, AND the single page app case. Want to make a landing page that converts well? Vue has your back. Want to use that one jQuery plugin, because it's awesome... Vue can do that easily - it plays nice with others.
React should copy it more, and copy web standards more.
Fair cop. Not sure why I'm participating in a JavaScript framework internet discussion. I wish people would concentrate on standards, and apps.
You don't have to do that if you don't want to - I don't in the react I write. Is there anything special about vue components which would allow you to keep state in child components in vue but force you to move the state to parent components in react?
I hope he gives Vuejs a try. As a javascript beginner, who tried Angular, Angular2, A bit of React and VueJS, I just loved the flexibility and approach of VueJS. I was instantly productive thanks to the amazing documentation and vue-cli that just worked out of the box setting up my project.
PS: Never really spent much time on React as I tried it after VueJS and did not feel like proceeding much further with my tests.