One of the most impressive thing about Vue.js was the ability of the framework to enter a field saturated with dozens of options, that was becoming dominated by a well-resourced oligopoly (Angular, React), and still win over developers jaded from Javascript-fatigue. The give-a-shit factor from Evan (the creator) is extremely high and was key to its success. Inspiration for anyone building a product in an established…
VueJS is pretty old, old enough to be there when React and Angular were just emerging as viable options. It's great, and I'm grateful for it being around and for Evan's contribution but I think it was pretty lucky timing wise.
Why we chose Vue.js over React
41–50 of 267 posts
Re: Why we chose Vue.js over React
#42One of the most impressive thing about Vue.js was the ability of the framework to enter a field saturated with dozens of options, that was becoming dominated by a well-resourced oligopoly (Angular, React), and still win over developers jaded from Javascript-fatigue. The give-a-shit factor from Evan (the creator) is extremely high and was key to its success. Inspiration for anyone building a product in an established…
VueJS is pretty old, old enough to be there when React and Angular were just emerging as viable options. It's great, and I'm grateful for it being around and for Evan's contribution but I think it was pretty lucky timing wise.
Re: Why we chose Vue.js over React
#43Re: Why we chose Vue.js over React
#44I believe React is popular (among other reasons) because you don't need to learn what is v-if v-else and other repeative commands when you have plain and simple JS equivalents. React has te philosophy "It jusy works", and people love this
Yes, I think the main selling point of React is it's tiny and intuitive API. I don't know how these frameworks compare in bigger sized applications, but if you just do a POC in Angular2, React and Vue.js, then React beats all of them. This probably leads to many people considering React for their new applications. If you go for bigger stuff, I don't know which would be better. I like React, but I also found it a bit…
Re: Why we chose Vue.js over React
#45Out of curiosity, one reason the author mentions (and I know, it's not his selling point) which I've seen others reiterate is that React's render() method doesn't support if statements. I know you can write something like the code below in React, so what exactly does that criticism refer to? function Home(props) { return ( HELLO Duis a turpis sed lacus dapibus elementum sed eu lectus. { (() => { if (props.location.qu…
HELLO
Duis a turpis sed lacus dapibus elementum sed eu lectus.
You specified a home query: {{location.query.home}}
No home query was specified
I don't know about you, but to me this code is 100% more readable than the React example you gave.Re: Why we chose Vue.js over React
#46I hope I don't get downvoted for asking this but is React going out of fashion already? A lot of the talk about it was "React is here to stay" or "React is as permanent as JS itself" but now this is the second or third time people seem to be going for Vue instead. What happened?
Maybe Vue is just becoming the new shiny.
Re: Why we chose Vue.js over React
#47As a programmer, React has been my go-to UI library for quite a while because I see always being in JavaScript mode as a benefit (no invented scope to learn or inject things into, no invented logic to learn, everything is lintable, easy-to-follow state change flow) that's worth the drawbacks (un-pretty conditionals in render(), manually handling form input), but I can also echo the feedback in this article when it comes to having designers working on your components.
> JSX is also the reason when you have to keep splitting your 15-lines-of-html-code component to 3 components, 5-lines-of-code-in-each.
> ...this approach of splitting components into super-dumb components because of JSX restrictions will always put you out of flow when you are solving real business task
I don't understand what this has to do with JSX without an example.
> ...now you have to create 10 functions to get input from 10 inputs. 80% of these functions will contain single line with this.setState() call
Working with forms is definitely one of the most painful parts of React, and one of the differences I most enjoyed when porting our sample app to Vue.js 1.x for inputs which only affect the value they bind (most interesting thing I learnt: the React component structure the original was written with mapped almost verbatim to Vue.js components, the main difference was in flexiblity of what you can pass down the tree - e.g. React components as props, but I believe Vue.js 2.x is now closer to React's flexibility), but most of this section comes across as hyperbolic.
Writing onChange handlers which are as generic as you can get away with for the current form is key, but it generalises to setting state based on input names, which can as be simple as the name of the state variable, or a path in state which should be set for simple form input even in deeply-nested forms, plus the appropriate value based on the input type.
e.g. if you're doing a simple form with text inputs, selects, radios etc. where checkboxes always correspond to boolean state, you could use this for every field (you don't even have to put it on each input, you can let onChange bubble up to a form with onChange={this.handleChange}):
handleChange(e) {
let {name, type} = e.target
let valueProp = type === 'checkbox' ? 'checked' : 'value'
this.setState({[name]: e.target[valueProp]})
}
(It's game over for simplicity once you want to do proper, user-friendly form validation, but that's a truth universally acknowledged :))Re: Why we chose Vue.js over React
#48Re: Why we chose Vue.js over React
#49I hope I don't get downvoted for asking this but is React going out of fashion already? A lot of the talk about it was "React is here to stay" or "React is as permanent as JS itself" but now this is the second or third time people seem to be going for Vue instead. What happened?
Well, there's a difference between going out of fashion and being revealed as something that shouldn't be used (like Angular and Ember). Maybe Vue is just becoming the new shiny.
Re: Why we chose Vue.js over React
#50Earlier quoted context omitted.
Yes, I think the main selling point of React is it's tiny and intuitive API. I don't know how these frameworks compare in bigger sized applications, but if you just do a POC in Angular2, React and Vue.js, then React beats all of them. This probably leads to many people considering React for their new applications. If you go for bigger stuff, I don't know which would be better. I like React, but I also found it a bit…
Do you have numbers? Angular 2 is quite small if you're using treeshaking.