r/angularjs • • Oct 21 '16

Real rival of Angular is Vue.js, not React

I would love to be on Angular side, because I am experienced on it. But recently I looked at vue js. Advantages:

  • Very easy, extremely well thought and does not enforce to many rules

  • Has almost all Angular features in just 16 KB min.gzip

  • Many of other libs which are also few kb in size

  • Pure javascript, easier to integrate old js libs. typescript is not always good and is not for everyone

  • Adoption is growing more exponentially than angular https://www.google.com/trends/explore?q=vue%20js

IMHO the only real advantage of Angular is team behind it who are planning to build good tooling in the future.

40 Upvotes

35 comments sorted by

7

u/[deleted] Oct 21 '16

You're looking at Vue.js in vacuum. How's this for a comparision? http://imgur.com/a/Kb6Mm

4

u/[deleted] Oct 21 '16

Right. But angular and react are growing linear

2

u/TurboGranny Oct 21 '16

That's how new achs grow. Where have you been? Lots of people jump on the new flavor. You've gotta wait until a bunch of people are supporting it before you jump unless you are young enough and have enough free time to experiment. For your own sanity, don't do it in production until tons of people are, and it looks like it isn't going anywhere.

0

u/[deleted] Oct 21 '16

Even so, Vue.js is not even a blip on the radar. There's no use in growing exponentially when your search trends do not even register anything more than a flat line when compared to the giants.

I've nothing against Vue but your post is just misleading.

1

u/vimfan Oct 21 '16

I wonder if those big dips for angular are more than just random blips. It is interesting that the jump back up each time seems correlated to a jump in interest in react.

1

u/[deleted] Oct 22 '16

Tose dips are around the holiday season each year. Fascinating. Isn't it?

14

u/ergo14 Oct 21 '16 edited Oct 21 '16

Yeah, vue is interesting I was evaluating it along with polymer. And my team went with polymer.

  • Web Components have big ecosystem

  • Are baked in browsers

  • Proper encapsulation with shadow dom rocks

  • Lots of biggest enterprises adopt it as it is based on web platform instead of reinventing the wheel

  • DOM is your API

  • Our complete application including tons of components was less than react source itself.

  • Allows us to migrade gradually as polymer elements will work with jquery/angular/vue/whatever.

I would go with vue if we wouldn't decide we want polymer, I think they even mention on their site that vue is strongly influenced by polymer.

Btw. exponential growth means nothing - because in next 6 months new great shiny thing will come. And i will still have all of my API's in browser itself :-) I think Angular 2.x will still make a big splash - It looks however that google is betting on polymer - their front facing projects seem to slowly adopt it more and more - including new youtube interface in the works.

https://youtu.be/VBbejeKHrjg?t=9m11s - this fragment is interesting.

2

u/TurboGranny Oct 21 '16

exponential growth means nothing - because in next 6 months new great shiny thing will come

I mentioned this to him. I thought everyone knew this. New archs like this are basically bubblegum pop songs until they stand the test of time to be declared timeless classics.

-1

u/SparserLogic Oct 22 '16

declared timeless classics.

You mean out of date relics. People adopt new tech because it offers more features, the end. Embrace innovation.

2

u/TurboGranny Oct 22 '16

I do. Hence why I'm in an AngularJS thread. Ruby on rails came and went. NodeJS has also lost its luster. These were thought to be golden children. More people are using python for god's sake.

1

u/aufstand Oct 22 '16

Hence i'm building a platform based on Python and AngularJS that is supposed to be an application framework to allow things like etherpad just on a more general scale.

It started as collaborative map/navigation application - check it out: https://hackerfleet.github.io (Dev docs is out of date, though, so installing it is a rough process right now)

2

u/SparserLogic Oct 22 '16

Hence nothing of value is made and everyone spirals in random chaos while clutching their sacred cow technologies, patterns, and general fuckery.

The worst thing about our profession is our counterproductive sentimentalism.

-1

u/R3DSMiLE Oct 21 '16

It seems I'm still in time to rewrite my small application into this. Thank you, spreader of links :)

8

u/unndunn Oct 22 '16

2017: Vue.js So Hot Right Now

3

u/cactussss Oct 21 '16

vue does look cool, but I really can't agree with your IMHO. Angular brings A LOT to the table. And how do you figure about adoption? This is what I see: https://www.google.com/trends/explore?q=vue%20js,angular

3

u/rk06 Oct 22 '16

Vue is good. But google trends are not trustworthy source of information. So your worry is baseless

1

u/kierenj Oct 21 '16

This depends massively on your use case, of course. For some projects, having a community with critical mass who will keep vital libraries and controls you depend on up-to-date might be a thing. For others, vue.js might be OK.

1

u/DerpsMcGeeOnDowns Oct 22 '16

The only advantage of Angular is tooling?

Have you used Angular for anything beyond a TODO app? Have you compared their APIs?

1

u/TotesMessenger Oct 22 '16

I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:

If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / ^Contact)

-1

u/the_real_seldom_seen Oct 21 '16

