Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The new Composition API definitely looks interesting. But it's also kind of a shame that there are now two very different ways to write the same functionality, both blessed by the framework.


I don't think so. This is the nature of software.

The first version jumped right in and solved an immediate problem. Even with the best foresight possible the designers simply could not see all the problems they would run into.

Or even if they did, sometimes pragmatism forced fixing issues down the road.

After doing this for over 20 years (I build software coders/designers/laymen use) I am really impressed with how well Vue was designed to start with, and the migration path (at a glance) looks nearly painless from v2 to v3.


It actually not very different in its core(except the transition to Proxy). In fact, you can already do that on vue 2, just you are unlikely to.

Put method in data or prop? It actually works, but why would you do that when there is a field called `methods`?

The setup method seems like a slightly enhanced data() that allow you to place things in a more free way.


I think the original plan was to eventually phase out the Options API, but the community pushed back during the first RFC phase resulting in the dual API solution.

Although the benefits of the Composition API are clear-cut, the Options API is beloved by the community for its ease of use and clarity. For me personally, it will be hard to switch since I'm not a heavy user of mixins and I don't venture too far beyond simple components. However, I still need to learn the Composition API in more detail so I can make a more informed decision. Evan and the Vue team worked very hard on v3 and I trust them to make the right decisions.


I liked the options API...

what I found is the composition API is actually nicer to deal with not even considering mixins. Because things are grouped together you don't end up moving around your files so much so it ends up being quicker.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: