Live data from Hacker News

Introducing Svelte, and Comparing Svelte with React and Vue (2021)

joshcollinsworth.com

121–130 of 213 posts

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#121
post #26

Earlier quoted context omitted.

Vue has `refs`, which are reactive proxy objects that are used for tracking things like re-rendering. Since vue does not hide the fact that something is a ref, you need to call `myRef.value` to get to the underlying value of `const myRef = ref(10)`. In a new and currently experimental syntax, you can use `const myRef = $ref(10)`, at which point you can just use `myRef` directly. This will then be converted by the Vue…

What is the `10` here? Is it a reference to the literal value `10`...?

It is just an initial value.

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#122
post #5

The only thing I don't like about Svelte is the reactive blocks, prefixed with $:. There are a number of gotchas, like updating complex objects, which make things a bit...implicit rather than explicit.

Maybe you need vue3 .value

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#123

At windmill ( https://github.com/windmill-labs/windmill ), our whole frontend is in svelte, we love it, the performance are second to none and the dev experience is great. But finding svelte dev is proving itself harder than I thought. So there is that issue as well.

Surely any reasonably smart React dev will become productive within a very short period of time? Or is it that people simply don't apply when they see Svelte on the tech list?

It must be the second. Svelte is by far the easiest to understand framework (of the "big" ones) that I have yet encountered.

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#124

Earlier quoted context omitted.

The guy who created it, Rich Harris, used to work for the New York Times and developed it while he was there. So it's not a big surprise that NYT use it. I'm not sure about many other 'larger news sites' using it, but one place I have seen it out in the wild in a big production app is the Apple Music web app.

How did he managed to push his own framework. I’d love to rewrite the world, that’s so much more fun than converting Json to sql. But it would be a very hard sell to management to write our own framework instead of using something battle tested like spring boot.

Well the Jeremy Ashkenas (of Backbone, Underscore, CoffeeScript) and Mike Bostock (of D3) used to work there as well and I'm pretty sure the NYTimes pretty heavily embraced some of those libraries with impressive results, so it's probably part of the culture there.

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#125
post #11

I work with React (Next.js) on my main project and while I don't appreciate some things generally I haven't had any issues and Next.js in particular has been great. I also find JSX stellar. I used Vue from 0.12 until around ~2.5, I really liked it at the beginning (coming from a jQuery only world) but I was forced into learning React for React Native and then I kind of standardized on it for a while and Vue fell off.…

Next.js saved me from the mess that was Gatsby and have used it for many projects but these days I find Astro simplifies things even more and has become my go to tool.

what does astro simplify?

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#126

Earlier quoted context omitted.

The guy who created it, Rich Harris, used to work for the New York Times and developed it while he was there. So it's not a big surprise that NYT use it. I'm not sure about many other 'larger news sites' using it, but one place I have seen it out in the wild in a big production app is the Apple Music web app.

How did he managed to push his own framework. I’d love to rewrite the world, that’s so much more fun than converting Json to sql. But it would be a very hard sell to management to write our own framework instead of using something battle tested like spring boot.

Rich Harris did a lot of data viz work (IIRC) during his tenure at the NYT. I don't know if you have experience working with D3 and other template/view libraries but it's always been painful. D3 can also append the dom, so it makes certain parts of the API harder to use. There's also the need to work with large amounts of array values that are uniquely made with D3 (various SVG paths). I can easily see multiple teams adopting it if it makes writing interactive data visualizations that much easier.

Supposedly Svelte is able to do this very well, haven't had the chance to try it with D3 myself.

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#127
post #16

My 2c: I think svelte is overhyped and a poor solution to the problem it's trying to solve. First of all, I am tired of ridiculous metrics like how small svelte is when it's a really small example, and it's one or two lines of initial boilerplate. The thing that really set svelte apart was it's better syntax and experience when it first came out. I think that was when react class components, and vue 2 was still promi…

> I don't even think the dissapearing part about svelte is that important. That kind of performance is rarely going to matter before other bottlenecks. And if it really is that crucial, there's nothing stopping either react or vue 3 from doing something very similar. Vue 3 already has sfc that go through a "compile" process, and it uses getter/setters to make targetted changes.

It matters a lot, especially on mobile phones with less processing power and spotty internet connection.

It's a huge factor, actually. Downloading and parsing React+React-DOM on mobile phones, especially if they are not high end, is miserably slow.

Also, it's not only a user experience problem, your "Google Rank" is influenced by your lighthouse scores.

So I'd argue "that kind of performance" is business critical on several levels. At least in my experience.

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#128
post #3

I've worked with all three frameworks, but as a mostly single dev/engineer I very very much prefer Svelte because it lacks a lot of boilerplate that React has, and it's easier to think about than Vue's clunky way to write variables and functions. But I'm a "hacker type" and don't work in a large tech company. I haven't seen Svelte in any sort of "real tech companies", haven't seen it on job boards, and it doesn't see…

It's a case of "Nobody ever got fired for choosing X"[0]. No one would blame you for choosing React for a major project / new startup, but someone could definitely poke holes in choosing Svelte ("theres no package for X", "it doesn't scale", "we can't find devs that know it", etc.) 0 - https://www.quora.com/What-does-the-phrase-Nobody-ever-got-f...

Nope, dude at my job totally got "laid off" for choosing to write a feature in an ecommerce system in React. He had used it before at a previous job and was familiar with it. Problem was:

- No one else in the team was familiar with React.

- React did not play nice with the rest of the app and developer work flow.

- It was huge and slow

- He didn't know React as well as he thought he did and we had endless bugs.

- He spent ages working on it.

We rewrote in vanilla JS in 4 days - one dev.

And, yeah, effing JS.

Re: Introducing Svelte, and Comparing Svelte with React and Vue (2021)

#129
i would like to read a comparison of the major js frameworks from a practical sense of how they can help me meet deadlines faster, as opposed to developer experience

i'm not that bothered about the various technical trade-offs, i mean they sent a rocket to the moon using assembly language

i just want to know how {newThing} can help me get shit done at work faster with less headaches.

Post reply on HN