News for hackers. Stuff that matters.
Re:Migrating from Vue 2 to Svelte by randomsearch on Friday December 02, 2022 @03:11AM (#33828069)
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 a larger ecosystem - we’ll just be building more stuff in house so understanding our own code will be more important than having a larger choice of dependencies.

Did take a look at Svelte, agree with you.

Re:Migrating from Vue 2 to Svelte by vosper on Friday December 02, 2022 @03:31AM (#33828177)
I understood it as “migrating to Vue 3 is no more painful than staying on Vue 2”.
Re:Migrating from Vue 2 to Svelte by jakewins on Friday December 02, 2022 @03:44AM (#33828236)
Isn't the reasoning to migrate literally the first sentence in the blog post?

> After using Vue 2 as our front-end framework for almost two years, it was announced that this support would no longer be maintained,

Eg. some teams don't want their development to happen on a framework with no support from the devs that wrote it.

Re:Migrating from Vue 2 to Svelte by Oddskar on Friday December 02, 2022 @03:56AM (#33828300)
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 by Semaphor on Friday December 02, 2022 @04:37AM (#33828532)
> - Very poor typescript support.

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

Re:Migrating from Vue 2 to Svelte by lol768 on Friday December 02, 2022 @04:47AM (#33828598)
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 by tomonl on Friday December 02, 2022 @04:51AM (#33828621)
I used those too, but it makes the upgrade to Vue 3 quite a bit harder.
Re:Migrating from Vue 2 to Svelte by depressedpanda on Friday December 02, 2022 @05:37AM (#33828835)
I've worked professionally in both Vue 2 and React. Even with class components and prop decorators you still have the annoying Vue template DSL where you don't get any TS support.

In comparison JSX will be checked by typescript, so in that regard JSX (and therefore React) is superior.

Re:Migrating from Vue 2 to Svelte by Hawxy on Friday December 02, 2022 @09:59AM (#33831304)
Composition API has the best Typescript support available in Vue 2. It's supported out of the box in 2.7, and a plugin in previous versions. The decorator syntax is unsupported in Vue 3 and shouldn't be used.
Re:Migrating from Vue 2 to Svelte by _s_a_m_ on Friday December 02, 2022 @04:14AM (#33828405)
- Nuxt only matter if you want to use it, is not Vues problem, because you talking about another software which addresses a different problem. - Typescript support is only a problem if you want to use Typescript, imagine, there is also a world beyond TS. - Performance, often a matter of design and understanding your framework
Re:Migrating from Vue 2 to Svelte by CharlesW on Friday December 02, 2022 @08:45AM (#33830317)
> - Nuxt 2 hasn't made any releases in ages.

FWIW, Nuxt 3 was released in November. https://nuxt.com/v3

Re:Migrating from Vue 2 to Svelte by KronisLV on Friday December 02, 2022 @04:23AM (#33828456)
Note: used Vue 2 and 3 with JavaScript instead of TypeScript, so cannot comment on the latter.

Personally, I rather enjoy the <script setup> syntax in Vue 3 which makes using the Composition API more pleasant and makes it feel more like React, instead of something more boilerplate heavy: https://vuejs.org/api/sfc-script-setup.html

Of course, Composition API itself is also available in Vue 2 (at least the newer versions) as a plugin, but personally I didn't see anyone using it in the older version. Either way, it can make code easier to write!

Furthermore, starting out new projects, regardless of which version you use, Pinia is a great option, which you won't see in many of the older Vue 2 projects (but could use if you started a new one with Vue 2, although that's not a good option because of EOL): https://pinia.vuejs.org/

Aside from that, Vue 3 still lacks some component library support in some cases, last I checked so perhaps that's an argument in Vue 2's favor (until everything is updated): https://news.ycombinator.com/item?id=32916677

React feels good in some cases, for example thanks to new solutions like https://react-query-v3.tanstack.com/ but at the same time seems to be getting more overcomplicated as time goes on (Vue feels like it does hooks in a more clean way, you don't need to deal with the complexity of Redux either).

The last React + TypeScript codebase that I looked at felt like it's just going to slow down anyone who works with it, which seemed to be true, judging on how fast people iterated with it vs a Vue project. Note: that's an anecdote.

Then again, the only good front end technology with TypeScript that I've used was Angular, even though it crumbled under its weight otherwise sometimes (once again, in regards to iteration speed in particular).

Re:Migrating from Vue 2 to Svelte by cies on Friday December 02, 2022 @04:31AM (#33828501)
> React + TypeScript [...] anecdote

I agree that that combination it is very ceremonial.

We now doing new projects in Elm as the JS/TS ecosystem simply does not cut it for me.

Re:Migrating from Vue 2 to Svelte by yakshaving_jgt on Friday December 02, 2022 @10:47AM (#33832062)
Wise choice, but it brings along with it the curse of Plato’s Cave.
Re:Migrating from Vue 2 to Svelte by cies on Monday December 05, 2022 @04:37AM (#33863392)
To some a curse, to some enlightenment. :)
Re:Migrating from Vue 2 to Svelte by nov21b on Friday December 02, 2022 @07:19AM (#33829579)
In my experience React + TypeScript is a match made in heaven. You are basically writing pure TypeScript in TSX.
Re:Migrating from Vue 2 to Svelte by latchkey on Friday December 02, 2022 @11:52AM (#33833023)
It certainly isn't bad and is my first choice. But, do you have a deep understanding of how React's rendering model works in all edge cases? Because that part really isn't heaven for me. Feels more like trying to navigate a minefield.
Re:Migrating from Vue 2 to Svelte by nov21b on Friday December 02, 2022 @01:21PM (#33834481)
I don't and can see how in edge case scenario's one can run into discrepancies between Reacts typings and advanced edge case workarounds. Especially since React itself isn't written in TypeScript.
Re:Migrating from Vue 2 to Svelte by for1nner on Saturday December 03, 2022 @09:24PM (#33849924)
> In what way is being on Vue 2 painful? Using it in production, zero problems, everyone understands it, does everything we need.

I think others have offered sufficient/agreeable takes on this, but as the OP, I'll firstly point the pain finger at our own development and blame far too much state/ui/biz logic existing in the web in very tangled and inappropriate ways (part of the nightmare I inherited). Beyond that, the actual vue2-related pain points are typically ecosystem-related support (packages, etc.), and specifically being able to adapt to typescript (this project was initially done in early vue 2.x with just javascript, and attempting to reimplement in typescript to address some of our pain was not fun)