Hacker Newsnew | past | comments | ask | show | jobs | submit | hansede's commentslogin

Vue allows you to use Pug syntax in your templates, so this can be even simpler:

  button(:disabled='isButtonDisabled') Button
  div(:id='`list-${id}`")
  form(@submit.prevent='onSubmit')
  a(@click='doSomething')


I'm sorry but that is hideous.

JSX is incredibly simple. Why would you do that to yourself and other devs?


Eloquently put.


And Pug amkes this... cleaner and prettier than JSX? I'm afraid not.

And it's far from being simpler


The purpose of this is not to demonstrate a new design for the site, the purpose is to demo a well written server side rendered + client side hydrated Vue app, and especially how fast it loads: https://twitter.com/youyuxi/status/860856697799098368


This encouraged me to spend the morning reading up on Vue. They have a section on their site comparing it to React. AFAICT Vue is faster but react has a larger ecosystem (partially on account of a large head start)? What's the best argument for using Vue instead of React at this point?

I guess what I'm really asking: does anyone think Vue will still be good and fast in a couple of years or will it be more like Angular, breaking under its own weight and growth? (no offense to the angular folks, but I haven't heard an engineering team say "glad we chose angular" for a while)


This guide gives an excellent comparison of Vue to other frameworks: https://vuejs.org/v2/guide/comparison.html

I would add the following points from my experience with Vue:

Vue is incredibly easy to learn. The usual claim with React is "productive in under a week", while I find that with Vue, most JS engineers can be productive in a few hours. Especially for engineers coming from a background in Angular, Mustache, Handlebars, etc. the templating in Vue is very easy to understand.

The documentation for Vue is excellent, some of the best documentation I have ever worked with: https://vuejs.org/v2/guide/

It has the advantage that it's not beholden to the whims of a large company like React is with Facebook or like Angular is with Google, given that its development is funded by a Patreon campaign: https://www.patreon.com/evanyou

Additionally, Vue is not encumbered by the patent questions around React: https://news.ycombinator.com/item?id=11270213

I don't anticipate Vue crumbling under its own weight. Vue is developed by Evan You, who has already shown his ability to learn from Vue 1 and iterate on that with a lean and organized Vue 2. My main criticism of Vue would be that its ecosystem is not as strong as React's at this point, as you have pointed out.


What does "client side hydrated" mean?


It means the initial server-rendered page comes with a JSON representation of the store used to render it. Usually in the HTML.

The client "rehydrates" this data into its own store so that its state is consistent with the data rendered. Essentially we're in the same position as if we'd rendered it client-side.

It's a lot simpler than it might sound.


Pulling content via JS instead of generating content markup server side.


imho, try Vue


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

Search: