Had it with React when it moved to functional components from class components.
But I convinced myself I have to dive deep enough to understand it since a lot of people seem to like it. And now I like the Composition API more in general.
Apart from one tidbit: I constantly forget where I need to put `.value` after a variable name to extract its... value.
Now that this is the recommended way of writing Vue, I’d be really interested in your opinion on React.
Compare the “ref” in Vue with useState hook in React.
With the useState you get back two items: the value, and a setter.
Now every time you access the value you simply access it like a variable because it is.
If they were going to poorly clone react hooks api then I decided it wasn’t worth my time sticking to the niche framework and went back to react which I now really enjoy.
That and the bad TS support and broken dev tooling for years and the endless deprecated and abandoned tools like Vue CLI replaced by Vite and Vuex replaced by Pinia just highlighted the absurdity of trying to continue using Vue. Also, JSX/TSX is clearly a superior approach with its vast ecosystem of support. Vue can use TSX but good luck with its single docs page and GitHub issues about it open since 2021.
This is how you stir up drama instead of constructive discussions. Clearly the team do care quite a lot about developer experience, but they might have different ideals and goals than you do. So lets discuss those differences as adults.
You are supposed to used fancy ide that everyone uses and typescript do yell at you if use guess wrong.
You can argue with it or ignore it however you want, but that's simply true.
I also know as a matter of fact that I am more productive than many of my colleagues when working with non statically compiled languages, and that my code is more robust, partly due to the typing I use everywhere. I have colleagues that write JavaScript functions that takes a parameter that could be 4 different types of objects, completely undocumented, and they don't know what's happening one week after shipping the code. I can't stop them doing stupid things like that. They like wasting their life debugging things and refreshing the browser, what can I do.
The tutorial and reasoning about the composition api make sense ... but I never feel I need it in my own apps.
If you haven't found a need for this, great for you. Options APIs will also continue to be available for the foreseeable future. But that doesn't mean it is better in any way.
It's taken the team some time to get used to how to do things in the new way, but on balance, we do like it.
It feels like there have been some odd caveats, like the new reactivity system approach not working exactly like we'd expect. But caveats exist in the options API too.
I will say, with 2.x about 50% of bugs where not using Vue.set(...) in some obscure place or way, and those have all gone away, which I love.
Also proper typescript support without annoying workarounds, that alone would make it worth it.
the `defineProps` macro is much, much better than the old way of declaring prop types, for one.
I don't see it as two ways in practice, just the legacy way for old projects (which still has good support), and the newer/better way.
Asking because my experience is that as soon as you have a large and complex component that needs to have multiple, mostly independent functionalities, you'll find the composition APIs to be a godsend. Not to mention all the IDE support. You won't see that until you have first have experience with it.