20 ms·
Vue.js 2.1 Released
- sync 10y agoIs this looking a lot like Angular 1.x to anyone else? I've heard it's actually more similar to React but I'm not seeing it... ?
- buremba 10y agoYes, the tag names are even similar but the performance and simplicity is even better than ng2.
- ohstopitu 10y agohere's an link[0] to a comparison with react, angular 1 and others. [0] - https://vuejs.org/v2/guide/comparison.html https://vuejs.org/v2/guide/comparison.html
- k__ 10y agoHm, doesn't seem that much of a win for React users. The performance is compareable, but they went for templates instead of the "it's just JS"-philosophy of React. Reminds me of "the fear of turing complete templates"[0] Also, they mention their bindings are similar to MobX. I had the feeling MobX was a step back in the React eco-system, if I think about what Facebook wanted to achieve with Flux. But yes, overall it seems like a much simpler approach than React or Angular, not to mention Angluar 2, lol. But it seems to come at the cost of the points I mentioned, which were really a pain back in the days and got solved with Flux and JSX. It also doesn't seem to solve some problems that React didn't solve, like realtime asynchronous data or fractal state. [0] http://lhorie.github.io/mithril-blog/getting-over-a-fear-of-turing-complete-templates.html http://lhorie.github.io/mithril-blog/getting-over-a-fear-of-...
- meathook 10y agoYou can use JSX to write your render functions in Vue [0]. It's opt-in as the Vue community views them as overkill in the usual case. Personally, I appreciate having the intuitive approach for templating as the default for people who don't share my encyclopedic knowledge of web development. They can more easily follow along and contribute. [0] https://vuejs.org/v2/guide/render-function#JSX https://vuejs.org/v2/guide/render-function#JSX
- k__ 10y agoI see :) > I appreciate having the intuitive approach for templating as the default for people who don't share my encyclopedic knowledge of web development I always saw it the other way around, haha :) Why should I learn some template language, when JS can do the job and I already know it.
- Touche 10y agoJSX is not JavaScript. If its not in a spec that is ever going to be implemented by a JS runtime, like a browser or Node.js, then it's not JavaScript. It's a superset of JavaScript. If you admit that JSX is a superset of JS then the downsides become readily apparent. Many will still choose JSX and there's nothing wrong with that, but the argument isn't "why would I use X when Y is better".
- k__ 10y agoThe whole point wasn't about this syntax, but about the fact that React templates are just simple nested function. But maybe this would have been more obvious if I used hyperscript instead of JSX as an example.
- Touche 10y agoYou can't ignore syntax, hyperscript isn't very popular.
- SanFranManDan 10y ago
- kimshibal 10y agoIf you like JSX, please stick with React.
- k__ 10y agoI think it's okay, makes finding markup in .js files much easier. But I think I prefer t7, because it works 'native'
- misterhtmlcss 10y agoI loved how they did that! They actually invited the other experts to review and feedback on their declarations to ensure their work was honest and had integrity. Never seen that before. Have you? Also I wished it was clear if this doc was updated with Vjs2 or if it's 1.x or what. That's not clear anymore and they need to sort that out or the integrity is lost.. by accident, but still lost.
- ohstopitu 10y agomy respect for the project grew immensely (because it showed me that they really cared and it was not another "me too because I can and I have my own way of doing things" project).
- boxctim 10y agoit uses virtual dom to render and components https://vuejs.org/v2/guide/comparison.html https://vuejs.org/v2/guide/comparison.html
- threatofrain 10y agoIt's like Angular in that they use a similar templating language, and it's like React in that they're using a component-based declarative DOM API.
- nailer 10y agoIf you like the awesome simplicity of Vue, but prefer a more familiar mustache-style templating language with your virtual DOM, try ractive.js from The Guardian. http://www.ractivejs.org/ http://www.ractivejs.org/
- kabes 10y agoAngular also has a component-based declarative DOM API. Always had, but since version 1.5 it's more explicit.
- thejosh 10y agoYou can use it for a page that isn't a SPA for example.
- misterhtmlcss 10y agoThey openly talk about how they took what was successful in those platforms (React and Angular) and others, then built Vue with that in mind. Plus their goal from what I've heard was to also remove what other platforms did poorly (benefiting from hindsight) and hopefully do those things better by learning from their mistakes. Nothing about how they said this was done in a manner that was boisterous, just simply leveraging what has been learned from first movers and now they are hoping to pull their own Apple, by making a better product as second (or third or fourth.....) movers in the market. ;)
- hinkley 10y agoIt's more that many many frameworks imitate Handlebars, or accept that Handlebars is good enough and it's not worth inventing new syntax. If it's your opinion, as it is mine, that HTML frameworks should deal with HTML, instead of abstracting it away, then this isn't a bad thing.
- w0utert 10y agoSo far my Vue.js experience has been great. Even though I don't particularly enjoy front-end development and the tools and techniques I'm supposed to use for them, Vue.js has been a breath of fresh air between my frustrations with HTML, Javascript, npm, CSS, HTTP and all the other things that are needed to stitch everything together. It really is a great framework. The one thing that does still bug me these days is that even now that Vue 2.1 is out, many components I'd like to use are still not compatible with Vue 2.x, and almost all the Vue tutorials, questions, solutions, etc. I find are about Vue 1.x, which is mostly incompatible with Vue 2.x. But that should improve over time, of course.
- ohstopitu 10y agoare there any tutorials that would help a beginner start on that front?
- thewhitetulip 10y agoI'm writing one! https://github.com/thewhitetulip/intro-to-vuejs https://github.com/thewhitetulip/intro-to-vuejs
- misterhtmlcss 10y agoIt's still pretty ripe big guy. You keep promoting it like you are further along. I kept looking thinking there was more and there wasn't. Great start and I'm even happy to assist you, but ease up on the promo unless yare inviting people to contribute. Just a suggestion as someone who is keen to see a ton more on 2.x and is even also keen to help others like yourself; not against you or your efforts at all.
- thewhitetulip 10y agoPls don't take this personally, but I am not entirely sure what the problem is. I didn't say "I wrote one", I said, "I am writing one", which means it is not yet finished and is a work in progress. Any and all contributions are always welcome.
- overcast 10y agoSo glad this project is gaining more and more traction. Been using it since very early releases, when I was sick of dealing with overly complex front end libraries.
- tiv 10y agoI've been waiting for scoped slots for so long. I've implemented several workarounds since I started using Vue a year ago. Creating a directive to pre-compile a slot template in the child scope in Vue 1, and then once Vue 2 rolled around, making lots of functional components and passing them around. So glad they finally added this.
- M4v3R 10y agoIn case someone user Meteor - Vue plays very nice with Meteor and there exists a great integration package [1], which means if you're familiar with Meteor you can write full stack applications with it very easily and quickly with it. The package supports hot module replacement out-of-the-box. It's also dead simple to start using it, if you already have Meteor installed it's a matter of running "npm install" and "meteor". [1] https://github.com/Akryum/meteor-vue-component https://github.com/Akryum/meteor-vue-component
- mikebay 10y agoI'm been quite happy with riotjs by muut. Nice license and development flow.
- aikah 10y agoNice, I love Vue.js it is light weight yet fulfill 90% of the needs of a large SPA without a third party language, some bureaucratic dependency injection and without getting in the developer's way by mandating this or that build tool. But competition is good so I'm glad there is a front end framework for everyone out there.
- blitzo 10y agoThe sentiment 'competition is good' in the context of Javascript universe is a bit ironic since that's what led us to the recent fatigue grievance.
- aikah 10y agoPeople have different requirements, there is not a single framework that would make everybody happy. The issue isn't the the number of frameworks by the way but the complexity of the build tools in the context of Nodejs. Grunt,Gulp,Babel transpilers and co, they are not frameworks, they merely transform assets, yet they make JS development extremely complex and bureaucratic.
- AtticusTheGreat 10y agoI've been using Vue.js for a new project and it is a breath of fresh air after using React. It has all the benefits of Knockoutjs (which was my gateway into these types of frameworks), but much nicer in-code organization (I'm looking at you ko.observable).
- myf01d 10y agoI am sorry if this sounds too ignorant, are frameworks like Vue.js (I actually read the guide and understood some wonderful things about its philosophy since I am actually developing backend mainly) or React, etc.. reasonable to use in websites in general (instead of jquery or taking some tasks from it) or they actually only reasonable for mobile web applications and SPAs? What about the SEO and search engine rendering to custom HTML elements like in Vue.js components? is it okay or affects SEO?
- zfedoran 10y agoBoth Vue.js and React allow you render HTML on the server side. This helps get the first render out quickly where the browser can pick up the state and continue from there. https://vuejs.org/v2/guide/ssr.html https://vuejs.org/v2/guide/ssr.html
- St-Clock 10y agoIn vue.js, SEO is taken care of with with server side rendering[1]. This assumes that you are using node.js as your backend though. [1] https://vuejs.org/v2/guide/ssr.html#SEO https://vuejs.org/v2/guide/ssr.html#SEO
- chrisbraddock 10y agoOnly that node can talk to your backend right?
- Can_Not 10y agoI haven't heard of Laravel getting SSR yet, so yeah.
- Tade0 10y agoAs it usually is in this industry, the answer to this question is: "it depends". There's a point, where using jQuery alone just won't cut it. I guess a rule of thumb here would be: If you're providing a service that requires an account - you probably need something more than jQuery.
- sergiotapia 10y agoI tried to use Vue 2 for a pet project but couldn't get the routing to work. It seems the router was lagging behind in versions and there were no guides on "router 2.0". Does this version have a routing guide and production ready routing solution? That's pretty important.
- um_ya 10y agoTook less than two seconds to google. https://github.com/vuejs/vue-router https://github.com/vuejs/vue-router
- bdcravens 10y agoThis is the project they were referring to by "2.0". And your two seconds of googling found a Github URL with no documentation, which is what the commenter was lamenting. http://router.vuejs.org/en/ http://router.vuejs.org/en/ does appear to be fairly complete however. (linked from the README)
- dimgl 10y agoWe're using Vue and its router in production since 1.x, so I'm not sure where you got that impression...
- thewhitetulip 10y agoI would like to know more about your use of Vue and the router in production. Tips/best case guidelines?
- dimgl 10y agoIf you have a relatively large app and having URLs makes sense, the router is a no brainer. No real tips; the vue-router documentation is excellent. If you're coming from Vue 1, the only thing that did confuse me is that the router hooks have changed. The router now listens on `beforeRouteEnter` and `beforeRouteLeave` and these hooks only get triggered once per route change. Therefore, to listen to query changes on a route you need to watch the `$route` object.
- shams93 10y agoI'm going to build a vuejs markdown site editor similar to Gatsby I just don't like Facebook it's refreshing that an independent project is gaining popularity the server side rendering is a big deal when you want to support mobile well.
- peller 10y agoGatsby is awesome. Would love to see something like it without FB's licensing attached to the underlying libraries. Please do a Show HN when you've got something more-or-less working :)
- seanwilson 10y agoI'm looking to move a few projects from Angular 1. What do developers think of migrating to Angular 2 vs Vue for this? I've played with Angular 2 but can't shake the feeling that it's overly complex.
- kimshibal 10y agoAngular 2, not worth it. We made our decision to migrate an old Angular 1 app to Vue.js. Best decision ever.
- seanwilson 10y ago> Angular 2, not worth it. We made our decision to migrate an old Angular 1 app to Vue.js. Best decision ever. Can you elaborate? I've used Angular 1 a lot, Angular 2 a little and Vue not at all. What makes Vue better?
- bdcravens 10y agoVue feels very light, and you can use as much or as little as you need. With Angular 2 you really need to dive in, understanding modules, DI, Typescript, components, the various decorators properties, observables, etc. I like Angular 2 personally, but it really is quite heavy.
- pauleveritt 10y agoAngular2 has a huge surface area, conceptually. You might need that surface area. But it's daunting. Angular2 also expects you to teleport into a very modern future of tooling and development practices. That said, it's a safe choice...everything you might want to do has been done and complained about on StackOverflow. [wink]
- kabes 10y agoWell, it might help if you said why you're looking to move from Angular 1. What problems do you have with it? How many developers are working on the project? Do you use libraries like angular-material? ... There are a thousand factors why you'd chose one above the other. I would just be very wary of comments like: "Definitely framework X".
- CharlesW 10y agoFor folks who haven't tried Vue yet, I just completed my first project with it and I'm really excited about using it more. Specifically, I used learning Vue as an opportunity to upgrade a simple jQuery-based SPA (with a PHP backend) to ES6, JS modules and Vue. It was a little hairy to bite off all of that stuff at once, but the Vue community was really helpful. In contrast to more monolithic frameworks I didn't have to port everything at once, and the re-implementation of the bits I did port are sooo much cleaner. FWIW, there's a highly-rated Vue.js 2/Vuex Udemy course on sale for an impulse price of $14 (normally $190) as I type this. With the caveat that I just bought the course myself, at that price it seems like a useful resource even if you only have a cursory interest in Vue. https://www.udemy.com/vuejs-2-the-complete-guide/ https://www.udemy.com/vuejs-2-the-complete-guide/
- no1youknowz 10y agoThanks. With this coupon "CNETBF2016" it's now just $10 and I bought it at that price!
- johnmerced 10y agoThank you!
- afghanPower 10y agoGuessing that's an affiliate promotion code?
- no1youknowz 10y agoNot from me. I'm just trying to pass on the savings to HN users. :)
- markharris99 10y agoTo the OP: I also purchased this at $10, thank you! ------- I did a search for coupon codes and I found the exact coupon code from [1]. Can I ask, what would the problem be if the code was affiliated with an affiliate promotion? The end user pays $10, which I think we can both agree on. It's a "NET" benefit for HN users to learn something new very cheaply. If couponkoo negotiated with the vendor of the product, so that they can advertise a coupon and get some kick back, you know because they too have to keep the lights on. Is that such a big deal now on HN? Can you please explain yourself because I don't see an issue here personally! [1]: http://www.couponkoo.com/coupon/95-off-vue-js-2---the-complete-guide-incl-vuex-coupon-119504.html http://www.couponkoo.com/coupon/95-off-vue-js-2---the-comple...
- nkg 10y agoI still wonder why they moved the events from the constructor to the instance... Before 2.0: new Vue({ el: "#el", data: someData, events: { myevent: function(){} } }); after 2.0 : vm.$on('myevent', function () {})
- mixedCase 10y agoEvents in Vue 2 are now supposed to be used only for child -> parent component communication. If your needs are more complex then you're supposed to use Vuex.
- vbit 10y agoI have some projects in Mithril - is it worth it port to Vue?
- brlewis 10y agoSpeaking only for myself, I'm sticking with Mithril.
- deleted 10y ago[deleted]
- revskill 10y agoI've been a long time React and Angular user, but is still sick to implement correctly enough SSR for my projects. And VueJS just did it elegantly ! I must say, thank all React + Angular folks as the pioneer for better CHANGES. This is THE time for us to change. Really.
- solidr53 10y agoWhat is a correctly enough SSR? We use react in most of our projects with server side rendering without any problems at all. https://github.com/ueno-llc/starter-kit https://github.com/ueno-llc/starter-kit
- jaequery 10y agoI really miss 1.0's inline way of writing javascript anywhere inside the dom (attributes) via {{ execute_raw_js_code() }} as well as the ability to run filters on it. Is there anyway to get them back on Vue 2? I have to admit, this was a major step back for me when upgrading to Vue 2 from Vue 1. I also really loved the Vue 1's way of handling transitions. Now having them inside it's own wrapper really diminishes the elegance I felt from Vue 1. Wish there was some ways to get them back instead of having to downgrade.
- vitomd 10y agoI don´t know why Riot.js (another js framework) don't attract more people. I used it and it´s awesome. Today they launched the 3.0.0 version http://riotjs.com/release-notes/ http://riotjs.com/release-notes/ . Here is a quick introduction http://vitomd.com/blog/coding/hello-riot-js-quick-tutorial-about-this-awesome-lib/ http://vitomd.com/blog/coding/hello-riot-js-quick-tutorial-a... I highly recommend it.
- edoceo 10y agoI also love Riot. It makes custom tags. It's easy to author and debug w/o so many additional tools. Serverside or client-side rendering. Was a snap to plug Riot in to replace jQuery "components" in a mostly PHP driven app.
- childintime 10y agoriot makes me happy: truly feels like native. makes javascript a joy to use. don't tell the competition.
- butu5 10y agoPleasure to work in Vue.js framework. Very easy learning curve. Simplicity is the biggest strength of this framework. I have created few tutorials on Vue.js. https://m.youtube.com/playlist?list=PLJ6Y8JfXAV-8_2lHNgP1DhCwvB6le3rty https://m.youtube.com/playlist?list=PLJ6Y8JfXAV-8_2lHNgP1DhC...
- od14 10y agoI'm really excited about the scoped slots feature. Finally it's really easy to create components that can be customized by the user from the outside. For example, it's now really easy to create a data table (with features like filters and sort), and with each row showing not only the data text, but also any other feature you might want to embed in it (like attach click listeners to each row, or popup some menu on hover). I believe there was a way (probably a complicated hacky way) to achieve this previously too, but I never investigated it too much. Now it's really easy. Kudos to the Vue team for this release!
- chinathrow 10y agoAre there any migration guides from jQuery to Vue which are noteworthy?
- buckbova 10y ago> http://mithril.js.org/comparison.html http://mithril.js.org/comparison.html > Vue's implementation cleverly hijacks array methods, but it should be noted that Javascript Arrays cannot be truly subclassed and as such, Vue suffers from abstraction leaks. Can anyone who knows how vue is implemented explain this statement?
- rk06 10y agothey are talking about limitations of change detection in Array [1]. It is technically true, but practically, it is not much (if you are aware of it) [1] : http://vuejs.org/v2/guide/list.html#Caveats http://vuejs.org/v2/guide/list.html#Caveats
- bedros 10y agoI found this guy creating a todo app using all popular js frameworks https://github.com/tastejs/todomvc/tree/master/examples https://github.com/tastejs/todomvc/tree/master/examples including vue.js riot.js react, meteor, angular 1,2 dojo, duel, ember, jquery .... it's a great way to compare frameworks
- dpnewman 10y agoI am always looking for the fastest way to build a complete app. Brought me to Rails. Then to Meteor/React (which was mixed). Then some Rails/React which is ok. Vue looks really appealing on the simplicity and completeness side. I would like to know from people using Vue what backends you're using. In order to complete the loop - the simplest stack overall Vue+???.
- ptrikutam 10y agoI've used Vue w/ Rails so far and it's been pretty good. The one real complaint is that I really wish is that I could use Vue components (.vue files) in a better integrated way with the Rails asset pipeline. react-rails does this really well, making JSX transformation a drop-in gem, vs. having to set up some kind of front end task runner of sorts and constantly having to commit compiled files and such. Beyond that, Vue has been amazing, and I really love it.
- dpnewman 10y agoThanks for the reply. Yea the rails asset pipeline integration seems an issue and Vue hot reload capability is also something I'd want workings seamlessly (not sure if that would be problematuc). Perhaps best to just use rails as API server. Then be able to create complete Vue front without struggling w integrations.
- Can_Not 10y agoI'm thinking to rewrite my templates in vuejs then put a nodejs+vuejs SSR layer in front of my non-nodejs backend. I'm wondering how Laravel expects me to handle this situation.
- woogley 10y agoI'm currently using (and enjoying) my first Vue project. I have to say the camelcase support for JSX events feels like a step backwards. The `on-` prefix had a nice semantic way of telling you that thing is an event (either DOM or $emit from component). Now there's just this implicit `onFoo` which could be an event, or could be a prop, maybe component will invoke it directly like in React, maybe it will $emit, who knows?