P.S. Vue contains React. You could in principle write your components React style.
Vue.js vs. React: what happened in 2017
151–160 of 177 posts
Re: Vue.js vs. React: what happened in 2017
#152What 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%…
Re: Vue.js vs. React: what happened in 2017
#153Earlier 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
Re: Vue.js vs. React: what happened in 2017
#154Earlier 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.
^ 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
#155Coming 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…
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
#156Something 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
#157Earlier 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.
Especially for the else-if case - you end up with repetitive conditionals to replicate that.
Re: Vue.js vs. React: what happened in 2017
#158The 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…
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
#159Earlier 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…
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
#160The 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…
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.