Live data from Hacker News

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

joshcollinsworth.com

81–90 of 213 posts

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

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

Re: Sapper -> Sveltekit, you might say the same thing for React Router users who adopted Reach-router, back to react-router and are now on remix-router or next.js router. Also I found it weird that you mention Evan You WRT vite as a counter to why Rich might be up against stronger devs, but Rich made rollup, which was foundational to Vite's bundling.

I don't doubt Rich Harris' skills as a developper. But project governance is very different from have strong technical skills. Things like communication, prioritizing features important for the community, dealing with idiots way beyond when it stops becoming fun, gathering money, writing good documentation, etc.

Rollup is cool, but it's a very different beast from a f/e framework. For a lot of projects, migrating from rollup to webpack might be a few hours or a week. Migrating from svelte to react, is months if not many man-years.

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

#82
post #7

I'd really like to hear more from Svelte devs about what non-happy paths look like. I specialise in React.js and there are any number of escape hatches to make sure you can get something working just the way you want. What I fear about Svelte is getting to 95% complete and finding the one obscure thing a stakeholder will not budge on is not possible.

Using Svelte for a quite large codebase.

Couple years ago, there was lot of hiccups especially with TS support or the vscode plugin. It's much better now.

There are some patterns to know to work around some reactivity issues with component reuse but overall, and still some TS issues with vscode (extra warnings due to lack of understanding of component context) but it's still ok.

The biggest drawback of Svelte is not the tech itself, but the lack of a well developed ecosystem of components, design systems, etc. You'll probably end up implementing many components yourself... whether it's a good thing is left for discussion.

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

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

What's wrong with Svelte or SolidJS for "big things"? Do they limit scalability in some way?

Mainly that the eco system is smaller. This means fewer third party libraries, fewer people who know it already, and fewer articles online about how to solve specific problems.

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

#84

Is anyone writing svelte in emacs? How's the tooling there? I'd like to know if it's good enough.

web-mode supports .svelte files (provided you add the engine to the alist). I haven't made anything too complicated with it but it seems to do the trick.

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

#85
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 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. There is nothing ridiculous about it. Svelte has a tiny* runtime library by design, so naturally the code output will be much smaller. Also as a result of its design, you do end up writing less lines of code. > That kind of performance is rarely going to matter before other b…

Svelte absolutely has a runtime, with the two most crucial components being the scheduler and the lifecycle manager. It still comes in a lot lighter than React.

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

#86
I do like working with Svelte, but the most pleasant developer experience I've had in JS has been in Mithril.js with it's small and easily understandable API. I don't understand why there's not a bigger ecosystem and traction around that.

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

#87

Earlier quoted context omitted.

"Nobody ever got fired for X" is a rhetorical device which means "in most situations, you generally won't be faulted going with the most main-stream option on the market".

To be fair, as frustrating as it is sometimes for those of us who want to use the best tool, for those who have jobs affected by the risk in their decisions, it's a sound principle to default to.

I think the nuance is that much of the IT world moves much, MUCH slower than the web frontend.

"Nobody ever got fired for choosing IBM/AWS/Google/Microsoft/ESRI" will culturally last a loooooong time (5-10 years? 15?)

"Nobody ever got fired for choosing jQuery? Angular? React? Vue? Svelte? NPM? Yarn? Node? Deno? Next? Gatsby? Netlify? Webpack? Parcel? Babel? Bun? Canvas? WebGL? WASM? Workers? Cloudflare? Fly? Leaflet? OpenLayers? Mapbox?"... that has what, a lifespan of 2-3 years at best?

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

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

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

#89
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 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. There is nothing ridiculous about it. Svelte has a tiny* runtime library by design, so naturally the code output will be much smaller. Also as a result of its design, you do end up writing less lines of code. > That kind of performance is rarely going to matter before other b…

> While Svelte uses a (tiny) bit of custom syntax, React makes you bring in a ton of DSLs. Hooks, the component lifecycle, and all the third party libraries you will need to build a functional app require a lot more effort. People forget just how much stuff they had to learn.

I don't disagree with this, but people unfairly complain about it anyway, and it's another roadblock in the adoption process that makes it less exciting to fight for.

> and nested components hundred-levels deep, and you start noticing slowness, performance optimization is a gigantic effort.

That right there is the problem. The DOM is optimized for something like 32 levels of depth which is also the standard used for lighthouse scores. It's always possible to go over that, a little bit, but hundreds? At that point, it's not a question of svelte vs react, but really advanced dom (if even that) manipulation.

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

#90
post #26
post #23

Earlier quoted context omitted.

Do you mean .value when writing a component that's some sort of form field? How do you refer to that value in Svelte components? edit: oh nvm, we haven't upgraded our codebase to Vue 3 yet, there are a lot more ".value"'s if you click through to the Vue 3 examples in the original post.

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`...?
Post reply on HN