Live data from Hacker News

Vue.js 1.0.0

vuejs.org

71–80 of 89 posts

Re: Vue.js 1.0.0

#71
post #39

Earlier quoted context omitted.

That's a neat idea What OS and browser will it run?

Mithril runs in IE8+, currently, though that will be changing in the future.

Huh, where did you hear that? I wasn't planning on dropping support for IE8 in Mithril, if possible.

Re: Vue.js 1.0.0

#72

I've always heard good things about Vue from its users. I have to compare all Javascript frameworks to React, because to me React feels like the first framework that got it "right." The API of React is surprisingly thin. Looking at Vue templates, the syntax seems quite alien, halfway between Django and Angular: And the API seems to needlessly separate HTML and Javascript, with some strange (to a newcomer) API calls:…

What you are referring to is just syntactic sugar. @click is the same as v-on:click and :class is the same as v-bind:class. So you can write this line "less alien" like this:

  

Re: Vue.js 1.0.0

#73
post #8
post #4

Earlier quoted context omitted.

Also Laracasts has a great series on VueJS - mentioning it since it got me excited about VueJS and front-end JS frameworks in general. https://laracasts.com/series/learning-vuejs

I think Jeffrey Way does a pretty great job of explaining things with Vue (among many other things); I think its also really great of him to put most of that series up for free.

Jeffrey Way is the best! really!

Re: Vue.js 1.0.0

#74
post #37

I like it. In fact I like it more than React, which I am not using (still a happy Backbone user). 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/dev…

It sounds like the sort of mistake newbie React developers make, you quickly learn to decompose your render into smaller components.

Re: Vue.js 1.0.0

#75

I've always heard good things about Vue from its users. I have to compare all Javascript frameworks to React, because to me React feels like the first framework that got it "right." The API of React is surprisingly thin. Looking at Vue templates, the syntax seems quite alien, halfway between Django and Angular: And the API seems to needlessly separate HTML and Javascript, with some strange (to a newcomer) API calls:…

The `@click` and `:class` are in fact shorthands for `v-on:click` and `v-bind:class`. All directives start with `v-` by default. Shorthands are provided because these are two most often used directives.

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

Re: Vue.js 1.0.0

#76
post #66

Earlier quoted context omitted.

React 0.14 is 132KB minified [1]. 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 [2] https://github.com/Raynos/mercury [3] http://mithril.js.org [4] http://riotjs.com/

Is there any statement from the React team about the size?

I don't have a reference for this, but when it's come up in the past they've said size is not a primary goal for the project. A lot of the size comes from their internal event system that normalizes events cross-browser along with the extra abstraction for pluggable renderers (i.e. support React Native) and the component-local state handling. None of these are necessary to get the virutal dom model working. Finally, 132k minified is 40k after gzip. It's not THAT large but it's not a lightweight framework either.

Re: Vue.js 1.0.0

#77
post #10
post #2

Author here - thanks for the submission, I was actually planning to do it tomorrow :) 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/

> More importantly, there’s no need to worry about calling $apply in a timeout, or calling setState(), or listening to store events 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. N…

I'm not disagreeing, but when I hear "..., but React has taken us into the future." - is it just me or does this sound a bit too pompous?

Re: Vue.js 1.0.0

#79
post #36

I've always heard good things about Vue from its users. I have to compare all Javascript frameworks to React, because to me React feels like the first framework that got it "right." The API of React is surprisingly thin. Looking at Vue templates, the syntax seems quite alien, halfway between Django and Angular: And the API seems to needlessly separate HTML and Javascript, with some strange (to a newcomer) API calls:…

If I read the documentation correctly, you can also pass it a string to be used as template. If the string starts with a '#' it will act as a querySelector. http://vuejs.org/api/#template

I love this feature. Putting html fragments in string literals in javascript seems pretty awkward to me.

Re: Vue.js 1.0.0

#80
post #10

Earlier quoted context omitted.

> More importantly, there’s no need to worry about calling $apply in a timeout, or calling setState(), or listening to store events 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. N…

I disagree, I've never used jsx and I can still build web apps. There are plenty of templating languages to choose from, my choice is Jade. I actually have never touched React because I've never had so much DOM manipulation to make use of it. If anything I can smoothly update my DOM with marionette/backbone and a little css animation.

I'm a fan of HAML / Slim / Jade too. You might want to check out React w/ CoffeeScript as it gets you pretty close (and has some benefits).

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/

Post reply on HN