Live data from Hacker News

Migrating from Vue 2 to Svelte

escape.tech

81–90 of 289 posts

Re: Migrating from Vue 2 to Svelte

#81
post #7

Still don't understand why people prefer magic templated front-end frameworks. Reading non-standard HTML just sucks. What even is "$:" or why does Vue require non-standard javascript ref("") objects...

If you want a serious answer: because frameworks do a lot of work for you.

For example, they will keep state synchronised between your data model and components (and with some handy plugins, your server).

They allow encapsulation and reuse through a well thought out set of abstractions.

They provide functionality like routing and app-wide data stores with transactions.

If you’re just building a webpage no problem, use raw JS. But if you’re building a complex app, let a framework take care of as much incidental work as possible.

Same as with all (good) frameworks and libraries, they boost your productivity.

Re: Migrating from Vue 2 to Svelte

#82
I didn't see anything about type checking. We have a pretty sizeable Vue2 app written in TypeScript (well, mostly, because some devs...), and using Component/Prop/etc. decorators, it's very readable. The html template checker/compiler unfortunately doesn't see the data types, but apart from that, type checking is almost perfect within a component. That saves so much time. And it has optionally scoped styles too.

Re: Migrating from Vue 2 to Svelte

#83
post #77

As a primarily backend person, it's always interesting to read about this sort of thing as an outsider with little appreciation for the nuances/challenges people face using these frameworks. I keep hoping things will settle a bit more so that I can someday pick one to learn in depth without worrying about it being replaced by the next hotness. Am I right in thinking the state of major players is roughly: React - incu…

[deleted]

Re: Migrating from Vue 2 to Svelte

#84

Svelte, you can learn in an afternoon. Have migrated Angular 1.X and Angular 6.* to Svelte in the past.

I would say you can equally learn the core of Vue and React in a day, so that you’re actually building your app before the day has finished.

Re: Migrating from Vue 2 to Svelte

#85
post #82

I didn't see anything about type checking. We have a pretty sizeable Vue2 app written in TypeScript (well, mostly, because some devs...), and using Component/Prop/etc. decorators, it's very readable. The html template checker/compiler unfortunately doesn't see the data types, but apart from that, type checking is almost perfect within a component. That saves so much time. And it has optionally scoped styles too.

There’s literally an entire section on type checking. With a comparison table and everything.

Re: Migrating from Vue 2 to Svelte

#86
post #77

As a primarily backend person, it's always interesting to read about this sort of thing as an outsider with little appreciation for the nuances/challenges people face using these frameworks. I keep hoping things will settle a bit more so that I can someday pick one to learn in depth without worrying about it being replaced by the next hotness. Am I right in thinking the state of major players is roughly: React - incu…

As a backend person that used to be a front end person, there has never been a better time for using VanillaJS (or TypeScript), HTML, and CSS?

> someday pick one to learn in depth without worrying about it being replaced by the next hotness

So maybe the trick is to not use a framework. Like, I don't need a "framework" for backend dev, just a toolbox of good libraries.

The tooling around TypeScript is similar to a backend language like Go, a very different experience from writing JavaScript a decade ago

Re: Migrating from Vue 2 to Svelte

#87
post #77

As a primarily backend person, it's always interesting to read about this sort of thing as an outsider with little appreciation for the nuances/challenges people face using these frameworks. I keep hoping things will settle a bit more so that I can someday pick one to learn in depth without worrying about it being replaced by the next hotness. Am I right in thinking the state of major players is roughly: React - incu…

I keep hoping things will settle a bit more so that I can someday pick one

You are in the wrong industry, to think this will happen any time soon.

Change has been fast in computing, for decades. Stand still, and you are overrun and eventually your knowledge moves towards irrelevance.

Doctors need to keep up to date with new medical information, new drugs, new warnings about drugs, new techniques.

Lawyers need to read caselaw, keep up to date on new legislation.

Both are arduous tasks for those professions.

Yet there is more to keep up to date in computing, in a year, than any doctor or lawyer must keep pace with in their lifetime.

So either dive in and learn, learn, learn! Learn for the joy of it, for the fun!

Because there is nothing to wait for.

Because change will never stop here.

Re: Migrating from Vue 2 to Svelte

#88

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…

> 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 technical contention on his PoV but that 'Custom Element' feature is buggy, Is not made clear upfront and that there's no intention to fix it.

> As long as you pretend you need web components for SSR, no framework will be right for you, including web components themselves.

What about web components first framework like Lit[1]? I'm not stating it as a fact, But asking?

[1] https://lit.dev/

Re: Migrating from Vue 2 to Svelte

#89

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…

I understood it as “migrating to Vue 3 is no more painful than staying on Vue 2”.
Post reply on HN