Live data from Hacker News

Vue 3.0 Updates [slides]

docs.google.com

91–100 of 126 posts

Re: Vue 3.0 Updates [slides]

#91

Earlier quoted context omitted.

Maybe it's the constant React vs Vue articles that make me suspicious, but if you are referring to React when mentioning webpack / transliteration, i'd like to mention that you don't need them for React neither. It can be resumed to a simple script tag as well. I hate this misconception and wish it would just go away.

Could you paste the simple script tag that makes React work without transpilation? I always thought you needed Webpack (or an equivalent) to transpile JSX into a vanilla js function the browser can interpret. If you're referring to Create React App, it uses Webpack - just preconfigured so you don't have to fiddle with it before you start building.

You definitely do not need Webpack. Here's a bare-bones React component "editor" with support for JSX: https://codepen.io/namuol/pen/MXJOzy

Re: Vue 3.0 Updates [slides]

#92

Earlier quoted context omitted.

Moving the goalpost. I'm only pointing the fact that it is possible, and saying it is impossible is false. Personally, I don't find the function-call format that "annoying", and I think it presents some advantages neither JSX nor template strings have, along with some disadvantages (it's more verbose, like you pointed out).

And I think GP was saying even if possible it seems rather irrelevant. You could use react without JSX but most likely you will not because you would be throwing away the good things about react. Technically you can eat soup using a fork, but you won’t because...

When React was new and compilers/tooling wasn't that good it was pretty common to use it without JSX. JSX is pervasive because the tooling is now first class (and you'll need it if you make a non-trivial app sooner or later...at which point might as well use JSX since its there), but it works perfectly find without. My first couple commercial apps for React didn't use JSX and it was quite usable. There's just a lack of examples on how to do it these days because no one bothers.

The only time when you won't really have access to a tool chain is for quick demos with just an html page and a script tag (if you don't want to pull in babel as a script), but most online tool allow jsx too now anyway.

Re: Vue 3.0 Updates [slides]

#93
post #2

I'm very happy to see React and Vue influence each other. They definitely are the highest quality frameworks out there and having two different research teams only improves the overall quality of the ecosystem. I'm a React fan, yet I really applaud all the nice stuff which is coming in Vue 3. Well done.

>research teams Lol. Writing JS libs is not research.

It's been years since people were mocked for using Javascript. The language has greatly matured.

Re: Vue 3.0 Updates [slides]

#94
post #79

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.

Enterprise apps are also a suitable venue for SPAs. You've got some developers coming from e.g. Swing, MFC++ or even Tcl/Tk, and for those doing every frontend bit in JS is closer to standard UI toolkits, instead of the constricting request/response cycle of old webapps (except those few that did some hacks with server-side continuations). Also, in those cases a few extra seconds for the initial load or the general s…

yeah that's basically the TL;DR of it - the more "desktop app" type functionality you need in your web application, the more SPA technology you're liable to need.

Re: Vue 3.0 Updates [slides]

#95

Earlier quoted context omitted.

That's interesting, I started with React, and switched to Vue, and felt Vue was the simpler tool.

Agreed. When evaluating both of them, it looked like React and Vue implement the same concepts, but React did it in ways that made it more complicated than it needed to be. I specifically didn’t like that Redux and it’s docs were too heady for what it really is (it’s just event triggering and handling, why does it have to be so complicated?), and the fact that React didn’t have any official “here’s is how to build a…

Redux is an independent project from React. You could use redux with Vue. Your other points are valid but detracting from one library because people often use another you don’t care for seems outside the scope of React vs Vue.

Re: Vue 3.0 Updates [slides]

#96
post #70

Earlier quoted context omitted.

Exporting reactive JS native apps for iOS and Android is the most significant feature -- was what I would have said. I looked it up before writing this comment, and apparently Vue introduced this in June 2018. Case in point of this comment thread :)

With vue native you can use anything from the react native community in a vue application. You get the best of both worlds! https://vue-native.io/

The funny thing is that that’s built on top of react native isn’t it?

Re: Vue 3.0 Updates [slides]

#97
post #77

Earlier quoted context omitted.

Could you add the lines needed to the above example to make the user list grow / shrink real time via websockets? Would be interested to see how you would implement that.

Pseudo-ish code because I’m typing from my phone. Vuex code as per docs to create state.stuff and mutations.update_suff() then in main Vue instance mounted () { this.$socket.subscribe(‘stuff’, data => { this.$store.commit(‘update_stuff’, data); }); where $socket is a subscriber client I wrote wrapped as a Vue plugin. Then inside the components computed () { stuff () { return this.$store.state.stuff; } } then use stuf…

So the first step towards your solution would be to include vuex? Like this?

    
And then?

What are mounted() and computed()? They look like methods of a class?

Re: Vue 3.0 Updates [slides]

#98

Earlier quoted context omitted.

Agreed. When evaluating both of them, it looked like React and Vue implement the same concepts, but React did it in ways that made it more complicated than it needed to be. I specifically didn’t like that Redux and it’s docs were too heady for what it really is (it’s just event triggering and handling, why does it have to be so complicated?), and the fact that React didn’t have any official “here’s is how to build a…

Redux is an independent project from React. You could use redux with Vue. Your other points are valid but detracting from one library because people often use another you don’t care for seems outside the scope of React vs Vue.

Just for the record most people using vue would be using Vuex:

https://vuex.vuejs.org

Which IMO is simpler to understand as a newbie than Redux. Maybe because it had the luxury of coming after Redux/similar projects and underpinning a simpler parent framework.

Re: Vue 3.0 Updates [slides]

#99
post #39

Earlier quoted context omitted.

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.

That literally means that you aren't doing SPAs. If you aren't doing SPA then yes using React or Vue is rather a waste. However the majority of sites these days use some form of SPAs. Also under a second is a very low bar to strive to. a fast round trip to the server is 100ms. A reasonable one is somewhere around 300ms. Displaying effects to changes is often under a millisecond in SPAs and is basically impossible to…

> If you aren't doing SPA then yes using React or Vue is rather a waste.

I disagree, based on my experience of writing a reasonably complex non-SPA application which very much benefits from Vue.

I also think the fact that Vue Router ships as a separate app further suggests SPA is just one use case.

Re: Vue 3.0 Updates [slides]

#100
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…

You could use string tags. The only thing that is really needed is a DOM diff library to make UI updates bearable. The rest can be completely handled with a basic MVC architecture.
Post reply on HN