Live data from Hacker News

Vue.js vs. React: what happened in 2017

pixeljets.com

151–160 of 177 posts

Re: Vue.js vs. React: what happened in 2017

#152

What I find most interesting in these results is the satisfaction percentage i.e. (Used it before and would use again) / (Used it before and would use again + Used before and would not use again). - In 2016: React - 91% satisfaction Vue - 91% satisfaction Angular 2 - 65% satisfaction No framework - 65% satisfaction Ember - 50% satisfaction Angular - 40% satisfaction Backbone - 31% satisfaction - In 2017: React - 93%…

That result doesn’t surprise me at all, not everyone is working on a huge project and most of those frameworks are overkill for small tasks, sometimes pure js (with the odd library here and there) is all you need.

Re: Vue.js vs. React: what happened in 2017

#153
post #144

Earlier quoted context omitted.

> and is embedded in normal javascript Exactly! I don't know, but I've always found that disgusting. It turned me off React when I first saw it, and it still does. Then people use it to defend react, and I'm just like 'Lolwut? Did we spend years learning that SOC is a good thing only to throw it out of the window?' I'll be the first to admit that any Vue template quickly becomes soup as well, but at least it's only h…

JSX is a thin XML-like DSL on top of Javascript.[1] Unlike untyped strings with a custom parser of Vue, which require you to write something that’s neither HTML nor Javascript. You can have as much separation of concern as you like with React. [1] https://reactjs.org/docs/jsx-in-depth.html

JSX is also neither HTML nor JavaScript.

Re: Vue.js vs. React: what happened in 2017

#154

Earlier quoted context omitted.

JSX is a thin XML-like DSL on top of Javascript.[1] Unlike untyped strings with a custom parser of Vue, which require you to write something that’s neither HTML nor Javascript. You can have as much separation of concern as you like with React. [1] https://reactjs.org/docs/jsx-in-depth.html

JSX is also neither HTML nor JavaScript.

> JSX is a thin XML-like DSL on top of Javascript

^ this.

It directly translates to `React.createElement`. This is also why everything inside {} is pure Javascript including things like proper `this` etc.

Re: Vue.js vs. React: what happened in 2017

#155

Coming from Angular, I'm biased towards entities declared in the form of a class. It's a style that is easy to manage and familiar to most programmers. Vue currently seems to be a mix bag of styles. My take away from the little that I dabbled: - You need the vue-class-component dependency in order to declare class based components, otherwise, you're stuck with the awkward object literal notation - For state managemen…

I couldn’t disagree more. Unless your team have Super in depth knowledge of angular then it’s the wrong choice. It’s defaults to progagate changes cause rendering perf issues that are so frustrating to fix. Out of the box react or vue performs better than angular hands down. I hate that after learning angular 2 I realise I should not followed tutorials and advice and just switched all the defaults off on classes and…

I don't know what convoluted patterns you where implementing, but out of the box, the default change detection in angular is performant, esp if you start to leverage observables and the async pipe (to eliminate the need for component onDestroy maintenance tasks). It's a joy to use. Yes Angular provides a lot more options than react or vue, and maybe confusing given the scope of what's possible. However, after the initial learning curve, Angular is a very efficient framework / pattern to work with in a team setting.

If you resort to manual change detection, then it's an obvious sign of needing to refactor your design.

Re: Vue.js vs. React: what happened in 2017

#156
The reason I am not even remotely considering React is the Facebook itself and what this company represents - exploiting people's minds and emotions to fulfill their business plan. I can't help it but if I would use react, I would not be able to get this feeling out of my mind, so if there is viable alternative - vue.js, I am definitely going that way.

Something similar like using cosmetics that have been tested on animals, if I can choose, I choose something else.

I know this should be more of a technical discussion, just I can't help but think of this aspect when it comes to React.

Re: Vue.js vs. React: what happened in 2017

#157

Earlier quoted context omitted.

There’s not any more to learn vs html than jsx. It’s like 5 relevant constructs that all follow the same form, and the colon. Takes 20 minutes to have it down pat. v-if is actually a big reason I prefer Vue. Ternary operators in JSX are pretty ugly. The other is that Vuex just feels so perfectly integrated. I've never felt Redux blends in particularly cleanly, though I certainly don't judge people that do prefer it.

Ternary operators in JSX are valid javascript expressions . As is anything that goes into {} All of the following is neither Javascript nor HTML: v-for=”x in list” v-if=”conditional” v-on:click=“function” v-bind:key=“something.id” etc. etc. etc.

