Live data from Hacker News

Vue 3.0 Updates [slides]

docs.google.com

31–40 of 126 posts

Re: Vue 3.0 Updates [slides]

#31
post #15

Earlier quoted context omitted.

Something like this? https://gist.github.com/gaearon/6668a1f6986742109c00a581ce70...

That’s without JSX. Transpilation is required in order to make use of JSX.

There's also a babel script that you can drop into a script tag and will transpile stuff in the browser for you if you want JSX.

Not recommended for large projects in production (but then I'd be using webpack or similar for large vue projects too), but it works pretty well (and surprisingly fast) for quick experiments.

Re: Vue 3.0 Updates [slides]

#32
post #16

My feeling is that most people who use Vue or React only need a template engine. Typical use case: You have an array of objects and a template how each object should look like. So you do... {{ user.name }} let userList = new Vue({ el : '#users', data: { users: users } }) ...to make Vue render the list of objects. This is the only thing I ever use these frameworks for. Everything else I think I can implement in a bett…

as a React developer, SPAs in general are overused. Most LOB apps could (and should) still be written in a backend templated language. SPAs should be reserved for applications (or even individual components) with advanced interactive features, ie a proper web app.

That's also my conclusion after toying a bit with those frameworks. You want to use them for specific pages ressembling applications, but you still want the main structure of your frontend to be defined server-side, using the most standard technology.

This lets you split your interface into more isolated components, and makes you free to use different framework depending on the type of interaction your page needs, as well as be able to update your site progressively.

Re: Vue 3.0 Updates [slides]

#33
post #16

My feeling is that most people who use Vue or React only need a template engine. Typical use case: You have an array of objects and a template how each object should look like. So you do... {{ user.name }} let userList = new Vue({ el : '#users', data: { users: users } }) ...to make Vue render the list of objects. This is the only thing I ever use these frameworks for. Everything else I think I can implement in a bett…

If you're just rendering HTML, you might as well do it on the server with your choice of language/framework. The power of Vue and other Javascript frameworks is in their reactivity and the ability to create extremely powerful interfaces.

Re: Vue 3.0 Updates [slides]

#34
post #4

I think the best part about Vuejs is that how simple it is and everything just works! A vue component is still as simple as {template: 'hi'}. You don't need webpack or any transliteration for it to work. Just drop the script tag like the good old jQuery and it's working! No wonder it was so easy to switch to it. Transition from vue1 to vue2 was really simple. I'm sure the same will be true for v3.

Having started with vue, and now playing with react, I’ve found myself often thinking “this is so much simpler”.

But maybe I just sucked at vue.

Re: Vue 3.0 Updates [slides]

#35
post #32

Earlier quoted context omitted.

as a React developer, SPAs in general are overused. Most LOB apps could (and should) still be written in a backend templated language. SPAs should be reserved for applications (or even individual components) with advanced interactive features, ie a proper web app.

That's also my conclusion after toying a bit with those frameworks. You want to use them for specific pages ressembling applications, but you still want the main structure of your frontend to be defined server-side, using the most standard technology. This lets you split your interface into more isolated components, and makes you free to use different framework depending on the type of interaction your page needs, as…

yeah, for most web apps that are primarily regular CRUD+routing interfaces, you can/should use SPA tech to progressively enhance your more advanced controls. There are cases where it makes sense to build a whole SPA (I'm working on an in-browser editor that wouldn't work very well as a backend app, for example) but the vast majority of cases where React is used, it just adds complexity and challenge.

React/Redux hasn't been around long enough for its best practices to solidify in the general industry so you'll often find that companies that picked up React have a hodge-podge of incorrectly used technologies included because they didn't know the use case for Thunks vs Sagas, how to use Reselect correctly, whether to store any given state in Redux or a Container, and so on.

Re: Vue 3.0 Updates [slides]

#36
How about the ability to create multiple components in the same .vue file? for instance I need to define a sub-component that will be used only inside my component, this is easy in React but with Vue I have to create another file to define this sub-component, this makes the project management becomes harder as the project grows

Re: Vue 3.0 Updates [slides]

#37
post #28

Earlier quoted context omitted.

I don’t think the comparison with JQuery vs JS is at all similar. JSX was created for React, and nearly every time you see React code it’s using JSX. Technically, each of them can be used separately, but it’s a very reasonable impression to consider JSX one of the main features of React. JS was not created for JQuery, and you can not used JQuery without JS.

"jQuery was created for JS, and nearly every time you see JS code it's using jQuery." Doesn't that sound like something you would hear a few years ago?

Sure, but that’s a linguistic trick. That sentence implies a completely different meaning for the word “for”.

When I say JSX was created for React, I mean that it was created to be a part of the design of React. Meaning they both first came into broader public awareness at the same time, together, and have continued to be promoted as two independent parts of a single system.

Re: Vue 3.0 Updates [slides]

#38
post #33
post #16

My feeling is that most people who use Vue or React only need a template engine. Typical use case: You have an array of objects and a template how each object should look like. So you do... {{ user.name }} let userList = new Vue({ el : '#users', data: { users: users } }) ...to make Vue render the list of objects. This is the only thing I ever use these frameworks for. Everything else I think I can implement in a bett…

If you're just rendering HTML, you might as well do it on the server with your choice of language/framework. The power of Vue and other Javascript frameworks is in their reactivity and the ability to create extremely powerful interfaces.

I only use Vue when I need to alter the data clientside before it gets rendered. For example mark some of the users in the list as friends depending on which friends the user has stored in localStorage.

If the data is ready to render while still on the sever, I do so.

Re: Vue 3.0 Updates [slides]

#39
post #16

My feeling is that most people who use Vue or React only need a template engine. Typical use case: You have an array of objects and a template how each object should look like. So you do... {{ user.name }} let userList = new Vue({ el : '#users', data: { users: users } }) ...to make Vue render the list of objects. This is the only thing I ever use these frameworks for. Everything else I think I can implement in a bett…

Not sure if your use case includes automatic rendering (new/delete/mods) when the underlying data changes. If it can be done automagically (via unique id in the data) that is a big win (aka, code I do not have to write). Things like shadow DOM et al, are not something I want to implement or maintain.

When the user triggers a change of the underlying data, I do a roundtrip to the server and re-render the current page. I keep the time needed to do so under a second. My users regularely express how WOWed they are by the snappyness of my sites.

I guess what other sites save on re-rendering html, they lose multiple times on bloated code.

Re: Vue 3.0 Updates [slides]

#40
The Typescript support is by far the thing I'm most interested in. Lack of useful Typescript support is, for me, the only downside of Vue right now, and it's a big enough downside for me to use React instead of Vue in a lot of cases.

Do you reckon we'll ever see Typescript support in the non-jsx templates? I do really like vue templates for e.g. if-conditionals. I really don't like using ternary operators for template logic. And then the alternative being to hoist things out of the single JSX template breaks make code less linear to read which kinda sucks

Post reply on HN