Live data from Hacker News

Vue 3.0 Updates [slides]

docs.google.com

81–90 of 126 posts

Re: Vue 3.0 Updates [slides]

#81
post #45

Earlier quoted context omitted.

I think two-way-binding is the reason why many people prefer Vue to React. If you did Ember or Angular1, Vue is much easier to grasp.

Well, one-way binding (or rather, unilateral data flow) is why I prefer React :)

"v-model" isn't two-way binding like in AngularJS where both parent and child can modify the same data. It's just shorthand for defining a property and an event handler. Like in React, properties flow down and events flow up. See https://vuejs.org/v2/guide/forms.html

Re: Vue 3.0 Updates [slides]

#82

Earlier quoted context omitted.

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.

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

Same here!

Re: Vue 3.0 Updates [slides]

#83

Earlier quoted context omitted.

Well, one-way binding (or rather, unilateral data flow) is why I prefer React :)

"v-model" isn't two-way binding like in AngularJS where both parent and child can modify the same data. It's just shorthand for defining a property and an event handler. Like in React, properties flow down and events flow up. See https://vuejs.org/v2/guide/forms.html

Makes sense, I've done some Angular but I'm not used to Vue.

Not really related but forms really are the most painful thing to handle in all those frontend frameworks, it's driving me insane how much work has to go into them when it's dead simple with a backend framework (eg Symfony/Django)!

Re: Vue 3.0 Updates [slides]

#84
post #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

That is one of the few aspects I prefer in React over Vue.

But you can indeed create small inline components in .vue files.

There are different approaches: https://codewithhugo.com/writing-multiple-vue-components-in-...

Re: Vue 3.0 Updates [slides]

#85
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 a template engine is all you need here's the simplest: https://github.com/wisercoder/uibuilder used by apps such as https://circles.app

Re: Vue 3.0 Updates [slides]

#86
post #9

3.0 is a huge milestone for vue. Currently the architecture forces you to import the Vue object entirely , has Vue under the hood isn't really modular... With 3.0 Vue has taken the typescript way and is using packages , similar to angular , it looks absolutely awesome to work with now. I really hope class based components will be supported natively without compiling or transpiling. Working "out of the box" has always…

Vue 3.0 is reported to support class-baed components natively: https://medium.com/the-vue-point/plans-for-the-next-iteratio...

Re: Vue 3.0 Updates [slides]

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

Some people maybe, but I doubt it's "most" people.

The point of using Vue is data-binding with reactive models and components.

For your use case I agree Vue is overkill. A templating engine should be enough.

Re: Vue 3.0 Updates [slides]

#88
post #63
post #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 templat…

to me the biggest downside was how vuex and typescript didn’t work well together by default. You had to rely to adding a few plumbing functions, and that felt really like dirty patching.

Yep, that as well, I agree. And the plumbing is super verbose

Re: Vue 3.0 Updates [slides]

#89
post #77

Earlier quoted context omitted.

One should use what is necessary and no more. If server side templates work for you - great. My rule of thumb: if I need to do more then a trivial amount of DOM manipulation then I will use a framework, because otherwise I will end up writing my own anyway (which I can easily do) which wastes development time. For projects with several developers a framework can help maintain common coding style and reduce ramp up ti…

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 stuff as in your example.

So very simple, and nothing that I couldn’t do without Vue but it takes care of the boring DOM manipulations and using the browser extension during development I can watch state change (which becomes interesting when there are multiple subscriptions with data combined).

Re: Vue 3.0 Updates [slides]

#90

Earlier quoted context omitted.

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.

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 complete app” docs. It was always “well here are different choices and project layouts you could use”. I don’t want to care about using this templating system or that. I want batteries included. Vue did that well.
Post reply on HN