A curated list of things related to Vue.js
github.com
github.com
1. The API surface is fairly small, especially compared to Angular. I could grok how it worked very fast.
2. The fact that it works without build tools is a godsend. My project is fairly small, and having as fast an iteration cycle is really nice.
3. The debug tools are awesome. EDIT: https://github.com/vuejs/vue-devtools
However, I do have a BIG problem: the fact that mutating the data automatically does a rerender is a nice idea, but in practice it falls apart very quickly and leads to fairly hard-to-debug bugs. For instance, if I add a new field to an object, it will not be detected as a change by Vue and not cause a rerender[0]. In my case, it broke the magic and caused me to look into how the heck did vue actually work - only to find out I had to call this.$forceUpdate() in a few places. It's terrible.
React, despite its problems, is nice because of exactly this : its data binding is entirely non-magical. You have to go through setState or force an update. The mental model is dead simple. I wish I could like vue more...
[0] It is somewhat documented here: https://vuejs.org/v2/guide/instance.html#Data-and-Methods among other places
I feel you could have avoided this "awful" pain by just reading a little documentation.
I mean, how exactly did you think your new property would be picked up? I know frameworks are supposed to abstract over things but you do still need some idea what's happening under the hood.
Here's an archive link: http://web.archive.org/web/20170711045330/https://vuejs.org/...
Besides, it's possible for the new property to be picked up through Proxy Objects[1]. So it's not like it's entirely impossible for Vue to do this, they just chose not to (and they probably have good reason, like IE support).
If mutations of existing properties are picked up, one could naturally expect that addition of new properties would also be.
One question: Which objects will Vue attach observers to? Just props and data? I sometimes reference objects in Computed values, but those objects never seem to force re-rendering when they're changed.
There's a third one where you re-render the tree from the root.
When you refer to the debug tools, are you referring to the Chrome extension or something else?
There is a culture of complexity and some people thrive and perpetuate this complexity for not always technical reasons.
Vue completely avoids and sidesteps this and its best to start with the original site and docs or you might find yourself sucked once more into this gratuitous complexity.
In comparison to react, it's always been more intuitive.
That said, I recently started working with a developer new to vue coming from react. Explaining how nested data updates doesn't really work made me realize how janky it is.
I hope there's some kind of solution. Especially when you start using vuex, the data update inconsistency becomes a major issue.
Managing state is very natural on small projects, but you can use the official, well integrated store.
The doc is stellar. The api is simple, with no surprises, and riddle with small helpers to make your life easier. As a result, reading the official tutorial feels like a friend is talking to you.
Debugging and training are easy.
I do mostly react for my clients, but when i can choose, i always go for vue.
I think a fair comparison would be to look at React's component API: https://facebook.github.io/react/docs/react-component.html
And compare it with the Options / Lifecycle Hooks and Instance Properties and Instance Methods sections of the Vue API docs: https://vuejs.org/v2/api/
Vue may be simpler if you have passing familiarity with Angular 1, or if you are very familiar with Mustache-style templates. But I think it's wrong to say the API is simple, or has a small surface.
That makes manipulating the api way simpler for me.
There are surprises. Reactivity with child components, and how to deal with that - there's enough "this isn't what I was expecting" that I run in to a lot in the forums that it's certainly a "surprise" to many.
Neither does React. Both components and JSX are optional, you can just build a vdom out of function calls.
2. Two-way data binding. Convenient, no need to write handler functions.
3. Comes off as a better version of Angular. Appealing if you're familiar with Angular.
4. Comes off as more curated than React with regards to e.g. routing and state management, less need to shop for libraries.
5. More performant in some situations.
That said, I prefer React. I consider 1 and 2 drawbacks of Vue compared to React.
Also you can avoid using JSX (although it can be used if desired)
https://medium.com/@raulk/if-youre-a-startup-you-should-not-...
Vue DevTools (with Vuex support) is a much more pleasant experience than React/Redux Dev Tools as far as Chrome integration goes too.
Give a try using only props and events. You will save a lot of typing and brainpower avoiding actions, mutations etc. I work on a fairly large, at this point, Vue application, and I am pleasantly surprised how far we've gotten without global state stores.
If you need a global event bus, you can just use vanilla Vue to get quite far as well - https://vuejs.org/v2/guide/components.html#Non-Parent-Child-...
[0] https://github.com/enaqx/awesome-react