Live data from Hacker News

Vue: We no longer have any plan of deprecating the Object API

github.com

11–20 of 34 posts

Re: Vue: We no longer have any plan of deprecating the Object API

#11
As a TypeScript user who always disliked the object API and preferred vue-class-component, I feel a bit left out in the fallout of this. JavaScript users are always the loudest. IMO there is no clear, great option for people who are TS devotees. Again it feels like TS was an afterthought.

Will have to experiment a bit. Maybe it's possible to do something decent with some helper functions.

Re: Vue: We no longer have any plan of deprecating the Object API

#12
post #11

As a TypeScript user who always disliked the object API and preferred vue-class-component, I feel a bit left out in the fallout of this. JavaScript users are always the loudest. IMO there is no clear, great option for people who are TS devotees. Again it feels like TS was an afterthought. Will have to experiment a bit. Maybe it's possible to do something decent with some helper functions.

Don’t the existing and new apis have type definitions?

Why do you feel left out?

Re: Vue: We no longer have any plan of deprecating the Object API

#13
post #11

As a TypeScript user who always disliked the object API and preferred vue-class-component, I feel a bit left out in the fallout of this. JavaScript users are always the loudest. IMO there is no clear, great option for people who are TS devotees. Again it feels like TS was an afterthought. Will have to experiment a bit. Maybe it's possible to do something decent with some helper functions.

They've said improved TypeScript support was a major motivator for this new syntax, and for Vue 3 in general. It just doesn't look like class components.

Re: Vue: We no longer have any plan of deprecating the Object API

#14
Reading the comments here and on previous Vue thread, I see a nice example of psychological reactance at play. First, it was "You're going to replace the API? No no don't do this, don't force us to use this new thing that sucks over the old better one!". Now, it is "Oh, so you're not going to replace the old API? Come to think of it, the new API is a really nice idea, has some pretty useful concepts in it!".

:).

Re: Vue: We no longer have any plan of deprecating the Object API

#15
I think the best part about Vuejs right now is 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 has gained so much popularity as I don't think you can make it more KISS.

Transition from vue1 to vue2 was really simple. I just hope that when the dust settles and things are finalized, Vue remains true to it's core of keeping things simple.

Re: Vue: We no longer have any plan of deprecating the Object API

#16
post #9
post #6

I have to admit - I had the same reaction that many people had when the function api first appeared ("what is this insanity and why are you breaking everything i love"). But I read through, checked out the new (simpler) example, read Evan's arguments about logical task grouping, and on a second read with a more-open mind, I actually kind of like the new syntax and am now looking forward to trying it out. I'm glad the…

My favourite part is the re-usability of the functions it encourages and the fact it breaks up the core Vue into individual functions (instead of one big module with options) which means Webpack can tree-shake not only your code but Vue's, resulting in far smaller libraries. Edit: After reading deeper it looks like the "lean" version of the library with full tree-shaking stuff is taking a backseat and they hope to pr…

> After reading deeper it looks like the "lean" version of the library with full tree-shaking stuff is taking a backseat and they hope to provide some better library reduction in the future :/

That's a bit of a shame. I know it's a bit more work, but I wonder if they could have added in a switch where the compiler knows whether its object syntax vs function component syntax where the tree shaking is expected.

Re: Vue: We no longer have any plan of deprecating the Object API

#17

Reading the comments here and on previous Vue thread, I see a nice example of psychological reactance at play. First, it was "You're going to replace the API? No no don't do this, don't force us to use this new thing that sucks over the old better one!". Now, it is "Oh, so you're not going to replace the old API? Come to think of it, the new API is a really nice idea, has some pretty useful concepts in it!". :).

People are always more motivated to criticise. I love the idea of the new API for a few reasons, but wouldn't just comment "yay, that's cool" on the previous post. I'm happy it stays as a plugin though.

Re: Vue: We no longer have any plan of deprecating the Object API

#18

Reading the comments here and on previous Vue thread, I see a nice example of psychological reactance at play. First, it was "You're going to replace the API? No no don't do this, don't force us to use this new thing that sucks over the old better one!". Now, it is "Oh, so you're not going to replace the old API? Come to think of it, the new API is a really nice idea, has some pretty useful concepts in it!". :).

Are you sure that both complains are being made by the same person? Vue is a popular project, and unless an idea is backed unequivocally by 100% of its user base then you'll always hear some users arguing in favour and others against.

Re: Vue: We no longer have any plan of deprecating the Object API

#19
post #12
post #11

As a TypeScript user who always disliked the object API and preferred vue-class-component, I feel a bit left out in the fallout of this. JavaScript users are always the loudest. IMO there is no clear, great option for people who are TS devotees. Again it feels like TS was an afterthought. Will have to experiment a bit. Maybe it's possible to do something decent with some helper functions.

Don’t the existing and new apis have type definitions? Why do you feel left out?

I started writing a huge post with examples from the RFC and how I'd like things to look, but it became too involved and large, and no one wants to read that crap. I'll just summarise it with that props are problematic, both the old-school ones (which don't use TypeScript types at all, instead uses its own ad-hoc type system `{type: ..., required: ..., defaultValue: ...})` and the rather horrible `(null as any) as PropType` type annotations for complex types and the "TypeScript-only Props Typing" which is better but does not have a way to set default values that I can see. Oh, also all props are optional per default which is not what you want in a `--strict` TypeScript project (which should be any new project).

Generally it's relying strictly on type inference instead of interface declarations, which might make edit-time type safety work OK, but lack in error messages (spewing out complex inferred type definitions) and overall readability (much more easier to reason about an interface you wrote yourself).

Also, everything inside the setup function are just variables and functions, so your editor will colour/highlight everything the same, whereas in the class proposal, you have clearer separation between properties (props/data), getters (computeds), methods and even static methods. It's just less messy. Now, I get that classes don't work with React hooks, and the other reasons for dropping classes are rather sound, but I really think that whole setup "God" function is a massive eyesore. TypeScript isn't only about correct type inference, it's also about improved ergonomics, readability, and, pardon the pun, less typing (on a keyboard).

I guess I wrote too much again...

Re: Vue: We no longer have any plan of deprecating the Object API

#20

I think the best part about Vuejs right now is 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 has gained so much popularity as I don't think you can make it more KISS. Transition from vue1 to vue2 was really simple. I just h…

I keep hearing this "a vue component is still as simple as {template: 'hi'}". Genuine question: I've been using Vue for the last couple of months, is anybody actually using this in the real world? Instead of vue-cli apps with single-file components (which is the other argument often seen)?
Post reply on HN