Hacker News new | ask | show | jobs
by nlh 2554 days ago
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 they agreed to keep the object syntax around though :)

1 comments

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 provide some better library reduction in the future :/

> 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.