Live data from Hacker News

Svelte 4

svelte.dev

51–60 of 227 posts

Re: Svelte 4

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

Re: Svelte 4

#53
post #27

Earlier quoted context omitted.

I understand this thought for external dependencies, but dependencies also includes internal ones, which I don't see a reason to reduce. Modularity and re-usability of individual pieces of code are a good sign for me.

I assume they mean external dependencies when they say that. I'm not sure what the point of the statement would be if it included internal ones.

Dependency managers like NPM don't differentiate between internal and external dependencies. I assumed that the Svelte devs were referring to this. Vue for example only has internal dependencies, but NPM shows them as any other: https://www.npmjs.com/package/vue?activeTab=dependencies

Re: Svelte 4

#54
post #28

Earlier quoted context omitted.

> State in Svelte goes in stores. State in react seems to go in one of eighteen different mechanisms, which all begin with a 45 minute video of the author’s opinions about the true nature of reactive programming, when all I want to do is store a string. So... useState? :) Of course then I got to thinking about how I'd answer the question "How can I put make that useState value accessible at different points in the co…

I work on several large react apps that are very data heavy and what I would consider complex. Honestly we just use useState and prop drilling. Most state is stored at optimal position within the hierarchy, so there really aren't that many props being passed down. The only place context is used is for session information. It's really quite simple and elegant. Svelte's model would likely be more complex tbh.

Yeah, I think it's something you just have to get a feel for over time. Sometimes prop drilling is the lesser of two evils, other times it makes more sense to break related state up into a shared context.

At least the React ecosystem as a whole seems to have broken free from the delusion that Redux is the be-all-end-all of state management. Those were dark days.

Re: Svelte 4

#55
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…

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.

Re: Svelte 4

#56
post #53

Earlier quoted context omitted.

I assume they mean external dependencies when they say that. I'm not sure what the point of the statement would be if it included internal ones.

Dependency managers like NPM don't differentiate between internal and external dependencies. I assumed that the Svelte devs were referring to this. Vue for example only has internal dependencies, but NPM shows them as any other: https://www.npmjs.com/package/vue?activeTab=dependencies

It's referring to all transitive dependencies - not just direct dependencies. More like this: https://npm.anvaka.com/#/view/2d/vue

Re: Svelte 4

#57

What an odd coincidence, after seeing Svelte for years I decided to actually try it for the first time yesterday, and now this drops. To be honest the timing of this is actually kind of a shame (just for me) as I haven't used it nearly enough to be particularly excited about this, but seeing as Svelte 3 was 4 years ago, I doubt I'll see another one anytime soon. All sounds great anyway, congrats to the team!

They seem to be doing something of a tick-tock update approach. Not sure if it’s planned or by accident. V2 was a small change, V3 was a big change, V4 is small, and as far as I understand they’re already working on something that might end up V5.

Re: Svelte 4

#58

Earlier quoted context omitted.

I just rebuilt a web app in Vue (and Vite), and first-class Single File Components are the dream. Is there anything that even approaches that simply joyful DX?

Rebuilt with that but coming from which stack?

Just POJS/Vanilla JS with jQuery. I've had good experiences with earlier versions of Vue for other projects, so surely there's some familiarity bias there. I now see that Svelte has SFCs and that Vite supports Svelte, so I might give that a try for my next project.

Re: Svelte 4

#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 that it's just one language getting compiled to its subset (with syntactic sugar for dom elements)

Post reply on HN