Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Vue 2.0 is here (medium.com/the-vue-point)
250 points by wassago on Sept 30, 2016 | hide | past | favorite | 69 comments


Vue deserves quite a bit of attention.

It's the simplest framework I've found to use in the same style as react (databinding, modules, etc) while still allowing you to use the html/css you've probably already written.

This really shines when you want to do something not quite single page appy in your, for instance, bootstrap based site. E.g. a complex web form with some interactivity (autocomplete, add/remove rows, one element affecting another element). This is complex enough to make it a pain to use jquery, but small enough not to want to rewrite the html in a react-compatible way.

That use case seems to be the majority case for me which makes Vue my primary tool these days for web front end.

Good stuff!


VueJS has what I liked in Angular 1.x (html-enhancement, directives) and also in React (building reusable components). Having built projects with both, I quickly felt at home with VueJS. It definitely deserves its place in my toolbox, and I'm definitely going to check that v2.0.

btw, my 1st VueJS website that my webagency launched 1 month ago: http://lamegapromodesgrandesmarques.com


> databinding

How is that in the same style of React? To me, Vue feels like a cleaner version of Angular and very little like React.


That specific feature reminds everyone of Angular, indeed, but more generally speaking, Vue is a small framework, focused on the UI (vue-view, get it? :)) and if you use it with Vuex, you can end up with a reactive app very similar to one written in React/Redux.


" I've found to use in the same style as react (databinding..."

React...databinding? huh?


It looks, corporate world and serious projects already bet on more opinionated, more standardized option, so they bet on Ember.js. Luckily Ember.js is improving nicely, super fast, easy to use, easy to learn and a super smart community around it. CLI, data management, addon ecosystem are just a few feature, what makes it unique. Vue.js, React, Angular should learn from Ember, however they are 1-2 years behind Ember, so it takes a while to catch up.


You can use react for parts of your html the same way you can use vue. React doesn't force you to make your whole page in react.


I came across Vue through Laravel and I think they are definitely the best frameworks for their own language (JS and PHP). And the best part is that with the latest versions (2.0 and 5.3) they are working really nice together. Almost as if they were part of the same ecosystem.

It's incredible how easy it has become to make a new web app that has everything you need (registration, authentication, api, JWT, notifications,...) with just one command line (laravel new project). It's a huge jumpstart that allows you to focus on what's really important and forget about all the annoying boilerplate.

And since Vue.js is so well integrated with Laravel, you get all the benefits of the back-end also on the front-end. With all the authentication and API with JWT (and much more) ready to go, it becomes also a great way for newcomers to learn using Vue and play around with it.

These are 2 great videos of Evan You (creator of Vue.js) from Laracon 2016 https://streamacon.com/video/laracon-us/evan-you-vuejs-works... https://streamacon.com/video/laracon-us/evan-you-vue-router-...


Vue.js is by far the sanest framework available for JS, period. It has excellent docs, it is intuitive, well written and well maintained.

The only real complain that I have about the framework itself is about components. IMO they are the wrong abstraction (they smell suspiciously like objects ) and with their custom .vue extensions, are a pain to work with in my text editor.

With that said, after working on a fairly complex Vue app, I won't be writing any Vue apps again. The reason has nothing to do with the framework itself: although it mostly tries to do the right thing, JS just pushes you in the opposite direction every time.


I have written a webpack plugin which generates `.vue` files automatically and you just keep writing `js`, `css` and `html`.

https://github.com/pksunkara/vue-builder-webpack-plugin


What's the alternative?


1) Going back to server-side rendering + intercoolerjs (and a small bit of jquery) for simple stuff.

2) Elm | ClojureScript for complex apps.

Edit: To be clear, I've done large apps in Angular (which nearly made me regret choosing programming as a profession), React, Backbone and custom frameworks, and Vue.js wins by a large margin if you're stuck with JS.


Personally, I'm a huge fan of Elm. I'm a fan of languages with strong type systems and the functional paradigm is just icing on the cake in this case.

I haven't done too much with Elm, yet, but what I have done, I love it. It's exactly how I'd want front-end web development to evolve into. What I'm waiting for is the day (if it ever comes) that I can have Elm compile to WASM and mostly forget JavaScript.


