The arguments against JSX and React requiring many small components are very surface level and sound like "we couldn't figure out how to make it work for us so it must be impossible". 1. This was mentioned already, but, yes, you can use ternaries and boolean logic for simple conditionals (loggedIn && Logout || Login ) 2. When you need more markup, put them in an if-else statement in the same render function. render()…
When I see examples like this, it reminds me just how elegant & simple Mustache.js template can be: Mustache.render( "{{#loggedIn}}Hello{{userName}}{/loggedIn}} {{^loggedIn}}Please log in{{/loggedIn}}", state );
Why we chose Vue.js over React
241–250 of 267 posts
Re: Why we chose Vue.js over React
#242https://github.com/thewhitetulip/intro-to-vuejs
This is a work in progress.
I feel Vue is gaining ground because of it's simple syntax, there isn't much magic to it, just enough magic.
Re: Why we chose Vue.js over React
#243It has been quite some time since I started writing front end code, tried understanding angular, left it. I was lucky that I came across Vue.JS via HN, it was gitlab's post. I haven't ever tried React, because Vue is amazing. With nearly no knowledge of JS, I was able to write an app in Vue reading just the official docs, they are downright amazing. I faced the issue of webpack et al, thus I started writing a guide t…
Will be keeping an eye on your progress.
Re: Why we chose Vue.js over React
#244It has been quite some time since I started writing front end code, tried understanding angular, left it. I was lucky that I came across Vue.JS via HN, it was gitlab's post. I haven't ever tried React, because Vue is amazing. With nearly no knowledge of JS, I was able to write an app in Vue reading just the official docs, they are downright amazing. I faced the issue of webpack et al, thus I started writing a guide t…
Thanks for posting. I've just had a quick glance over the first chapter of your book and I like the simple approach you take to explaining the core elements of vue.js and SPAs. Will be keeping an eye on your progress.
I plan to finish everything off in the next few days. The chapter5 contains a working version of the code, but it sure needs some refactoring.
If you want, I'll email you when the book is done. Leave an email id somehow :)
Re: Why we chose Vue.js over React
#245The arguments against JSX and React requiring many small components are very surface level and sound like "we couldn't figure out how to make it work for us so it must be impossible". 1. This was mentioned already, but, yes, you can use ternaries and boolean logic for simple conditionals (loggedIn && Logout || Login ) 2. When you need more markup, put them in an if-else statement in the same render function. render()…
When I see examples like this, it reminds me just how elegant & simple Mustache.js template can be: Mustache.render( "{{#loggedIn}}Hello{{userName}}{/loggedIn}} {{^loggedIn}}Please log in{{/loggedIn}}", state );
Re: Why we chose Vue.js over React
#246Our company migrated to vue.js, 6 months ago. Our complex app is messy with JSX, router, and new dev can't keep up with code. Now we start every new app with Vue.js. The gap between junior dev and senior dev comes closer. They can collaborate with less bugs, less problems and less time to develop.
Re: Why we chose Vue.js over React
#247Earlier quoted context omitted.
He may have chosen to use newer syntax, but the same pattern can be used without computed keys with only a tiny more code: var stateUpdate = {} stateUpdate[event.target.name] = event.target.value; this.setState=(stateUpdate); I don't think there was anything necessarily wrong with his tone as he was addressing the tone of the original article.
Telling someone, "or maybe you should learn JavaScript" is kind a really jerky way of saying, "you don't know what you're doing". I do think it was a terrible way to share knowledge. Yet it was an excellent way to say, "I know more than you".
Re: Why we chose Vue.js over React
#248My man, a lot of the pain described in this article can be solved by Mobx: https://stackshare.io/mobx One of our engineers at StackShare[0] suggested it and it's fantastic. Mobx is very simple to understand and will make writing a "React" page a real joy again. Redux was way too complicated for what it gave, and just shot term after term after term at me that left me with a headache. I still don't understand Redux pr…
Re: Why we chose Vue.js over React
#249Re: Why we chose Vue.js over React
#250The arguments against JSX and React requiring many small components are very surface level and sound like "we couldn't figure out how to make it work for us so it must be impossible". 1. This was mentioned already, but, yes, you can use ternaries and boolean logic for simple conditionals (loggedIn && Logout || Login ) 2. When you need more markup, put them in an if-else statement in the same render function. render()…
Wow. Do people consider this kind of coding acceptable now? We spent decades trying to separate templates, business logic, and inlined JS, and you managed to cram all three into a short snippet.
I've spent decades telling people that trying to keep logic out of templates is a waste of time. A useful templating language has variables, conditionals, and even functions. There's no reason not to use a real programming language.
There's no good automated way to enforce MVC. How is an automated tool going to know whether "show this number to two decimal places" is a model thing (inherent precision of the data) or a view thing (presentation choice)?