Live data from Hacker News

Migrating from Vue 2 to Svelte

escape.tech

1–10 of 289 posts

Re: Migrating from Vue 2 to Svelte

#6
Re events - You can type events in Vue with `defineEmits`: https://vuejs.org/api/sfc-script-setup.html#defineprops-defi...

Re global enums - I'm not sure what the author means about global enums - anything imported into your Vue file can be used in the ``.

Re styles - Style is automatically scoped in Vue SFC files, too - I believe it was the first component framework to do this.

This article and migration seems not very thoroughly researched - seems the author just wants a reason to rewrite the front-end.

Re: Migrating from Vue 2 to Svelte

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

Re: Migrating from Vue 2 to Svelte

#8

Re events - You can type events in Vue with `defineEmits`: https://vuejs.org/api/sfc-script-setup.html#defineprops-defi... Re global enums - I'm not sure what the author means about global enums - anything imported into your Vue file can be used in the ` `. Re styles - Style is automatically scoped in Vue SFC files, too - I believe it was the first component framework to do this. This article and migration seems not…

That's my impression too.

Re: Migrating from Vue 2 to Svelte

#9
I’ve been so happy with Vue (2 or 3), I can’t think of a compelling reason to leave. The 2->3 migration is also trivial aside from any third party libs that don’t work. It’s really not a big lift. You can transition without going all-in on the composition API. The diff on a big project is very small.

Re: Migrating from Vue 2 to Svelte

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

I know you're probably asking it only rhetorically, but it's the way to mark something as reactive for the Svelte "compiler", cleverly using the existing JS label syntax.[1]

[1]https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Post reply on HN