I'm aware of that bit, I just think they're an ugly piece of control flow inside JSX, and they're also not a particularly versatile piece of control flow.

Especially for the else-if case - you end up with repetitive conditionals to replicate that.

Re: Vue.js vs. React: what happened in 2017

#158

The simple answer is in reading the chart. Look at "I've USED it before, and WOULD use it again". React isn't just popular. It also consistently provides good developer experience. You have to compete not only against React's popularity, but also against that . React: - Used it, would use again: 14k - Used it, would not use it again: 1k (7%) Vue: - Used it, would use again: 4.6k - Used it, would not use it again: 454…

It's not really fair to make a comparison between react with JSX and vue without webpack. In practice you use webpack for making components with separated js/html/css, so Vue ends up looking a lot better than the above. That's actually the big draw for me, organization into single file components which can be parsed as simple html. The js component structure is just another piece of that. You're passing vue a template for creating components in an organized/standard way. You can define your own render function if you want the freedom, but you start out with something clean and well organized.

Vue is definitely doing things behind the scenes, but it's nothing all that complicated.

I wouldn't say it's hoisting. It uses the data function to create component instance objects which it then adds the template's computed props/methods/watchers etc on to, and links with the life cycle hooks.

If you created the component object yourself instead of a definition for it, there would be less magic going on for sure, but things would be much less organized.

(Minor: I don't use vue without webpack, but I assume data should be a function which returns a data instance, so what you've written won't work in Vue unless it's different for the top level component?)

Re: Vue.js vs. React: what happened in 2017

#159
post #51
post #16

Earlier quoted context omitted.

Appreciate the comment about high and low bandwidth performance by vue. 80% of the world is low bandwidth and such solutions built with such tools have an opportunity to have a much farther reach. Have you had any exposure to using vue as a progressive web app that can sync and work offline first? Have you come across any vue.js offline app experiences?

I've looked at PWA & working with offline, but it's an optimization I'd like to have, not one that we absolutely need. Right now, given how crunched we are for resources, everything I work on has to fall into the category of "absolutely need", otherwise I de-prioritize it. For us, the reason why we don't necessarily "need" PWA or full offline is that we do have an initial online component that is dynamic, so fully su…

Appreciate your detailed reply. I'm working on a problem with mobile, offline first as a key part of the solution and have been leaning towards vue if for nothing else it's appearing simplicity, flexibility, and ability for new devs to get up to speed on the project quicker.

The current incarnation / wave / interpretation of PWA still seems to be maturing. The js layer definitely brings its challenges and rewards, while browser innovation and evolution continues to better support PWA.

Still.. A bit of this PWA stuff makes me feel like we're going through a cycle from the past.

Syncing ones data and being offline for the majority of time to work on a mobile laptop or pda was normal with dialup, prior to wifi. Tools like Lotus Notes apps ran and synced data for offline use reasonably well including handling conflicts (while not so good at other things).

Offline first syncing is still largely a need inucrative remote industrial operations today and for the majority of countries in the world whom have much less bandwidth access, I'm glad PWA is emerging as a tool along with WebAssembly.

I found a few projects using vue and PWA and will try some things out - want to avoid any assumptions of adding PWA later as it's a key to my problem set.

Re: Vue.js vs. React: what happened in 2017

#160

The simple answer is in reading the chart. Look at "I've USED it before, and WOULD use it again". React isn't just popular. It also consistently provides good developer experience. You have to compete not only against React's popularity, but also against that . React: - Used it, would use again: 14k - Used it, would not use it again: 1k (7%) Vue: - Used it, would use again: 4.6k - Used it, would not use it again: 454…

It's not really fair to make a comparison between react with JSX and vue without webpack. In practice you use webpack for making components with separated js/html/css, so Vue ends up looking a lot better than the above. That's actually the big draw for me, organization into single file components which can be parsed as simple html. The js component structure is just another piece of that. You're passing vue a templat…

Follow up, I was on my phone before, this is what working with Vue typically looks like:

    
        
        

export default { data() { return { message: "Hello Vue.js!" }; }, methods: { reverseMessage(){ this.message = this.message.split('').reverse().join(''); }, }, } .some-class{ color: black; }
The thing to note is that there are other objects which can be added to the component definition which add a lot of utility and keeps things standardized: created, mounted, computed, watch, etc. There's a bit of magic behind the scenes to make it work, but it's worth it for the standardization/organization in my opinion.
Post reply on HN