Have you seen Cx? (http://cx.codaxy.com)

It's a feature-rich framework based on React for building complex web apps.

Disclaimer: I'm the author.


Immutable objects?


We adopted Vue at GitLab. We couldn't be happier. Our goal was to make frontend development simpler, and that's exactly what happened. Vue isn't strongly opinionated, it just let's you get stuff done faster. You can just use Vue by itself, with solid javascript practices. It doesn't try and "fix" javascript, it just makes things simpler. Evan, you've made an excellent framework. Thank you.

When we were deciding between a few other frameworks, the choice was very easy.


Can anyone talk about their experience with Vue as opposed to Angular, Angular 2, and React/Redux? I am fan of Angular 1, but Angular 2 seems to actually just be an inferior version of React/Redux. At first glance Vue seems to be similar in spirit to Angular 1. Is that correct? Any first-hand experiences would be welcome.


Just recently migrated our main production application from Angular 1.x to Vue due to a massive rewrite of our core logic and some general messiness in the front-end. Extremely positive outcomes so far. It's an easy framework for our junior developers to pick up and the specificity of the framework allows us to pick and choose the libraries we're comfortable with.

While it shares some similarities with Angular 1 semantically, Vue.js is at its core extremely different. The framework is very light and entirely component based, meaning that the concept of DOM elements as directives and controllers goes away. It also does away with dirty checking so you can use Object.defineProperty to set up read-only array values, something that was causing us to run into infinite digest loops in Angular.

There are lots of other differences but in general, the transition from Angular 1 to Vue.js was relatively painless. There's a small learning curve when getting used to the data-binding through getters and setters but once it clicks it's smooth sailing. Hope this has been helpful.


Having worked with Angular and React before, moving to Vue was a breeze. The franework is very intuitive, the documentation is great and the community is very welcoming and supportive. Vue had the CLI tool before React came out with their counterpart (and I still find the Vue version superior). You also have an official Vue version of Redux, and the Vue Router that doesn't completely change every 2 weeks. API compatibility is also better than Angular 1 vs Angular 2. That said, I checked Vue 2.0 docs last week and they seemed a bit less intuitive as the 1.x version, but it may have been just a WIP.


I have worked on ember, backbone marionette and react. Vue JS really shines by its simplicity and speed while embracing all the concepts we expect from a modern js framework _ component based, flux style store management with vuex, reactive dom. Documentation is great and we built great stuff and enjoyed the journey so far.


I've been writing vue apps for internal use for about 1 year now at my company. I have not used Angular, but coming from Ember and React, It is by far the most productive framework I use. It is small and unopionated so I don't spend the massive amount of time I do fighting ember. I also don't have to constantly refactor it like the react code base (which has been through flux, redux, and now a new version of redux again, not to mention third party libraries only tracking the latest of alpha react projects) For simple apps, you write some immediately understandable code that gives you 80% of what you want, and the other 20% it gets out of the way and lets you do your thing. Only downside is the English-language community is very small compared to the other frameworks.


Would you recommend learning Vue over Ember for a front-end noobie? I've started with latter, but already see some things I don't like.


Absolutely. I would get comfortable with a build tool like web pack and then try and build a quick and dirty vue.js app. I like that much of the complexity is opt-in and you can grow into parts of the framework / write your own as your apps needs evolves, something I particularly had trouble with when using Ember. (It's very much their way or the highway for everything, and several features we wanted to implement, the answer was simply "don't do that") Having shipped Ember apps to millions of users and being with it since 1.0, I'd say it's an excellent community, but not the tool I'd reach for again.


Thank you, will shift my focus on Vue.


@iaml Have you followed this tutorial? http://www.yoember.com Totally free. It is quite easy to follow and you actually build a very complex application.


@szines Thanks for the tip, will definitely check it out! The problem I have with ember is probably caused by me being new to front-end field, and is not necessarily caused by ember itself, but the whole stack needed to develop for it. For example I prefer using MDL over Bootstrap and when I tried using it I discovered it wasn't quite straightforward, but hacky I would say, certainly not a simple "include this .css and this .js in your source code." I eventually switched over to Semantic UI for my pet project, it works quite well for now.


I use VueJs for a side project after trying Ember and not liking how opinionated I found it to be, after considering Angular as I had used A1 but all the mess around A2 kept me far away, and considering React/Redux but wanting something that handled everything (routing/data/templating) and was a little more solid. That brought me to VueJs and it felt like a breath of fresh air. When it came time to decide on a framework to use at work for a new project VueJs was a no-brainer from my standpoint and it looks like that's what we will be going forward with. I'm glad 2.0 came out before we really got started.


If you would like to write complex, big application, or you would like to join projects, where more developer are working on the same application, than there is no better option than an opinionated framework. Faster onboarding, you can implement complex features very quickly. Ember.js is the best in this league. It is true, if your plan is not so serious, other frameworks are good options as well.


> At first glance Vue seems to be similar in spirit to Angular 1. Is that correct?

I don't understand why no-one wants to admit this so maybe I'm wrong but yes, I would say that's 100% true. Vue.js feels like a cleaner and slimmer version of Angular 1.


I wouldn't say it's inferior. There are some nice things about it (written entirely in TypeScript and uses RxJS and Observables) and it's more of an opinionated framework rather than just a set of libraries.


This may be a bit of bike shedding, but I have come to prefer JSX over just string templates. Angular 1 did things completely differently, so there it was fine, but no code highlighting because you are using a string literal seems bad.

Another bit that rubbed me the wrong way about A2 is all the uber-magical stuff going on and all the pitfalls it created. Trying to understand why you need to put an @Input() on targets but not sources and what the actual consequences of that are took me way longer than I care to admit.


It's written in Flow, not TS.


jrs95 is talking about Angular 2.


I regularly loathe Javascript. I'm familiar enough jQuery to get by and enough Javascript to drive business value.

I haven't touched Angular or React or Ember, mostly because of a distaste for Javascript, but also because I/my clients had no need for all the complexity it adds and the little business value it brings. Turbolinks is just fine for me/us/them.

But I have played with Vue. I spent a weekend hacking something together and it lives in production today. I'm so incredibly impressed by the library it almost makes me want to play with it more.


Having briefly played with Vue.js before, it always seemed the nicest of the front end frameworks. At least the one that aligned best with the way I like to work (it doesn't get in your way, much)

But I fear that the world is too small for 3 front end frameworks, specially when the other 2 are sponsored by Facebook and Google.

Do you think Vue.js has a chance? I hope it does


Actually got in argument with someone last week in defending his company's selection of Angular (which I've used) "you never get fired for choosing Google." Well I'm old enough to remember 'you never get fired for buying IBM.

My philosophy is you move ahead by choosing the best product and currently imho Vue is best. But then again having tasted the freedom of being an entrepreneur I couldn't ever work again in the big company environment.


> The official supporting libraries and tools — vue-router, vuex, vue-loader and vueify — have all been updated to support 2.0. vue-cli now scaffolds 2.0-based projects by default.

Very nice. Personally, I've been waiting for the vue-cli bit before even thinking about touching 2.0 since I try to avoid trying to build my own JS toolset.


Always good to see frameworks not built by big companies thrive.


Agreed! In many ways it is massively underrated precisely because it isn't backed by a Google or Facebook. Definitely glad that people are seeing its awesomeness based on merits. I love React and its whole ecosystem, but Vue definitely stands on equal footing. There's good reasons to love both.


Absolutely. This is what I love about Aurelia (a more fully-fledged SPA framework), it isn't run by a massive company, has a great community and the core team regularly listens to the community and participates in discussion. I think we are seeing a rise of new anti-behemoth frameworks that are able to move faster.


Vue has been my favorite view framework/library/whatever experience in JS thus far. Good docs, sensible supporting libraries, helpful community, easy to understand. Excited for 2.0.


Vue is the easiest and most powerful framework I have ever used in my entire life..


Forget Angular or React. VueJS 2.0 is the new shit. It really is an amazing framework. Good Job Evan!


For someone wanting to learn modern javascript, it's so hard to know where to start. So many different frameworks to pick from.

There doesn't seem to be much point asking for suggestions either, as everyone has a different opinion on what's best.


You should start with React, honestly. Learning React is a bit about learning the framework but in order to be a good react dev, you mainly need to know how to write some good JS. React views are not templates, they are just javascript function calls (JSX is just some sugar on top of some JS function calls).

After that you can basically try anything, but at least you will know pretty much everything about what modern JS has to offer!

I would recommend starting with create react app [1]. I think it can be used with other libs than react as well, the thing is just a strong webpack + eslint preconfiguration so you don't have to worry about it.

[1]: https://github.com/facebookincubator/create-react-app


I second it. If you are starting out, React is the way to go. Of all the frameworks I have tried, React is the one that seems most "sane" to me. Either React or Elm.


If you're interested in Vue.js, Laracasts has a pretty great free series on it here: https://laracasts.com/series/learning-vue-step-by-step


Once you learn how one framework works, it becomes much easier to try out other ones. Most of them adopt similar patterns. Sort of like programming in general :)

If I had a recommendation, it would be to just stick to one for a little while, and then once you're comfortable, branch out and try to 'optimize your opinion'.

edit: and I wouldn't recommend any specific one. If it's the first one you ever learn, and aren't building any serious projects with it, honestly choose whatever the hell you want.


I'm in a very similar boat. I always avoided the Front End like the plague in jquery days. I played with Vue 1.x and liked it a lot. 2.x certainly captures my imagination I may build something beyond an API ;)


That seems to be a big problem in the JS world (I am a mainly back end dev).


Does this "new" hyped framework needs entire libraries and basic components to be ported too? Every 12 months or so I check how the front-end mess is going and last time I tried a few React components and they all needed some compatibility layer with Bootstrap. Or they wouldn't integrate nice with popular stuff I used before, in the jQuery spaghetti times (that's when my front-end knowledged peaked).

