Live data from Hacker News

Svelte 5 Released

npmjs.com

211–220 of 254 posts

Re: Svelte 5 Released

#211
post #202

Earlier quoted context omitted.

> As a programmer, I want to spend most of my time programming in a programming language If your work requires you to use a web stack, this attitude will not serve you well in the long run. If you make the effort to learn these technologies, you'll soon find them to be simple and predictable, but admittedly not without some historical baggage. You may even have an easier time with Svelte, since it has everything work…

Not sure about this. Most JS frameworks only last a few years before the next shiny is mass adopted. The churn in JS land is insane. React is definitely one of the long beards though, and thats’s because declarative programming is a win for UIs IMO. So much so it had a massive knock on effect in popularizing this approach (what’s old is new again… and again) across languages and problem sets.

IMO we're long past the churn era - Svelte itself is 8 years old. There are occasional bursts of new frameworks and tools, but only when there is a new niche - the last one I remember was a few years ago when suddenly everyone wanted to do a static website generator. And that didn't make existing frameworks obsolete.

In my post I was actually speaking about learning CSS and HTML alongside the "real programming language" that is JS/TS.

Re: Svelte 5 Released

#212

I can wholeheartedly recommend Svelte. As someone who can only do vanilla HTML/CSS/JS, it lets me build projects quickly and efficiently without having to learn something complex like React. Case in point this silly side project made in Svelte over a weekend: https://meoweler.com

I went with Svelte when I built out the website for my canvas library a few years back[1]. It's proved to be easy to maintain the site, and I particularly like that it supported my vanilla JS library (which I use on the site's landing page) with minimal fuss. At some point I want to update the site to use Sveltekit, which I'd been experimenting with in personal projects. But then the team announced Svelte 5 and these…

It's funny because very early on the key selling point of Svelte was that you just mutate objects and it compiles to the observable pattern, unlike React's clunky setState syntax. Now, somehow magic symbols in the code is supposed to be an improvement? It doesn't seem that different from React's magic hooks these days.

Is there some mysterious force of nature that binds front-end frameworks to bad decision making?

Re: Svelte 5 Released

#214
post #98

I don't understand how React is so popular, still. With Svelte and Vue, I don't think anybody should do a new project with React.

There was a sweet spot in the past when React was actually simple and clean.

I really do want to escape it these days but quite frankly every frontend framework is the same and they are just shitty in different ways, not really better than React.

Re: Svelte 5 Released

#215
post #98

I don't understand how React is so popular, still. With Svelte and Vue, I don't think anybody should do a new project with React.

I'm building a React app from scratch and since I have control this time, I'm following a strict pattern: all data manipulation (∆) happens outside of React components, and the components themselves are as lightweight as possible. I feel like this change suddenly makes everything about the React paradigm make sense - it can be just a view layer, and when used that way, it works great. But I can't say I've ever worked…

Haha, reminds me of 20 years ago when someone said they are building a PHP app from scratch and this time they won't have HTML, business logic and SQL all in one .php file. We learn as we go ;)

Re: Svelte 5 Released

#216
post #98

I don't understand how React is so popular, still. With Svelte and Vue, I don't think anybody should do a new project with React.

I'm building a React app from scratch and since I have control this time, I'm following a strict pattern: all data manipulation (∆) happens outside of React components, and the components themselves are as lightweight as possible. I feel like this change suddenly makes everything about the React paradigm make sense - it can be just a view layer, and when used that way, it works great. But I can't say I've ever worked…

My React fomula is React + MobX, keep the hook use to minimum, single state object per component (the classic React way), do not bother with server components at this point, you should be fine.

Re: Svelte 5 Released

#217

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…

> It's hard to wrap your head around some behaviors I've got a React maintenance and development project coming up in a few weeks. I'd love if you'd expand a bit on these points and maybe point to some relevant docs. You could potentially save me days or more of tail chasing. Thanks.

The biggest thing most people don't understand is that React re-renders recursively by default, regardless of whether any particular child component's props actually changed or not. Most of its behavior patterns follow from that one.

I have an extensive post called "A (Mostly) Complete Guide to React Rendering Behavior) that covers the concepts and nuances in detail:

- https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-...

Re: Svelte 5 Released

#218

Earlier quoted context omitted.

> As a programmer, I want to spend most of my time programming in a programming language If your work requires you to use a web stack, this attitude will not serve you well in the long run. If you make the effort to learn these technologies, you'll soon find them to be simple and predictable, but admittedly not without some historical baggage. You may even have an easier time with Svelte, since it has everything work…

> If your work requires you to use a web stack, this attitude will not serve you well in the long run I disagree. A "web stack" is outdated quickly, but the language remains mostly the same, as does my data. React lets me express most things naturally as forward data transformations, without entangling me too much to peculiar toolchain that will become obsolete and break absolutely everything. > You may even have an…

>Sure, you'll have an easier time making decisions if someone else makes them for you.

You're comparing two tools that are both at the top of a very tall stack of pre-made decisions.

Re: Svelte 5 Released

#219
post #212

Earlier quoted context omitted.

I went with Svelte when I built out the website for my canvas library a few years back[1]. It's proved to be easy to maintain the site, and I particularly like that it supported my vanilla JS library (which I use on the site's landing page) with minimal fuss. At some point I want to update the site to use Sveltekit, which I'd been experimenting with in personal projects. But then the team announced Svelte 5 and these…

It's funny because very early on the key selling point of Svelte was that you just mutate objects and it compiles to the observable pattern, unlike React's clunky setState syntax. Now, somehow magic symbols in the code is supposed to be an improvement? It doesn't seem that different from React's magic hooks these days. Is there some mysterious force of nature that binds front-end frameworks to bad decision making?

I haven’t had the chance to use Svelte in even a semi-serious project. From what I’ve tracked, Runes allow for better handling state complexity and allowing finer grained explicit control of reactivity.

Maybe you don’t need that. Seems like a bunch of the Svelte community did. I wouldn’t frame that as a bad decision.

Re: Svelte 5 Released

#220
post #23

What's the preffered way to make simple SPAs using Svelte now? I'm using this +layout.ts with sveltekit: > export const ssr = false; export const prerender = false; But it feels awkward for real SPAs - internal applications that have no need for server side rendering.

Also how can we hit back button and keep scroll position? I tend to write pages that scroll to top and make ajax calls. The Sveltekit site does it correctly.
Post reply on HN