HNHacker News
TopNewBestAskShowJobs

ohceecho

26 karma · joined February 11, 2018

submissionscomments
ohceecho··on How and why we moved to Vue.js
Yeah, the documentation should probably reflect that. It works like shallow two-way binding, but it implemented differently. Instead of using observers on the data itself, it uses an event, thus maintaining a cleaner interface between the components and avoiding the performance problems and bugs that come with two-way binding.

`v-model` is just a syntax sugar to save you from typing `v-bind:value="val" v-on:input="val = $event.target.value"` over and over. Nothing more than that.

ohceecho··on How and why we moved to Vue.js
v-model in Vue is not exactly two-way binding. It is just syntax sugar for passing the value as a prop and setting an event handler for the “input” event. It looks like two-way binding but has none of the gotchas.

I agree with you point btw.

ohceecho··on How and why we moved to Vue.js
Anecdotal, but I had to migrate a mid-sized app (about 400 components) from Vue 1 to Vue 2 and it took less than a day of work to modify the code, test it and push to production. We weren't using that many removed features to begin with, though.
ohceecho··on How and why we moved to Vue.js
You mean the examples in the link I posted? Those are just javascript and HTML, there's nothing special about them.

Just put that on an HTML file and run it in a browser. No need for any tool other than a text editor.

To compile .vue files you have to use vue-cli (linked on the "Get Started" page), or some third-party tool (instructions here: https://vuejs.org/v2/guide/deployment.html).

ohceecho··on How and why we moved to Vue.js
The templating language is entirely optional. People use it because they prefer it.

You can even use JSX if you want.

ohceecho··on How and why we moved to Vue.js
I disagree with the assertion that it has "huge set of idiomatic coding principles", but I think that's a matter of opinion.

However:

> What I also disliked was how they don't explain how to get it working without a build-environment like webpack.

This doesn't make sense. The official website includes a way to use it by just including a script from the CDN, on the "Get Started" page. It even discourages using the build tools if you don't have prior experience: https://vuejs.org/v2/guide/