Do we just throw away everything after a few months? At the time I couldn't find good components or make the entire thing compatible (it's the little bugs that get you), including "basic" stuff like a calendar with date and time, all the bootstrap components, select2. Not to mention proper i18n support. Oh, and it needs to work in every browser (at least the modern ones).

If Vue really is a react/angular for toddlers (like me), I hope it wins and that soon there's finally a component set that "just works" and doesn't get rewritten every cycle. I'm talking about components that go beyond the 80% use case. That you can install without thinking twice. That you don't have to worry if it's going to be abandoned next week.


>Does this "new" hyped framework needs entire libraries and basic components to be ported too?

Nope. It's just web technologies without reinventing anything you don't want to, which is why Vue's motto is "The progressive JavaScript framework", it's got nothing to do with politics :)

If you want componentization of some library you're gonna have to download the bindings, but if not, it's just HTML and you can roll just like you would without any framework. To make an example, I like using Material Design Lite for some cookie-cutter interfaces, and with Vue I simply used it in my templates like I always do. Then I found out about vue-mdl and it helps me cut down on the amount of HTML attributes and such making the thing more readable, so I npm installed it and started replacing things when I touched them and felt like it. But both ways of doing things live together and every bit of it was optional.


On my job we just picked Vue for a new project, and it's a great experience so far. We disliked the standard starter project with Webpack and its idioms, with un-inspectionable compiled javascript source code, but it was very simple and flexible to create our custom build. It's really a awesome framework, with excelent docs (we were even using the release candidate of version 2.0).

