Live data from Hacker News

Migrating from Vue 2 to Svelte

escape.tech

101–110 of 289 posts

Re: Migrating from Vue 2 to Svelte

#102
post #2

Migrating from svelte to when

Meanwhile React will continue succeeding the test of time

I like React and I'll admit that I resisted React at first, mainly due to JSX and workflow purposes. We had teams that could do CSS/HTML very well and those that were more capable in JS. There was a gap in skills. And taking the design files into HTML/CSS, testing the bulk of it and THEN adding dynamic functionality and JS was a good flow.

This was also many years ago, where we had - let's build apps mainly with HTML/CSS and sprinkle in some JS framework sugar and dynamic capability on the client side. Ok, Angular/Ember and then Vue worked VERY well. We made a hop from jQuery to more sophistication but still easy to read and develop compelling and maintainable, interactive frontends. Then we did SPAs which worked well for a few things but were vastly oversold.

React came along which was nice, but early on, it was not needed for many projects even though many devs started implementing it.

We had a demand for more rich web apps and they got MORE complex and dynamic. We decided, maybe we shouldn't sprinkle in all these sugary JS framework tags and corresponding logic in our HTML.

Then we had a ton more university-educated programmers entering the frontend scene that used to just be comprised of a megaton of jQuery heroes (no offense, they got shit done and went out to lunch most days while the more sophisticated frontend devs went hardcore on semantic HTML/CSS, VanillaJS, spending countless hours on browser bugs and QA cycles and using divs to render tabular data for fun/ego?).

We also got more interest in React from non full-time frontend devs (ex: fullstack and even backend devs) that were like, hey building frontend doesn't suck like it used to in VanillaJS! Count me in!

Coupled with the Stackoverflow copy-paste dev era and the nightmarish third party library upgrade scenarios... now we have a TON of shitty React codebases and people have, and will, migrate away from them. This cycle I'm describing gives rise to challengers like Svelte.

I like React (and React Native), but the many codebases I've inherited have not been good. In fact, I've probably inherited as many decent React codebases as decent jQuery codebases but what does that say? Not much because I haven't inherited many good examples of either.

I'll still choose inheriting a shitty React project over a shitty jQuery project any day. Great progress has been made (although you could argue much of the progress was in cross-browser standards and advancements in browser technology).

But I still feel like the truth that everything that is old becomes new again cannot be avoided.

And in that - it's web components and/or more HTML sprinkled JS frameworks for the win to me. I haven't used Svelte, although some on my team like it, but it looks like a return to a get-shit-done dynamic websites/apps framework.

And I'll likely still continue using React for larger, more rich and dynamic apps that require a larger dev team.

Re: Migrating from Vue 2 to Svelte

#103

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…

In what way is being on Vue 2 painful? Using it in production, zero problems, everyone understands it, does everything we need. Plan to migrate to Vue 3 for the nice to haves and to keep up to date, but Vue 2 is not painful at all. Considered React but I think Vue will be more productive for the team as a whole in the long term. Vue is more intuitive, better designed, and structured. But totally understand React has…

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.

Re: Migrating from Vue 2 to Svelte

#104
post #22

echos many of the same things i loved about svelte when i got involved in 2019: https://www.swyx.io/svelte-why people always call out the small community to be a downside, so a few of us started Svelte Society to fix that (very humble numbers compared to react, Rethinking Reactivity is probably the best starting point for most https://youtu.be/AdNJ3fydeao ). i actually think theres a “be careful what you wish for” as…

> so are less religious and more intentional about their tech choices.

The sentence I would use is "less pragmatic and more interested in hacking than being productive".

I know people like to dump React devs for being fanatics and I have encountered some of those people... Like, 2 maybe. The rest of us use React because we want a battle tested framework with a huge community.

I don't want to hack around with the cool new framework. I don't find frameworks exciting. I want to build stuff that I do find exciting and I want the framework to be in the background supporting that. I want to be able to find support when I need it and high quality prebuilt extensions for as much of the functionality my app needs as possible so that I'm not spending my days rebuilding basic components. That's why I choose React.

Re: Migrating from Vue 2 to Svelte

#105
post #91

When will mithril.js get the hype it deserves, I'm a sucker for simple tiny libraries with no dependencies and no build steps that are mature as well (6 years). I guess it doesn't have a flashy community with talks and developer advocates :/. I feel the same about htmx, another simple tiny library with no deps and no build steps. Why don't people recognize the advantage in that.

Needing a separate build step is not the hindrance that you think it is. For most developers it's a "set up once and forget" thing, and there are many cases when you would need to transform code during build anyway.

Re: Migrating from Vue 2 to Svelte

#107

JavaScript framework fence sitters who are planning to use Svelte for a component in your SSR application please note that that their Web Components support is very buggy and Svelte team has no intention to fix it, Because(In their own words)[1] - "Nobody on the core maintainers team is particularly fond of Web Components" Yet,Their official doc includes support for Custom Elements; I found that svelte is not the rig…

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

Re: Migrating from Vue 2 to Svelte

#108
post #66
post #18

Has anyone worked on a very large Svelte project yet? I work on a large React app in real life, but have been learning Svelte in my off time - there are some nice aspects like the out of the box state management, the syntax and structure is a bit easier to learn than React, but my intuition is a Svelte project would become unwieldy for a very complex app (React class components that are hundreds of lines long with do…

We built Roomlio entirely with svelte. Large app and many components. Having used react and angular on production apps in the past, I much prefer svelte. That being said, I am sick of framework fatigue and going forward I would probably choose raw web components and a simple template literal based template library like lit-html (not lit element). Write all the other bits ourselves.

Have you considered open sourcing the component library? I feel like lack of this kind of tooling is one of the main things holding Svelte back.

Re: Migrating from Vue 2 to Svelte

#109

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…

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.

Re: Migrating from Vue 2 to Svelte

#110

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…

> Bo idea why you put SSR and web components in the same sentence A typical JS framework fence sitter would build SSR first applications and might likely think about using a light weight framework like Svelte for a client rendered 'feature (or) two' like I did. > There are multiple documented downsides, including by Rich Harris, the author of Svelte In link [2] of my parent comment I've mentioned those, I've no techn…

> SSR first applications and might likely think about using a light weight framework like Svelte for a client rendered 'feature (or) two' like I did.

Rich Harris called this "transitional apps" :) See this excellent talk: https://www.youtube.com/watch?v=860d8usGC0o

There's now active work to finally let you build whatever you need from a single code: be it MPA SPA, or anything in between, seamlessly. Including things like "everything is SSR'ed except this specific part of the page". Svelte, Solid.js, Astro are all rapidly moving the state of the art towards that goal.

> Is not made clear upfront and that there's no intention to fix it.

IIRC the idea is to remove web components from the core eventually, and have them as a third/first-party add-on. Can't find the relevant tweets right now, so don't quote me on that :D

> What about web components first framework like Lit[1]?

Their SSR support is listed as experimental: https://lit.dev/docs/ssr/overview/ with multiple issues (see the end of the page).

There's a reason for that: web components in general cannot be SSR'ed. That is, you cannot take a random web component and have it SSRed. You have to do very specific manual hacks or very library/framework-specific/bundler hacks to make them work. See this excellent article for details: https://css-tricks.com/using-web-components-with-next-or-any...

Post reply on HN