Live data from Hacker News

Migrating from Vue 2 to Svelte

escape.tech

131–140 of 289 posts

Re: Migrating from Vue 2 to Svelte

#133

The very first paragraph leads me to believe this is just a rewrite into svelte for the sake of it - I get it, Svelte is the new hotness on the FE-js-block, but this entire post stinks of "someone on the dev team advocated and fluffed enough figures to convince us. So now we're going to tell you why it was the right choice!" I say all this pretty confidently as someone currently maintaining a massive legacy vue2 app…

Wowowow stop.. last time I seriously looked aeons ago (4 or 5 years? :D) there was Vue as the nice smaller thing as an alternative React.. besides some other few bigger names. Noe Vue2, and Vue3? That didn't age well? And Svelte? Omg, doing (because I need to) C or C++ stuff, where you have (or lets say you are bound to for several reasons, compatibility, regulations,..) C++11.. or even C99 .. man I feel so old and s…

You don't know how good you have it to work on the backend (and I don't mean Node).

Trust me, the grass ain't greener on the other side.

Re: Migrating from Vue 2 to Svelte

#134

Earlier quoted context omitted.

> planning to use Svelte for a component in your SSR application please note that that their Web Components support No idea why you put SSR and web components in the same sentence, and in a way that presumes that web components are required for that, or at all. 1. web components are literally incompatible with SSR and all SSR solutions for them are ugly hacks. 2. It's not just personal "fondness" that prevents Svelte…

> why you put SSR and web components in the same sentence Web components are a browser standard; so anyone thinking about the long haul for their web product would be well advised to think about web components as well. > web components are literally incompatible with SSR Declarative shadow DOM is an emerging browser standard that is literally compatible with SSR, and is already supported by Blink-based browsers.

> Web components are a browser standard; so anyone thinking about the long haul for their web product would be well advised to think about web components as well.

It doesn't make it

1. a good standard,

2. a requirement, and

3. a viable standard to support

There are countless issues with web components none of which are on any path to solution, they keep valiantly solving issues that only arise from introducing web components in the first place, and there are multiple well-documented and discussed reasons why the absolute vast majority of frameworks (including the new ones) don't use them as their foundation.

> Declarative shadow DOM is an emerging browser standard that is literally compatible with SSR

1. It's only "emerging"

2. As far as I understand, there are still multiple unresolved issues

3. The fact that it's available in Chrome (don't insult us by using the vague Blink-based browsers) means literally nothing. Because Chrome are well known for shipping half-baked Chrome-only non-standards just because they feel like it

