Live data from Hacker News

Svelte 5 Released

npmjs.com

231–240 of 254 posts

Re: Svelte 5 Released

#232
post #70

Doesn't the philosophy behind Svelte justify a broader scope than just Web apps? Shouldn't this be a more general programming language, not tied to the web?

It is a popular choice for apps made with cross-platform frameworks like Tauri and Electron. It even powers a big POS device in Brasil.

Re: Svelte 5 Released

#233
post #7

We use Svelte 4.0 in production and it performs beautifully; it rarely is the cause of our frustrations. Excited to try the new version. Lately I’ve also been wondering about the relationship and correlation between software writing skills and writing skills.

Same!

Writing code and writing literature are curiously similar. It begins with thinking, both structured and creatively. Breaking a story down into pieces while keeping the bigger picture, and making a plan for how to approach it. Then comes the difficult metamorphosis where abstract ideas/concepts are turned into concrete words/code.

Good literature/code is concise, expressive, even beautiful. It doesn't come about easily, but takes time. The author reshapes and refactors the text until it meets some standard that the author aspires to, often revisiting it days later to read it with fresh eyes. Then it's committed for review, and may still have to be reworked a bit.

I agree with those who say that coding is more art than engineering. At least if you're really good at it.

Re: Svelte 5 Released

#236

Earlier quoted context omitted.

> vanilla HTML/CSS/JS ...but that's what Svelte is not . The techniques you adopt won't transfer over to vanilla HTML/CSS/JS without the magic Svelte compiler. These habits will become crutch when Svelte inevitably goes the way of every Javascript frontend framework. > something complex like React React is not that complex, certainly not more so than Svelte. It's hard to wrap your head around some behaviors, but at t…

(caution: backend dev opinion) I swear every time I use React, every couple of years, I wind up thinking "okay fine, but... why?" I love JSX. But the React API, for some areas, feels complex and boilerplatey. I dunno why you have to explicitly memoize some stuff. Svelte just magics that shit away.

    > But the React API, for some areas, feels complex and boilerplatey
You may or may not have noticed this, but the React API is a bit counterintuitive to how JS or any other code you normally write would work because the component function gets invoked repeatedly so any code in the path of the functional component that's not externalized into a hook or memoized will be invoked again.

That's also why in local dev mode, you'll see the render cycle executed twice so that you can spot any undesired side effects due to this design choice.

So a lot of the complexity is to deal with this specific design choice to determine when code inside of the component function needs to be re-executed. In React, you need to explicitly opt-out of reactivity while in nearly every other framework, you are opting-in to reactivity.

For me, I've always seen this as the weirdest footgun because it's antithetical to the underlying language and runtime behavior so developers need to be explicitly aware of this behavior.

Re: Svelte 5 Released

#237
post #167

Earlier quoted context omitted.

But didn’t Vue come before React? And it’s mostly the same from what I understand, it’s not totally different like Svelte. I think it can change, if more people put it on their resumes and LinkedIn and if those that know React say can do things in 1/3 the time with Svelte and mention that in interviews as well. That is a slow way of evangelism for Svelte that can spread.

No, react came first. And Vue is not the same. Vue 3 added reactivity via refs (which are essentially signals by today's terminology). They can be used outside of components, like Svelte's runes. Svelte 5 is very similar to Vue 3. So much so I jokingly called it "svuelte" when they first announced it. Vue gets unfairly overlooked imo. I worked with it for 12 months and it was mostly a joy

Looking at the docs, Svelte is a mix of React and Vue, IMO.

They reverted from the `on` syntax while adding in signals like Vue's `ref`. The way the props pass down is more akin to React than Vue, but the overall reactivity system feels the same as Vue.

I'm not sure I'd pick it over either Vue or React.

Re: Svelte 5 Released

#238

Earlier quoted context omitted.

I gave React a handful of year to get popular and mature. I tried to approach it an immediately ran into basically endless arguments and bitching about how to manage state. There was no clear winner so I dropped it. Everywhere I landed trying to find advice or best practices just led to more questions. Like WTF? Svelt, Vue3 or hell...Angular, and it's off to the races. I just need to know how to accomplish all the th…

useState has been present in React for years.

Prop drilling sucks and React has at least a handful of different philosophies when it comes to managing cross-cutting state (Redux, Jotai/Recoil, Zustand, Context, etc.).

Re: Svelte 5 Released

#239
post #167

Earlier quoted context omitted.

But didn’t Vue come before React? And it’s mostly the same from what I understand, it’s not totally different like Svelte. I think it can change, if more people put it on their resumes and LinkedIn and if those that know React say can do things in 1/3 the time with Svelte and mention that in interviews as well. That is a slow way of evangelism for Svelte that can spread.

No, react came first. And Vue is not the same. Vue 3 added reactivity via refs (which are essentially signals by today's terminology). They can be used outside of components, like Svelte's runes. Svelte 5 is very similar to Vue 3. So much so I jokingly called it "svuelte" when they first announced it. Vue gets unfairly overlooked imo. I worked with it for 12 months and it was mostly a joy

I'm only familiar with Angular so far, but looking for a more enjoyable framework for personal projects. I'm having a hard time deciding between Vue and Svelte. Vue seems to be better supported by component vendors (PrimeVue, DevExtreme), but Svelte looks better from a framework perspective itself.

Re: Svelte 5 Released

#240

Earlier quoted context omitted.

I never understood the ecosystem argument as applied to Svelte. Vanilla js libraries integrate with it pretty much perfectly, meaning you don't need a Svelte port of a given library. The ecosystem is effectively huge.

There aren't very many good modern, maintained vanilla js libraries. But for just about anything I need in React I can find something polished and well supported that just works.

I'm not sure I understand. What types of libraries? When I think of libraries, I think of ExpressJS, lodash, JQuery, left-pad, etc. There are absolute tonnes of vanilla JS libraries.

I've rarely used React, are you talking about React-specific libraries? I find it hard to believe that there are more maintained React libraries than vanilla JS libraries.

Post reply on HN