Live data from Hacker News

Svelte 4

svelte.dev

61–70 of 227 posts

Re: Svelte 4

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

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

Re: Svelte 4

#62

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

Re: Svelte 4

#63
post #53

Earlier quoted context omitted.

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

Good point, didn't want to make it seem different! Just wanted to show that internal dependencies are also tracked as any other dependency.

Re: Svelte 4

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

Not sure about it being a superset, my understanding is that react is a renderer, whereas svelte is a compiler, basically removing unused code from its std lib, and even converting some code to native JS code. It tries to work with the DOM not around it.

SolidJS is the one I am really excited about moreso though, since it uses JSX and works even moreso with the DOM.

Re: Svelte 4

#65
post #40

Earlier quoted context omitted.

> I keep hearing about Svelte's flavor of JS basically being its own language now and it not playing all that well with Typescript it's a weird habit on HN to refer to random rumours that have discouraged you from trying something, and then explicitly not link to even the source of the random thing you're thinking of. I would guess you're misremembering something about the *developers of Svelte* saying they didn't th…

But Svelte obviously doesn't play well with TypeScript, and is kind of its own language - you don't need a source for that. Good luck e.g. getting reactive declarations to play well with TS's type narrowing or null analysis.

you clearly don't know what you are talking about.

reactive declarations do not change the type of the objects. it just that they can rerun when the dependencies change.

sure for the convenience of the users you do not need to type `let vars...` for every new variable declared in the reactive statement, but no one forbid you to write it before hand, or let the language server/plugin do it for you.

but Svelte indeed do not work perfectly with typescript, because it allows you to write code inside html template, which currently only support javascript expression.

Re: Svelte 4

#66

I've recently embraced Svelte for my side-projects, hackathons, and personal endeavors, and I must say, I'm absolutely enamored with its developer experience (DX) when compared to React. If you're interested, I've shared some of my thoughts about this on my personal website: https://www.kabirsewani.com/blog/why-svelte . (However, if personal links are not permitted, I'd be more than happy to provide a brief summary i…

> What binds us to a virtual DOM?

The virtual DOM was created to solve browser performance issues with the actual DOM. This may not be relevant anymore, but that's why it was made.

Re: Svelte 4

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

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

Re: Svelte 4

#68
I'm pretty happy with Svelte for one of my side projects. I wish my _other_ side project used it, but I'm not in charge of that one, hah.

Re: Svelte 4

#69
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'm a big fan of svelte vs. other frameworks. The closeness to vanilla js and natural coexistence with html+css makes it so smooth to work with and you feel productive right away. Recently built this with it: https://meoweler.com

At least for small projects like this, it's perfect. For something larger/complex I'd be a bit more weary.

Re: Svelte 4

#70
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 haven't used it as much as I used react based frameworks, or angular, but the little I've used it I really like the development experience. Plus the payload sent to the end user are much smaller.

Svelte isn't a subset of js/html/css, it just uses them. Svelte does support typescript as well.

Post reply on HN