Live data from Hacker News

Switching From React To Vue.js

vuejsdevelopers.com

121–130 of 186 posts

Re: Switching From React To Vue.js

#121

I stopped reading at "both are fast and light weight" because I don't find react to be "light weight". React is 275K (nearly a quarter of a meg) when it is minified and gzipped. 750K when it is not minified/gziped. We're talking about a web page UI here. It should be tiny for users with slow connections. React seems big to me and I can't justify it except in very large applications. As such, I struggle to find the re…

> React is 275K (nearly a quarter of a meg) when it is minified and gzipped. 750K when it is not minified/gziped. That statement is completely false. react@15.5.4: react.min.js is 21335 bytes uncompressed, 7353 bytes gzipped.

[deleted]

Re: Switching From React To Vue.js

#122

Do people like Vue because it's more declarative than react? Is it mostly angular devs switching and getting the best of react but still having directives? I like the control react gives me without the black box 'compiler' which seems like it makes a bunch more choices for you. I'm probably biased, someone cmv?

I hate directives. There is nothing you can do with them you can't do with just plain callbacks or putting React components inside another that renders its children. HTML templating directives are stupid too, I find myself looking up syntax references for angular even though I've used it for ages. (Think semicolons and magic variables like `$event` or `index` in *ngFor bindings – you don't need these unfortunate and…

I recently started forking the github package for atom which is built with react. I found it very confusing that render methods pass scope variables to controllers using directives. The number of times a variable gets passed back and forth from a JavaScript class to a template directive is just silly.

Re: Switching From React To Vue.js

#123
I remember a couple of years ago when people were posting about switching from Angular to React. Now it's React to Vue. I'm going to be honest and concede that Vue may well be better than React. But having used React productively for a couple of years now, I don't really see much point in throwing out something that works well in favour of something else that also works well. Back when it was "why we switched from Angular to React", it was easy to understand because Angular 1 is awful. But React isn't awful at all and I don't really see what I'm going to gain by switching to Vue.

Re: Switching From React To Vue.js

#124
post #118

There is a bit of React kool-aid in here, makes me really wonder if any of them have actually tried using Vue because the benefits and improvements you will see with Vue are immediately noticed. To be frank, the OP actually did a poor job of presenting Vue here because it only mentioned the similarities, which doesn't do any good for Vue. It did not get into areas where Vue is better than React, which is what most wo…

I'd love to see you elaborate. Your post is just Vue Kool aid.

Well, first, vue.js doesn't force you to use components. So you can just throw your data into the HTML page and see what happens. It's a huge win in the early phase of the project, as most of the time your page will change so much you will not see any reusable components before months. It's a real time saver, and let you refactor only the important parts in components later.

Secondly, you are not tied to JSX. While you can use JSX with Vue, it comes with a very simple and clean templating language that is much more natural to manipulate than mixing JS and a fake HTML.

What's more, you don't need webpack, not even babel to use Vue. You can actually drop the 30ko (gzip + minified) of the lib and create a decent projet as-is. Of course you can later setup a whole pipeline, with even server side rendering if you wish. But for a start, you can just use it as easily has you used to with jquery. Which means people comming to the project will be easy to train to: it takes one afternoon to comprehend react hello world. It's the time to understand the whole Vue lib.

Eventually the community is great : the doc is well written, the tooling is full of small details (such as .once.prevent or the dict classes) that makes your life easier and the API surface is kept small. Most third party tools adopt the same philosophy: pragmatic, useful, scale down then up.

Honestly after so much react, I'm happy I found Vue. It's just better. Doing training for both, I can also tell you that training for Vue is 2 orders of magnitude easier than react.

Vue is what react should have been really. But let's not blame react. The react dev created shoulders for the vue devs to stand one.

Re: Switching From React To Vue.js

#125
When I switched from Ember to react what I missed the most was the two ways binding, the computed properties and the router. From dabbling in Vue.js it seems to have incorporated the best of both worlds. I read over some of the technical implementation and it seems pretty sane. It seems too good to be true and I am honestly wondering what is the catch. Everything I have read about vue has been very positive so far. I am curious what are some of the cons of using vue

Re: Switching From React To Vue.js

#126

I stopped reading at "both are fast and light weight" because I don't find react to be "light weight". React is 275K (nearly a quarter of a meg) when it is minified and gzipped. 750K when it is not minified/gziped. We're talking about a web page UI here. It should be tiny for users with slow connections. React seems big to me and I can't justify it except in very large applications. As such, I struggle to find the re…

> As such, I struggle to find the reason React is so popular. Uhm, React websites run great in Chrome on a MacBook Pro. You seem to think that most web developers care about users on slow connections.

I am assuming that, yes. Websites with mass appeal should probably think about this. Yeah, I develop on a MacBook Pro with Chrome on a massive network connection, but I do an awful lot of web browsing on my phone from resteraunts and offices where there is somewhat crappy data coverage.

Re: Switching From React To Vue.js

#127

Earlier quoted context omitted.

> React is 275K (nearly a quarter of a meg) when it is minified and gzipped. 750K when it is not minified/gziped. That statement is completely false. react@15.5.4: react.min.js is 21335 bytes uncompressed, 7353 bytes gzipped.

I'm including everything you need to deploy in those numbers. You included only React and not React-Dom. My own try at setting up React results in a 750k js file when I follow the instructions below. I realize this isn't minified yet and I welcome feedback on how to make it better. https://www.joeldare.com/blog/post/create-a-react-app/ The top search results for react minified size show similar numbers to my 250k. Th…

You need to add uglify to your webpack.config.js.

https://webpack.github.io/docs/list-of-plugins.html#uglifyjs...

Re: Switching From React To Vue.js

#128
post #35

Things you're sacrificing when going away from React: 1. Stability. FB uses it for their main product, which is probably the biggest web app of them all, they pay many devs to work fulltime on it. People coming from Angular, who had to migrate all those breaking changes over the years know the struggle. 2. Options like React-Native, React-VR and co. React enables your devs to acquire a whole new range of possibilitie…

Just because Facebook is big and supports something isn't necessarily a good thing. Their goals, resources and accepted trade-offs aren't likely the same as your own. For a large company like Facebook, handling large changes to a library aren't a concern because they have essentially limitless development resources. For small operations like mine (and maybe yours) these breaking changes can reduce the time you spend actually improving your product significantly.

For me, the instability and unopinionated nature of the group of technologies that loosely define "React" have been a real turn off. When answers to questions like "What language should you program in?", "How should you store your data?" and "How should I handle routing between pages?" all have no specific answer, it leads to a fragmentation of knowledge that in my past experience usually leads to a technology's demise.

Re: Switching From React To Vue.js

#129
post #118

Earlier quoted context omitted.

I'd love to see you elaborate. Your post is just Vue Kool aid.

Well, first, vue.js doesn't force you to use components. So you can just throw your data into the HTML page and see what happens. It's a huge win in the early phase of the project, as most of the time your page will change so much you will not see any reusable components before months. It's a real time saver, and let you refactor only the important parts in components later. Secondly, you are not tied to JSX. While y…

To help put this in perspective, how heavily did you use React before switching to Vue? How did you feel about it at the time, before you were aware of Vue?

Re: Switching From React To Vue.js

#130

Earlier quoted context omitted.

react-router, do you mean v1, v2, v3, or v4 (or perhaps v5 and v6, I haven't checked if there was a new release with breaking API changes during the past 12 hours).

I mean react-router is almost a 3 year old library trying to handle a rather complex problem. The first three versions were largely the same with no major changes that I can think of except for switching from context to higher order functions. I think everyone is a little dramatic about the number of versions of the library, especially when they are going to continue to support v3.

Well, that just makes things even worse - now you have to choose which version to use, which is just proving the OPs point.
Post reply on HN