(edit: typo)


>We disliked the standard starter project with Webpack and its idioms, with un-inspectionable compiled javascript source code

The template generates source maps.


I hope it has first-class TypeScript support. Having worked in large TS codebase I can't imagine going back to a JS codebase of the same size.

Angular has TS and React has Flow, but most of Vue projects seem to use neither. This is fine for small side-projects, but I'm wondering if anyone could share experience building large Vue apps without types.


vue core, vue-router and vuex 2.0 all have typings shipped directly in the NPM packages.


That's really nice, but I didn't find any examples of TS + Vue in all three repos though. Guess I'll play around with it in the weekend.


Vue's "default" way of doing things is plain JavaScript or Babel if you're using the vue-cli templates.

However, with Vue 2 TS typings ship with the packages according to the final comment in this: https://github.com/vuejs/vue/issues/478 so I'd assume TS is officially supported.


Vue.js is magic. As I've said before, it's so simple it feels like cheating.

But take a look at the docs and the replies on Github issues for the other distinguishing feature - the give-a-sh*t-factor from Evan and the crew shines bright. Just about everything is understandable, purposeful and clear.


I love this framework. I came to it as a back end developer that needed to do some front end work and started off with Angular and then React. I couldn't believe how complicated these two frameworks seemed to be as someone who's done very little JavaScript coding. I then tried Vue and it was so simple, so logical and so productive.

What I love about it is that you can mostly intuit what to do to get something to work. It just feels very natural.

And the documentation is top notch.

I haven't ported to Vue 2.0 yet but I suspect the only issues I'll have will be with third party components built with Vue 1.0


Any good UI component library companion for Vue 2.0 you can recommend ? Something like Keen-UI

[1] https://github.com/JosephusPaye/Keen-UI/


Bootstrap https://github.com/yuche/vue-strap, captain obvious.


Does vue use vdom diffing? Last time I played with vue, it crawled when having a large number of bindings. Also it's magical data binding doesn't work very well for arrays of arrays.


I does use a virtual DOM for actual DOM rendering boost (I actually doubt that it's necessarily for most of the cases), you can find some details here https://vuejs.org/guide/comparison.html and using google.

This is a brier reactivity explanations https://vuejs.org/guide/reactivity.html So there is no magic, nor the digest cycles (no dirty checking), just and old fashion get/set (plus some useful stuff for the predefined object properties) and it's fine.


Vue 2.0 released last week and it moved to using vdom for rendering.


Congrats on the release!


Congrats!



Thanks, we've updated the link from https://github.com/vuejs/vue/releases/tag/v2.0.0 to this.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: