Live data from Hacker News

Vue.js 2.1 Released

github.com

31–40 of 126 posts

Re: Vue.js 2.1 Released

#31
post #28

I 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 renderi…

In 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

Re: Vue.js 2.1 Released

#32
post #25
post #20

Earlier quoted context omitted.

I 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.

JSX 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".

IMO JSX is such a simple syntactic sugar around javascript that you can unfold it in your head.

> = React.createElement('elment', {someProp: prop}, null)

Its such a simple transformation and adheres to javascript standard behavior. JSX doesn't add anything new, it just adds a way to do something old.

Its a shortcut to 1 transformation and thats it. You can unpack it in your head.

So while I agree with you that it isn't "standard javascript", if you look past the visual differences, there is no difference between JSX and javascript.

This is in stark contrast to the Vue.js (and other) template systems which, while they compile to javascript, the amount of transformations makes it impossible to extend the template system easily without touching the internals of the template engine.

JSX is just syntax, other template systems are entire secondary languages.

Re: Vue.js 2.1 Released

#33
post #28

I 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 renderi…

Both 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

Re: Vue.js 2.1 Released

#34
post #28

I 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 renderi…

As 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.

Re: Vue.js 2.1 Released

#35
post #28

I 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 renderi…

From personal experience for general web-sites like blogs, etc. it's better to do them old way, you don't need to worry much about seo, caching, precompilation, etc. But business apps huge community-like ones, and big shops benefit a lot from frameworks like that. But you should always base your decision on cost of implementation, support, etc.

Re: Vue.js 2.1 Released

#36
post #29
post #25

Earlier quoted context omitted.

JSX 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".

The 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.

You can't ignore syntax, hyperscript isn't very popular.

Re: Vue.js 2.1 Released

#37
post #28

I 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 renderi…

I can't find the article yet, but a few months ago I read that only some chinese search engines had problems with that. The big ones didn't care much.

Re: Vue.js 2.1 Released

#38
I 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.

Re: Vue.js 2.1 Released

#39

I 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.

Took less than two seconds to google. https://github.com/vuejs/vue-router

Re: Vue.js 2.1 Released

#40
post #25

Earlier quoted context omitted.

JSX 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".

IMO JSX is such a simple syntactic sugar around javascript that you can unfold it in your head. > = React.createElement('elment', {someProp: prop}, null) Its such a simple transformation and adheres to javascript standard behavior. JSX doesn't add anything new, it just adds a way to do something old. Its a shortcut to 1 transformation and thats it. You can unpack it in your head. So while I agree with you that it isn…

> Its such a simple transformation and adheres to javascript standard behavior. JSX doesn't add anything new, it just adds a way to do something old.

I don't understand your point, to be honest. A lot of language features are just syntactic sugar for lower-level language functionality. ES6 getter/setters are just syntactic sugar for Object.defineProperty. Does this mean that ES6 and ES5 are the "same"?

No, of course not, but ES6 getter/setters are specified in ECMA-262 and JSX is not, so ES6 gets to be called JavaScript and JSX doesn't. It's really as simple as that.

My point is that because JSX is not JavaScript it then requires a ton of complexity to use it. Whether that complexity is justified is up to each person, but we can't ignore that complexity exists when arguing it vs. alternatives.

Post reply on HN