Live data from Hacker News

Svelte 4

svelte.dev

71–80 of 227 posts

Re: Svelte 4

#71
post #29

Time for a very naive question. As somebody looking for a more effcient (less re-rendering) and nicer DX (template based, stuff like exit animations) alternative to React, what actually makes Svelte measurably better than Vue? On first (and very naive) look the two seem pretty similar, with the biggest difference being that Vue seems to have the much bigger ecosystem and more mature tooling (I keep hearing about Svel…

> From what I remember they even once had a virtual DOM-replacing Ahead of Time compiler, but walked back on it for some reason. nope, its still there, just is less complicated than you make it sound with those adjectives in front of "compiler" in the days of svelte 3 vs vue 2, i'd say the authoring experience was a lot more straightforward as vue had constraints around being a drop in framework. but then vue 3 came…

But Reactivity Transform is gone, isn't it? Isn't that what pre-compiled the reactivity and obsoleted the virtual DOM?

Re: Svelte 4

#72
post #60

I'm curious what peoples' experiences have been using modern react vs svelte vs whatever else is popular these days. I used react a while back for a dashboard mockup and was pretty happy with it. Something about svelte being a superset of standard html/js/css that gets compiled bothers me. I realize that the same can be said about typescript/tsx but I feel like in can trust it more... Maybe it's a maturity thing? Or…

Svelte is a better experience IMO. Faster and doesn't require manual hacks to gain a 0.005% speed improvement.

Re: Svelte 4

#73

Time for a very naive question. As somebody looking for a more effcient (less re-rendering) and nicer DX (template based, stuff like exit animations) alternative to React, what actually makes Svelte measurably better than Vue? On first (and very naive) look the two seem pretty similar, with the biggest difference being that Vue seems to have the much bigger ecosystem and more mature tooling (I keep hearing about Svel…

Vue dropped "reactivity transform" but they are working on a new "Vapor Mode" which is inspired by SolidJS, i.e. not having a VDOM. https://blog.vuejs.org/posts/2022-year-in-review

Thanks for the link!

> Vapor Mode will only support a subset of Vue features. In particular, Vapor Mode components will only support Composition API and . However, this supported subset will work exactly the same between Vapor and non-Vapor components.

> Building an app with only Vapor components allows you to drop the Virtual DOM runtime from the bundle, significantly reducing the baseline runtime size.

This seems like a clear push in the direction of Solid and Svelte in this area.

Re: Svelte 4

#74
This is odd timing with Rich Harris just releasing a course on Svelte v3 on Frontend Masters (June 12th 2023).

https://frontendmasters.com/courses/svelte-v2/

From the migration there does appear to be some breaking changes, don't know how that aligns with the course which I planned to take.

His old course was good as well, but that relied on Sapper.

Re: Svelte 4

#75
post #60

I'm curious what peoples' experiences have been using modern react vs svelte vs whatever else is popular these days. I used react a while back for a dashboard mockup and was pretty happy with it. Something about svelte being a superset of standard html/js/css that gets compiled bothers me. I realize that the same can be said about typescript/tsx but I feel like in can trust it more... Maybe it's a maturity thing? Or…

I hadn't built a proper web app in nearly 10 years until recently. I did do some experiments with React/Redux a while back, and some Angular. While both made logical sense, I found RR quite confusing and Angular very heavyweight.

I tried SvelteKit 2 weeks ago after working through learn.svelte.dev and it immediately appealed to me.

Starting with one file in a route that holds JS, HTML and CSS was great. Breaking it up into components as I went along was natural. I think TailwindCSS helped here too, because I barely had to do any CSS work and could focus on JS and HTML.

It took me a while to understand the value of stores and where to use them, but then I hit upon a use case (big complicated multiple nested tree of mutable data).

After a few refactorings I had a very nice compact and easy to understand solution - nothing like what I experienced with RR and Angular.

Re: Svelte 4

#76
post #60

I'm curious what peoples' experiences have been using modern react vs svelte vs whatever else is popular these days. I used react a while back for a dashboard mockup and was pretty happy with it. Something about svelte being a superset of standard html/js/css that gets compiled bothers me. I realize that the same can be said about typescript/tsx but I feel like in can trust it more... Maybe it's a maturity thing? Or…

I hadn't built a proper web app in nearly 10 years until recently. I did do some experiments with React/Redux a while back, and some Angular. While both made logical sense, I found RR quite confusing and Angular very heavyweight. I tried SvelteKit 2 weeks ago after working through learn.svelte.dev and it immediately appealed to me. Starting with one file in a route that holds JS, HTML and CSS was great. Breaking it u…

to be fair redux is a huge pain in the ass especially for medium to large teams where you have colleagues who misuse it.

there are better libraries out there like zustand or react-query which helps on most of these stuff.

Re: Svelte 4

#77
post #51
post #4

> Svelte 4 reduces the Svelte package size by nearly 75% (10.6 MB down to 2.8 MB), which means less waiting on npm install. This improvement will be especially noticeable for users who are loading our interactive learning experience on learn.svelte.dev for the first time, users of the Svelte REPL, and users with limited connectivity. The majority of the remaining package size is eslint support, which necessitates dis…

I'm used to Svelte, and I remember last year when I tried to install a basic NextJS starter template (create-nextjs-app) I had to wait a minute or so for all the npm dependencies to install. I then checked my project folder and it was 600MB....mindblowingly bloated.

To be fair, react is create-nextjs-app is installing React, React Router, Webpack, Tailwind, ESLint, Jest, etc.

create-nextjs-app is by design an "everything and the kitchen sink" approach.

Re: Svelte 4

#78
post #51

Earlier quoted context omitted.

I'm used to Svelte, and I remember last year when I tried to install a basic NextJS starter template (create-nextjs-app) I had to wait a minute or so for all the npm dependencies to install. I then checked my project folder and it was 600MB....mindblowingly bloated.

yea but this more like install react more than nextjs, nextjs do to much magic to be comparable 600 mb is insane anyway but is important to be clear then we are comparing different things

Would SvelteKit be a better comparison then?

Re: Svelte 4

#79
post #60

I'm curious what peoples' experiences have been using modern react vs svelte vs whatever else is popular these days. I used react a while back for a dashboard mockup and was pretty happy with it. Something about svelte being a superset of standard html/js/css that gets compiled bothers me. I realize that the same can be said about typescript/tsx but I feel like in can trust it more... Maybe it's a maturity thing? Or…

I hadn't built a proper web app in nearly 10 years until recently. I did do some experiments with React/Redux a while back, and some Angular. While both made logical sense, I found RR quite confusing and Angular very heavyweight. I tried SvelteKit 2 weeks ago after working through learn.svelte.dev and it immediately appealed to me. Starting with one file in a route that holds JS, HTML and CSS was great. Breaking it u…

I had the same experience. While I understood React principles, I never quite got how to built large things with it.

Svelte clicked after like 3 hours.

Also it's more "fun" than React ever was.

Re: Svelte 4

#80
post #67
post #55

Earlier quoted context omitted.

Let's hope all baggage was not offloaded to some extra dependency ;) In all seriousness I would like to see more packages competing to reduce size and dependencies count to absolute minimum.

From the post > The number of dependencies in Svelte has been greatly reduced from 61 down to 16. This means faster downloads for our users as well as less susceptibility to supply chain attacks Its not zero but quite a big dependency reduction

[deleted]
Post reply on HN