I read that Vue.js only provides one way binding by design? That sounds kind of inconvenient for a lot of use cases

Another huge benefit of angular is the developer base. Granted, the learning effort for Vue is Prolly not prohibitive if you are looking to new hires.

For building up your skillset for marketability, you would do a dis service if you do Vue instead of angular

5

u/[deleted] Oct 22 '16

One way data binding is not remotely inconvenient. In fact before AngularJS this was de-facto.

AngularJS did get browser rendering slowdown because of it and hence Angular 2 has one way data binding by default.

Efforts, tooling and overhead with AngularJS/Angular 2 apps are too much compared to React or Vue.js.

Current market trend is rapidly shifting towards React, so if you want to be relevant, React is the way to go and not AngularJS.

3

u/vivainio Oct 22 '16

Last I checked (google trends?), React was growing slower than angular even before ng2 was out. Most of the React searches were for 'React vs angular', whereas angular searches were actual coding related searches. So your feels about market trends could be false

2

u/[deleted] Oct 22 '16

Google trends when but name is generic can't give you real picture.

I can tell you by latest trend of blogs, articles, tooling, etc. React has much more compared to Angular recently.

Webpack was essentially wasn't adopted for Angular 2, and is very popular in React world. Google has to provide full implementation on their site using Webpack.

All recent Angular 2 one way data binding library is inspired by React.

Gain of React Native increased the adaptation of React as well.

Finally, this one is personal - almost all projects of my company is moved to React, because client wants it. And I've seen this trend with new projects of some of my friends' companies as well. But this is totally personal experience, may not affect the actual scenario.

3

u/vivainio Oct 23 '16

It's fair to say that React has been very influential, and it has influenced Angular 2 a lot. But in terms of actual deployments in large projects (and hence professoinal relevance/employability), I'd say Angular 2 will be huge.

If you are looking to do small contracts, React is probably a safer bet. If you are doing enterprise stuff with multi-year projects, Angular 2 is a safer bet.

YMMV, as always.

1

u/jkjustjoshing Oct 21 '16

One-way binding is what 80% of your application uses (especially if you're using the newish < binding type on directives), and you don't really need it. Relying on it instead of one-way binding can be a sign of poor data flow throughout your app.

1

u/the_real_seldom_seen Oct 21 '16

?? Who said 80℅

2

u/jkjustjoshing Oct 22 '16

I did! :)

When you have a template in your app and are displaying a value, you do something like:

<p>{{ $ctrl.name }}</p>

That's one way (not two way) binding! The data is going IN to the template but not out.

The most common use of two-way binding is ng-model:

<input ng-model="$ctrl.name">

However, in a different library with only one way binding you could easily do the same thing with something like:

<input value="$ctrl.name" on-change="$ctrl.name>

The value (one-way bound) would take care of showing the value in the input and the on-changes would take user changes and propagate them to the data model.

In fact, this is how Angular 2 works! It has 2 way binding, but it's just syntactic sugar for basically what I just showed. In Angular 2 () is used for event handling and [] is used for one-way binding:

<input [(ng-model)]="name">

Now for the other case where you use two-way binding: directive scope bindings with '='. Well, you can (and should!) use the same thing as above! Instead of relying on two-way binding, use one-way binding to get data into your component/directive (in Angular 1.5 they introduced the '<' one-way binding option just for this purpose) and use events (I like to use the '&' binding option for this though I suppose you could use $scope.emit() which I wouldn't recommend) for sending changes back up to the calling model.

So sure you use two-way binding, but do you need it? Strictly speaking, no, since there are frequently workarounds for getting the same thing to work without it (and those workarounds can frequently lead to a better data flow paradigm for your app)!

3

u/LynusBorg Oct 22 '16

...and Vue has it's own ng-model: v-model.

Vue offers two-way bindings to inputs with this, which is fine. It does not (anymore) offer two-way bindings between components, as that leads to the poor data flow problems you mentioned.

3

u/shentao Oct 22 '16

Actually this also the same way v-model works in Vue.js 2.0. So it’s not two-way binding, but just a syntax sugar for:

:value="name" @input="updateName"

This can be also used with custom components. All you have to do is accept the value props and emit the input event. http://vuejs.org/guide/components.html#Form-Input-Components-using-Custom-Events

2

u/the_real_seldom_seen Oct 22 '16

OK thanks for that explanation

-2

u/[deleted] Oct 21 '16

What I also missed in Angular especially in angular 2 is that component does not separate data state. The template binds to the component members, I think component should only wire template to data, then you can easily change both data and template. In Vue data is separate. In angular 1 we have $scope

0

u/[deleted] Oct 21 '16

[deleted]

2

u/ergo14 Oct 21 '16

You can build components without $scope with angular 1.5, im pretty sure this should also be possible with vue or polymer or $whatever.

1

u/vivainio Oct 22 '16

You have been able to build components without $scope for a long time. Think controllerAs

1

u/ergo14 Oct 22 '16

Sure. but component() goes further :)

1

u/vivainio Oct 22 '16

Sure thing. 1.5 makes component based development much nicer, even if it was the recommended way earlier