Not sure what they mean by "typed events: vue 3: no". It's possible, I did it today. Here's the doc: - Typed component emits: https://vuejs.org/guide/typescript/composition-api.html#typi... - Typing event handlers: https://vuejs.org/guide/typescript/composition-api.html#typi...
And the discussion of store for Vue neglected pinia which is de-facto the store.
Migrating from Vue 2 to Svelte
261–270 of 289 posts
Re: Migrating from Vue 2 to Svelte
#262When 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.
Re: Migrating from Vue 2 to Svelte
#263It's ridiculous to me to read that for some people it is desired to have CSS, JS, and HTML in the same file. I would never consider it an improvement.
That’s an interesting opinion as react, Vue, svelte are all in favour of having css and templates together with js. What do you prefer? IIRC, Vue allows you to move link to a separate html,css and js file from vue sfc file should you want it
I know that “smaller components are better”, I agree with this rule, but I prefer to draw the boundaries myself, not forced by the capabilities of my code editor.
Re: Migrating from Vue 2 to Svelte
#264It 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,…
Re: Migrating from Vue 2 to Svelte
#265I'm missing the raw numbers. Increased performance? Faster code execution? By how much? I'm sure Svelte is faster, but if we're talking 10% improvement it doesn't really matter. Additionally... {@html Prism.highlight(code, Prism.languages[lang], lang) } looks very unsafe to me. (Vue example has the exact same problem)
i dont understand, you’d have to do the same in react? mostly this code injection comes from trusted sources like your CMS. if you’re displaying arbitrary user input then yeah better sanitize it but thats a problem common to all frameworks react included as for perf i mean the main thing is “are you downloading 100kb just for the framework” whereas many svelte apps come in under 10kb. beyond that agree it doesnt real…
According to https://web.dev/optimizing-content-efficiency-javascript-sta... the js size budget is about 800kB minified (1s to parse/compile). So if an app max out the budget, the framework part is considerably 17.05%.
Not bad, but if the median of react app is around 300kB which means the framework part is 45.4%. This is bad!
Re: Migrating from Vue 2 to Svelte
#266Svelte & SvelteKit has been wonderfully productive for me. It's a bit insane that I have adopted it across so many projects of mine despite the fact it is pre 1.0 (well that has more to do with me I guess), but I am just faster with it. I have used a lot of frontend frameworks over the years, and before SvelteKit Vue & Nuxt were what I was warming up to. The article really focused on measurable things like type check…
Even after this many years on HN…
Re: Migrating from Vue 2 to Svelte
#267Earlier quoted context omitted.
Because in many cases, manipulating the DOM with vanilla JS sucks way more than writing declarative code with a framework.
It's really not that bad. At least not in 2022. With the caveat that you can keep your UI (DOM manipulation) code from your business logic code. Which I'm sceptical of given the front-end code bases I've seen in the wild. But no one writes blog posts about how Vanilla JS 2 is no longer supported so they had to migrate to Svelte :)
Re: Migrating from Vue 2 to Svelte
#268Earlier quoted context omitted.
How is typescript support? I found that a bit lacking when I was using Svelte (and I otherwise love svelte)
Typescript support in Svelte is one of the biggest problems with the framework I’ve encountered. We have a couple of production Svelte apps at my job and overall the frontend DX is excellent. However, not being able to use generically typed components is a big missing feature. We have a number of custom core components which work really well, but not being able to create a new component with something like MyTable =…
Re: Migrating from Vue 2 to Svelte
#269Earlier quoted context omitted.
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.
How is typescript support? I found that a bit lacking when I was using Svelte (and I otherwise love svelte)
Announcement (some things have changed, surely): https://svelte.dev/blog/svelte-and-typescript
More info in the GitHub repo I linked to elsewhere.
Re: Migrating from Vue 2 to Svelte
#270Earlier quoted context omitted.
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.
Quirks.. I mean rules of hooks in one day? You're not being serious.