Vue.js 1.0.0
vuejs.org
vuejs.org
Anyway, for those of you who are not familiar with Vue, here's a blog post explaining why it's worth taking a look at: http://blog.evanyou.me/2015/10/25/vuejs-re-introduction/
Calling `setState` is not a big deal and neither is dealing with stores. It's very simple and you keep your state separate from your HTML.
At this point I probably can't do web development without JSX and not be miserable. The days of separate templates are hopefully forever behind me. Not trying to dismiss your very hard work I'm sure, but React has taken us into the future. Maybe with esperanto you could add templates into your own JS or make it work with JSX and react-dom.
I personally like this approach as it lets me mix and match my favorite languages (Coffeescript, SASS, etc), and it makes plugging Vue into existing code a straightforward process.
I'd love to know your response to lemevi here. In particular, what you consider the strengths and weaknesses to be in both your approaches, and why you prefer yours.
It's not as pretty, but still better than JSX imo. I posted some examples here: http://rapin.com/blog/2015/02/03/reactjs-with-coffeescript/
I've used Jade and honestly prefer the React way for sure because it combines the javascript with the html in the same file(s)
Please tell me the meaning of `Evangelion`... Is the japanese anime?
* Doesn't support IE8 and below because it probably uses ES5.1 getters and setters - no more manually watching an object
* Supports component based programming - css/js/html in one file. But it supports any preprocessor, so it could be sass, coffeescript and jade
* The components are easily composable
* Excellent module support / support for browserify or webpack
* Clean upgrade path: adds new features without breaking the api, but does through deprecation warnings to guide the upgrading user
* 100% code test coverage
* Has a nice, simple built in router
* Has a very nice release page / layout
I haven't been this excited about a framework in a long time. I'll probably use this in my own personal project.
Edit: Wow, the docs look great. For being 99% a one man job this is incredible. I'm very impressed. If I was a employer I'd hire you.
Second Edit: Here's a comparison page for Angular, React, Ember, Polymer and Riot. http://vuejs.org/guide/comparison.html . Of course it's in support of Vue, but it was an interesting read.
I usually make a reproduction in the evening and find out by next morning if there's been a fix or if I've been doing something wrong
Has made using Vue in production feel very safe
Been using Vue for over a year and it replaced an ambitious Angular project for internal operations management which was getting out of control. Migrating to and using VueJS was like a breath of fresh air.
For me it's the best compromise between React and full frameworks like Angular/Ember. Can't believe this isn't backed by a megacorp yet and just a personal project. Congrats, Evan, and thank you!
https://twchennai.github.io/geeknight/aug2014.html
And here are all the codepen exercise books
A thought that I share, from the guide:
"API-wise, one issue with React (or JSX) is that the render function often involves a lot of logic, and ends up looking more like a piece of program (which in fact it is) rather than a visual representation of the interface. For some developers this is a bonus, but for designer/developer hybrids like me, having a template makes it much easier to think visually about the design and CSS. JSX mixed with JavaScript logic breaks that visual model I need to map the code to the design. In contrast, Vue.js pays the cost of a lightweight data-binding DSL so that we have a visually scannable template and with logic encapsulated into directives and filters."
What do you think?
<th v-for="key in columns" @click="sortBy(key)" :class="{active: sortKey == key}">
And the API seems to needlessly separate HTML and Javascript, with some strange (to a newcomer) API calls: Vue.component('demo-grid', { // moving away from JS classes
template: '#grid-template', // Why separate view code from view code?
replace: true, // what is this?
Has anyone heavily used React and Vue and have an argument for what this thicker API affords?The big thing is that while I personally adore React, it does require ceremony to get stock-standard behaviour. We recently onboarded a new developer (a friend of mine), and teaching him React + Flux (Alt.js) was infinitely more difficult than teaching him Vue.js -- the "thicker" API (which is still an order of magnitude thinner than Angular or Ember) means you don't need to either reach out to other libraries to achieve tasks that you otherwise would need to in React.
Now, that's not a bad thing on React's side; it's a view-layer, not much more. That's okay, and a good thing! For building components rapidly in a regular "client -> designer -> cut-up -> development" workflow, Vue.js is streets ahead of React in terms of code required. But for building very large applications, React's smaller API means that you can guarantee behaviour, and things are consistent.
Basically, they are both brilliant libraries. I highly recommend both. React and Vue.js are similar in a lot of ways: they're both tiny little view layers that are component focused and have modern, ecosystem aware build tooling. They differ in that Vue.js is "classical" (though not really, it's far nicer than the older systems) MVVM which has been proven time and time again to be a good architectural choice, whereas React.js takes a more functional (as in programming) approach to the problem -- though I'd argue not far enough down the functional side, which is why I've been enjoying Cycle.js so much!
unless you get bitten by event pooling...
Can I ask what do you use for routing and if you have good results with that mix?
The reason why I went down that route (pun intended) was that we built a rather large, isomorphic/universal web application that for SEO reasons had to act like a website vs a web app most of the time; until it started up the client side JS anyway. "react-router-component" was so close to what we wanted, but because it used React's somewhat undocumented "context" feature, it didn't play nicely with our Flux implementation at the time (Flummox).
For that reason, my tiny router came into being, and for some reason it keeps sticking around despite my best efforts...
https://github.com/studionone/react-isorouter
Ps. I just found out that the README links to non-existent documentation, I really should fix that...
I'm trying to find my way around flux but until now has been a little frustrating experience.
I wish something like Elm was mature enough.
So do I :)
If you're not 100% up on Flux, I recommend having a play with Hoverboard[0] -- it's a tiny implementation of the Flux architecture, with some interesting choices itself. It's a single function, too, which is pretty neat!
I've been using it to implement the "Flux Challenge" in combination with domChanger[1] instead of React: https://github.com/girvo/domchanger-hoverboard-flux-challeng...
And here's a partial TodoMVC implementation I wrote in Hoverboard and domChanger: https://github.com/studionone/todomvc-domchanger-hoverboard
---
Re moving away from JS classes: ES2015 class is inadequate due to the lack of static property initializers, and I don't want to force users to use stage 0 transforms. A Vue component definition is essentially an object of options, which is in fact easier than having to extend a base class. Also see https://medium.com/@dan_abramov/how-to-use-classes-and-sleep...
For the template, that's just because it's a one-pager demo and I don't want to use an inline string template. The proper experience is using single file Vue components: http://vuejs.org/guide/application.html#Single_File_Componen...
`replace: true` is a legacy option I forgot to remove in the demo :P
<th v-for="key in columns" v-on:click="sortBy(key)" v-bind:class="{active: sortKey == key}">Have you looked at riot.js?
Another thing I take into consideration: Aesthetics and the give a shit factor. The website and syntax (imo) are beautiful and succinct, and Evan's work ethic and responsiveness is incredible.
Which isn't a bad thing :).
From what I've gathered so far, Vue seems like it is basically a better Ractive, and it makes more sense to use it for my next project. But perhaps I'm missing some important differences between the two?
Vue seems using "magic mode" vs the Ractive.get/Ractive.set. Ractive uses virtual DOM, Vue does not.
- nearly every web developer already knows mustache
- mustache distinguishes what's HTML and what's not
I also like ractive because it has two way bindings, and promises for when DOM changes, but maybe Vue also has those.
That said, the reason I used Ractive in an earlier project instead of React is exactly what you point out. Mustache is much easier for other developers to start using.
I think the combination of simple API, good performance, big company backing (proven at scale), rich dev ecosystem (e.g. good dev tools, related ideas such as Flux/Redux) and, of course, React Native is going to be hard to beat. As a freelance developer, it's the front end framework I've chosen to go "all in" with for this round - but still it's great to see all the innovation going on in this space (once you get over the fear that your skills will be outdated in six months time that is!)
I wouldn't exactly consider React "lightweight," especially compared to other frameworks like Mercury [2], Mithril [3], and Riot [4], which are a fraction of the size of React but still have their own virtual DOM implementations.
[1] https://fb.me/react-0.14.0.min.js
- React 0.14 is 55kb
- jQuery 1.11 is 38kb
- Backbone + Underscore (dependency) are 15kb
Also, by "right-weight" I think this is meant in terms of API and features, not file size. Sorry, but I don't think that bringing up the file size of various other frameworks is that productive of an addition to this thread.
Also, I would crown knockout the light-weight champion (both in function, and concept), and ember the heavy-weight champion
Only thing missing is a capable router, and I think you'd be off to the races with this thing, awesome.
I personally like the background of the main dev(s?) behind Aurelia. IIRC, they worked on knockout->durandal->angular->aurelia, and I think the apps they stopped-by in before conceiving Aurelia have just the right concepts and features to make for a really compelling large-ish framework.
A little dissapointed about how hard it is to bootstrap it though, I really like to start projects from scratch (empty folder), and found it a little difficult to just pull together easily (without downloading their starter-zip or whatever).
What OS and browser will it run?
Vue.js was impressed me when I first visited it offical guid and document site. I did not believe it made by a Chinese developer( no offense :P ).
Lots of people like to have a comparison between Vue.js and other framework/library. I need to say after using Vue.js, I 'd never use Angular again. Using Angular is painful for me, it has too many opinionated solution. That make me difficult to use my own toolchain.
Everyone said that there are too little components for Vue. It's right, so I begin to do something. I created a vue-component organization. I'll make more and more Vue component. At the same time, requesting a component you want to be achieved is welcome: https://github.com/vue-component/request