Live data from Hacker News

Svelte 4

svelte.dev

111–120 of 227 posts

Re: Svelte 4

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

https://svelte.dev/blog/svelte-and-typescript

Re: Svelte 4

#112

@dang https://news.ycombinator.com/item?id=36432447 was on the front page and has substantially more discussion. It was somehow marked as a duplicate of this post. Could you merge them?

I emailed the mods. I don't think they get notified for @'s.

Can confirm. dang himself told me that after I tried using "@dang" once.

Re: Svelte 4

#113
At the moment I am testing SolidJs and Svelte for a small side project and feel that SolidJs is slightly superior but Svelte will win.

Re: Svelte 4

#115

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…

The performance difference is huge. A few years ago I launched an interactive consumer app on very resource constrained devices that would have been impossible with React or Vue (I empirically tested both). Think dual or quad core 1Ghz arm processors with zero GPU acceleration running electron . The only optimization I had to implement was virtualization when showing hundreds of off screen images (an optimization I w…

That's fascinating. Could you elaborate on how big the difference is? I'd also be interested in a comparison with Vue's vapor mode.

Re: Svelte 4

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

The biggest pro to choosing the likes of Svelte (or Vue, htmx, long list of newer frameworks that have learned from React/Angular's shortcomings) is how few footguns there are.

That's really the big thing. I know everyone loves to believe they're masterclass programmers and falling for such traps is beneath them, but after seeing some of these masterclass programmer's react repos... it's very clear why the react docs is filled with many disclaimers and notes (which kudos to the react team for phenomenal docs).

Re: Svelte 4

#117
The only problem I have with Svelte is that I can't find a job. Only seen one in the last six months and they bailed after we discussed pay.

I love Vue but I really wanted to work on an actual project with Svelte because the developer experience was fantastic. Guess I'll have to wait a few more years.

Almost every job is react, react, react. It's exhausting dealing with the cultists

Re: Svelte 4

#118
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 feel like React is more complicated these days for little gain. I've worked in Knockout.js, Aurelia, Svelte, Vue 2, Vue 3, and now React.js. To me, React.js was more complicated to learn than almost all of them (Knockout.js is older so that felt more complicated to me). My favorite was either Vue 2 or Svelte - they're just simple to learn.

In my opinion I feel like React.js was ahead of its time, but now we're seeing some competitors achieve the same (or better results in terms of benchmarks) with simpler approaches.

Keep in mind these are just opinions, and I'm only about a month into React in a massive web application. That said, it took me like a literal day to learn Vue 2 because it was mostly just like native web development anyways.

Re: Svelte 4

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

The VDOM was never about performance problems with the actual dom. It was always slower as you still have to mutate the actual DOM. The "VDOM if faster" was always FUD.

The VDOM was invited to prevent bugs by removing the difficult of managing fine grade DOM mutations. Technically you are doing more work with a VDOM and diffing, than carefully mutating the DOM, it's slower.

Of course if you just threw away the whole DOM and re built it, then he's the VDOM was quicker, but that's not how anyone was building stuff.

Re: Svelte 4

#120

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…

I have little experience with Vue but to me Vue is very similar to React. What sold me on svelte is the fact that I learned like all of it in maybe 3 hours. I have tried to pick up React here and there and I get the fundamentals but I hate that you need an architecture framework, a router framework etc. Svelte has a standard way of doing that. Writing Svelte, I actually had "fun" building stuff, I can't say the same…

If you compared svelte to vue to react, vue is much more like svelte than it is react.
Post reply on HN