News for hackers. Stuff that matters.
Re:How we do Vue: one year later (2017) by koboll on Monday March 18, 2019 @07:38PM (#19426482)
Vue's templating engine, honestly, seems somewhat poorly thought-out.

The usual <div :something='stuff + "here"'/> way of writing it errs on the side of HTML over JS, using quote marks awkwardly to enclose a statement rather than JSX's more sensible curly brackets. It makes it harder to visually parse, and it's sometimes annoying to not be able to use one type of quote marks unescaped within the statement.

Overall, this is one of many ways in which Vue (like Angular) seems like HTML with functionality tacked on, as opposed to React, which is closer to idiomatic JS. I've used both extensively and I don't think I can recommend Vue over React anymore -- unless you're, say, prototyping and looking to build an app entirely on the client, with no build step, where Vue really shines. Or unless you're doing something HTML-centric, like converting a static site.

Re:How we do Vue: one year later (2017) by jimmy1 on Monday March 18, 2019 @07:55PM (#19426595)
I have to agree with this. Ultimately whether or not you like Vue or React better boils down to if you agree with the semantics of the web, and including them in your app building process (i.e you like html, and css, and just want to "pepper" in some logic and interactivity with JavaScript), or if you would rather just embrace JavaScript whole-heartedly.

Vue relies too much on overloading the string type for my taste (fundamentally, all JS libs do this to some extent). Too much magic happens with these string-based v-bindings.

Irrespective of that, these days I am hard pressed to not use typed JS in some form or fashion anyways.

Re:How we do Vue: one year later (2017) by dpisk on Monday March 18, 2019 @09:17PM (#19427184)
As far as component libraries that start from HTML, I think Marko has the best syntax. Attributes are always parsed as JS expressions, for example. There's still some quirks, but overall it's pretty nice. https://markojs.com/docs/syntax/

There are some benefits from just embracing JavaScript though, especially, as you mention, integration with things like TypeScript.

Re:How we do Vue: one year later (2017) by pbowyer on Tuesday March 19, 2019 @03:32AM (#19428797)
That attribute syntax is awesome! I've found VueJS's handling of attributes to be somewhat confusing, sometimes getting a different type passed through than I was expecting. Marko takes the approach that would least confuse.
Re:How we do Vue: one year later (2017) by enraged_camel on Monday March 18, 2019 @08:52PM (#19427020)
>>Irrespective of that, these days I am hard pressed to not use typed JS in some form or fashion anyways.

What do you mean by "anyways"? I use TypeScript with Vue and it's great.

Re:How we do Vue: one year later (2017) by jimmy1 on Monday March 18, 2019 @09:08PM (#19427124)
Despite whatever framework I use, I believe adding types improves it and reduces bugs, Vue included. (These days I'm favoring ReasonML and that skews me to React, but I believe Vue.js is also available on Bucklescript)
Re:How we do Vue: one year later (2017) by Rapzid on Monday March 18, 2019 @10:46PM (#19427640)
I could see it being great if everyone on the project were writing class components and using JSX. String templates and extended objects?

Mutiny.

Re:How we do Vue: one year later (2017) by Rapzid on Monday March 18, 2019 @10:41PM (#19427628)
My least favorite part of Vue. Proper intelisense/checking for the templates never materialized either. A start-and-stop effort or two languishing in the Github issues..

I have a feeling after Vue 3 hits and in a couple years JSX will be the defacto way to work with Vue.

Re:How we do Vue: one year later (2017) by petepete on Tuesday March 19, 2019 @03:23AM (#19428765)
Putting three bits of code/markup written in different languages in the same file was always a bad idea.
Re:How we do Vue: one year later (2017) by wishinghand on Tuesday March 19, 2019 @02:15AM (#19428492)
Non string values in props and attributes is basically my only complaint about Vue, but saying that it's HTML with functionality tacked on is so completely uninformed. It's got all of the functionality of React, and can do cool stuff with slots (both scoped and unscoped), renderless and/or functional components.

The "I wouldn't use Vue except for a small project" meme really needs to die too. Vue's build process is mature, has server-side rendering, and is used by some of the biggest companies in the world. If it's good enough for them at scale, it's good enough for the rest of us.

Re:How we do Vue: one year later (2017) by airstrike on Monday March 18, 2019 @10:32PM (#19427580)
> rather than JSX's more sensible curly brackets

I'm still waiting for the 2019 equivalent of http://haml.info/

Re:How we do Vue: one year later (2017) by hombre_fatal on Tuesday March 19, 2019 @01:48AM (#19428399)
I think Pug is the closest thing to Haml with traction: https://pugjs.org/language/conditionals.html

Here's a Pug -> JSX transformation: https://github.com/pugjs/babel-plugin-transform-react-pug

Detouring from the most popular path tends to come at the price of tooling idiosyncrasies that are rarely worth it, but it seems to at least work with eslint-react and has syntax highlighting in some editors.

Re:How we do Vue: one year later (2017) by airstrike on Tuesday March 19, 2019 @10:49AM (#19431284)
Love it! Thanks for sharing
Re:How we do Vue: one year later (2017) by mateuszf on Tuesday March 19, 2019 @04:25AM (#19429000)
How about Hiccup?

Some examples here: https://reagent-project.github.io/

It's not haml, but I'd argue it's awesome.

Re:How we do Vue: one year later (2017) by airstrike on Tuesday March 19, 2019 @12:37PM (#19432478)
Thanks. Seems nifty but ClojureScript is a bit too foreign for me
Re:How we do Vue: one year later (2017) by Can_Not on Monday March 18, 2019 @10:47PM (#19427649)
> using quote marks awkwardly to enclose a statement rather than JSX's more sensible curly brackets

Sounds like you should be making more use of computed properties and component methods.

Re:How we do Vue: one year later (2017) by yughurt on Tuesday March 19, 2019 @12:58AM (#19428186)
Use JSX in your Vue. It's supported just fine.
Re:How we do Vue: one year later (2017) by furicane on Tuesday March 19, 2019 @09:09AM (#19430395)
Basically, what irks you is that Vue separates presentation (visual) from the logic via <template> and <script>, reusing components via HTML elements is poorly thought out and binding values to attributes is bad because hey, you can actually use JS to compute the value.

Naturally, even though you can disregard the templating and resort to idiomatic JS, like one in React, you managed to develop an opinion after not using the features you like.

This just makes no sense honestly. I'm all for people having opinion to the point where you can blatantly say "I hate Vue because I like React more", there's literally no need for justification.

But spewing nonsense just to justify your preference is just bad. Are you a junior dev by any chance?

I've used both extensively and I can recommend Vue over React because React is a pile of mental manure. I never understood React hype, but then again - IT is a fashion business, and when "leaders" invent crap - flies tend to follow.