(Don't also forget how horrendously bad the whole API is https://twitter.com/WebReflection/status/1526186094232064000)

Re: Migrating from Vue 2 to Svelte

#135
As someone who switched from Vue 2 to React around when hooks were introduced, can someone explain to me why they like non-React frameworks? Based on my experience, they all have some drawbacks:

- Template languages instead of JS. If I want to perform some operation, I have to use their if and for constructs in their unique template language. In React I can just write JS.

- Due to the above, TypeScript support is often lacking or outright poor. IDE support also usually is less than React. The maintainers of the IDE plug-ins simply don't have as much bandwidth as those of React, likely due to lack of man power.

- Vue has a weird plugin architecture, I remember that I couldn't simply import a library as in regular JS or React, I had to register it as a plugin for some reason. Not sure if the situation changed since Vue 2.

- Vue also has a weird way of writing out the code, it had to be done inside an object in the script part of the single file component.

- Speaking of SFCs, cool concept but again depends on IDE support. I'd much rather have a folder for each component and colocate my CSS and JS files there as in React, or use a CSS in JS solution.

- Signals and two way data binding are not as good as people think. When you have a big enough project, you'll understand, as changing one thing can change something else completely separately and debugging is like untangling spaghetti. I actually had to do this for a big Vue 2 project and it just put me off from the concept. There's a reason why React has explicit one way binding, even if it's more code to write and wire up.

- Hooks are incredible. For people who don't get it, they should actually read this GitHub issue about adding something similar to Flutter, the author Remi Rousselet is a well known library author and shows the value of hooks in any declarative UI framework. He explains how, much as functions encapsulate state, hooks encapsulate life cycles, and how mixins fundamentally cannot work the same way in a class based architecture with component life cycle methods. https://github.com/flutter/flutter/issues/51752

- Even if everything all else was equal, everything above was fixed, the main difference for switching is that library support is vastly, vastly lacking for non React libraries. The community assumes React first over anything else, and the quality of React libraries vs non React ones are night and day. Take react-three-fiber or Framer Motion for example, no way there's something of that quality in non React ecosystems

- I even got annoyed by the lack of library support and being treated like a second class user and switched to React. The network effect is real.

Re: Migrating from Vue 2 to Svelte

#136

Earlier quoted context omitted.

As someone working in a large Vue 2 app: - Very poor typescript support. - Poor performance (compared to Vue 3). - Ecosystem has already started lagging behind (e.g. Vue Testing Library for v2 has out of date dependencies, and no one is actively maintaining it) - Nuxt 2 hasn't made any releases in ages.

> - Very poor typescript support. If you use class components and prop decorators, the TS support is actually pretty nice. Kinda boilerplate heavy, but nice.

I really enjoyed using these tools, it felt idiomatic to have a class per component with props and data as fields on the class - but it seems like there's now no upgrade path for us folks in Vue 3 land.

Re: Migrating from Vue 2 to Svelte

#137
post #4

It seems worrisome that front end frameworks needs to be changed after just two years of use. Glad I'm not working with front end...

React is almost 10 years old, if you used React in the last few years you haven't really been changing more than the average backend. The "frontend changes so often" meme made sense years ago but doesn't seem to be that different than backend nowadays. I mean in the last ~10 years we had the new hotness of moving from cloud hosted servers -> docker images -> kubernetes, C# made a massive move when going to .net core, Java actually updates frequently now, etc. Frontend moves a bit faster than backend but if you picked React/TypeScript 5 years ago, you're probably still using them.

Re: Migrating from Vue 2 to Svelte

#138

Earlier quoted context omitted.

I'm not saying it's the same (like you said, Svelte isn't at 1.0) but don't you feel like there's at least a little irony in saying the post stinks of justifying someone just wanting to try out something different when you're currently chucking a Vue 2 app for React? Reading your post it doesn't sound like you're fully onboard with that jump anyway? (Maybe I'm reading too far with this though).

React is not really a new hotness anymore though.

Imo, makes it the best bet for building anything.

There's still a new JS framework everyday but if you ignore all that noise and for production-quality software just have a look at React and the most popular meta framework on it, Next.js, you'll be more than alright.

Re: Migrating from Vue 2 to Svelte

#139
post #97

The very first paragraph leads me to believe this is just a rewrite into svelte for the sake of it - I get it, Svelte is the new hotness on the FE-js-block, but this entire post stinks of "someone on the dev team advocated and fluffed enough figures to convince us. So now we're going to tell you why it was the right choice!" I say all this pretty confidently as someone currently maintaining a massive legacy vue2 app…

SvelteKit isn't Svelte's UI framework. SvelteKit is a full web framework for serving Svelte apps. It's essentially Sapper + Svelte in a more harmonious combination. I have no opinions about any of these libraries and frameworks for business applications.

SvelteKit is going ot be Django/Ruby on Rails of frontend frameworks. Due to integration and polish, it is so much easier to use than anything I have developed with on Angular, React and even older stacks like jQuery.

Re: Migrating from Vue 2 to Svelte

#140

Earlier quoted context omitted.

As someone working in a large Vue 2 app: - Very poor typescript support. - Poor performance (compared to Vue 3). - Ecosystem has already started lagging behind (e.g. Vue Testing Library for v2 has out of date dependencies, and no one is actively maintaining it) - Nuxt 2 hasn't made any releases in ages.

> - Very poor typescript support. If you use class components and prop decorators, the TS support is actually pretty nice. Kinda boilerplate heavy, but nice.

I used those too, but it makes the upgrade to Vue 3 quite a bit harder.
Post reply on HN