Hacker News new | ask | show | jobs
by manigandham 2288 days ago
These directives take less than a day to learn. 99% of the time it's far easier to write HTML tags with data and event binding directives than hack around with JSX and passing all those props.

You can also use JSX with Vue if you want. Just add a render() function to the component. That's what happens anyway when you use a normal template, the Vue compiler turns it into a render function the same way JSX is compiled by React.

2 comments

Using Vue's pseudo-HTML directives might be easier for many cases, but it is less powerful than JavaScript. In some cases, these restrictions leads to workarounds or rewrites. I agree with the grand-poster that the added value is controversial.

As for JSX with Vue, it's clearly a second class citizen. For instance, last I checked, JSX + TypeScript was broken, though both are officially documented with Vue.

I actually found make it restricted (compare to js) improve general code quality as you don't have too much items to abuse. Probably not ideal for personal project because it won't let you fly as you want. But it is awesome for collaboration because you can't really write something way too off with it.
Yea, the 1% of the time you need that extra control then you can easily use JS render function or JSX. The documentation covers all of this: https://vuejs.org/v2/guide/render-function.html
I haven't found it very limiting, however, because it is very well defined, in Vue3 they are looking to actually use this to make massive optimizations in rendering that you simply can't make when you use javascript anyway you like to assemble things.
and using promises with vue is nightmare.
Using promises where? And what's difficult about them?
[Citation Needed]