Hacker News new | ask | show | jobs
by vagrantJin 1778 days ago
I'd clap harder if Vue weren't so desperate to become React and focus on their own strengths. React certainly appealed to a lot of devs who at best disliked working with HTML & CSS, but Vue welcomed everyone with an excellent gentle slope to gently move devs away from direct Dom manipulation and embrace reactive paradigms. Folks with small shops could now refactor their codebases with relative ease.

If only the Vue team could understand, we don't want React features. We'll use React when we want them. We want Vuejs.

1 comments

All JS frameworks will share some features. What specifically about Vue do you think is unnecessary or shows that the Vue team doesn't understand?
I tried React during its early years, and switched to Vue.

It's just a little bit more coherent platform than React. There are core Vue projects, and they go in lockstep with Vue releases.

Second, Vue understood how fragile, and the same time important tooling is. There are many very mature Vue packages to scaffold, and manage your Webpack, or other build system setup for you. This saves a lot of hours because if this setup fails on you, it will also fail on tens of thousands other developers, and will get fixed quickly.

Vue itself been less tooling dependent at the start, and it played a role it its early popularity, vs React, which was superglued to Webpack or something similar from the start. Now, the situation has reversed I think, and it is a pain point.

I think there is a good sense of direction with Vue, with Evan being better at keeping focus on objectives for the next release than a lot of other frameworks developed by companies. I had few silent breakages during updating projects to new version.

Lastly, Evan is a very decent person, and this helps the project getting more contributors.

Vetur languished for years without the resources it needed. From lack-luster type recognition to bugs that would just crush its performance. I believe it has just recently(within the past year or so) been taken up a level.

TSX support, and frankly JSX is the future of VueJS IMHO, also only really started working well with the addition of attribute namespaces to TypeScript.

So while these things have improved recently I would say language tooling has been really lackluster compared to the React ecosystem even 4+ years ago..

Vue still has the same progressive-enhancement low-tooling approach as before. It's only broadened in its ability to be used in more complex environments with full toolchains but you can just add a <script> tag and start coding.

I do agree that Vue 3 was rather badly released though, as everything from the websites and docs to the plugins and devtools were all at different stages.

Agreed, you can do the same thing with React too. Just add script tags with React and ReactDOM and away you go, no need for anything else.
I'm guessing hooks, even react devs are not sure about the fake functional programming nonsense.
Vue3's composition api is literally a better version of hooks. Which actually answers vue2's pain points. And is strictly better than mixins.

In fact, many Vue projects are using composition Api in Vue2 via a plugin because it is so good.

Just curious, but in your opinion, how does the composition API improve on React hooks?

I used Vue 2 for some projects a year or two ago, and recently have been comparing React hooks & Vue's composition API. Composition is definitely better than mixins, but as a new React user, hooks are feeling more intuitive right off the bat. With Vue 3, I feel like I have to decide for every component whether to stick with the options API or use the setup method, or end up with some awkward in-between.

I was always a big fan of Vue though; I'd appreciate any insight you can give on the Vue 3 additions.

> Just curious, but in your opinion, how does the composition API improve on React hooks?

I'm a fan of how Vue's composition API executes exactly once during a component lifetime (during `setup()`), whereas React hooks get set up again on every render. I find it I find Vue's approach easier to mentally model, and thus easier to write correct code (especially when doing something complicated where state changes / effect executions trigger each other). Since `setup()` is only run once, I can also do things like store non-reactive state in closure variables without wrapping those variables in hooks.

I think this puts it in perspective more; if I understand what you're saying correctly, then setup essentially gives you more fine-grained control over Vue's reactivity system, as opposed to just doing it all for you when a component is created. Which allows you to more easily pull out & consolidate reusable logic as needed.

It is kinda nice making reactive state really explicit like that; I like Svelte's approach for similar reasons.

There are many points. The main point for me is dependency tracking.

React hooks require manual dependency tracking and mistakes in this can lead hard to identify bugs

Vue has automatic dependency tracking, so that entire class of issues do not occur.

THIS. People focus so much on templates vs jsx and most forget this is the biggest difference, and a very important one. I think people discarding Vue because they don't like templates just don't understand this difference.
Hooks today are like CSS utility classes a few years ago.

"It's not semantic"

They will stay or they will go but I think they are useful more than they are not but I don't think its the final form we'll all adopt.

Hooks are way easier to use than everything that came before them.