TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Svelte 5 Released

415 pointsby begoon7 months ago

47 comments

levmiseri7 months ago
I can wholeheartedly recommend Svelte. As someone who can only do vanilla HTML&#x2F;CSS&#x2F;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: <a href="https:&#x2F;&#x2F;meoweler.com" rel="nofollow">https:&#x2F;&#x2F;meoweler.com</a>
评论 #41894401 未加载
评论 #41891836 未加载
评论 #41893443 未加载
评论 #41890619 未加载
评论 #41893762 未加载
评论 #41900943 未加载
评论 #41893235 未加载
评论 #41893999 未加载
评论 #41890752 未加载
sansseriff7 months ago
Svelte 5 has been very nice to work with over the past few months. Yes, runes require you to think more carefully about lifecycles and updates. And you may end up writing a little more code initially than with svelte 4. But it serves you better in the long run with complex apps. I found a process for gradually turning a simple app into a more complex one that works for me. I iteratively move $state() runes out of .svelte files and into .svelte.ts files where I build a more abstract data-oriented structure for my app from a series of mutually linked classes. Then those runes can be re-imported into the .svelte files, or used and updated wherever you need. If you plan it right, I think it avoids the need for heavy redux-like state management. (at least I think so. I haven&#x27;t worked with redux much myself)
评论 #41891258 未加载
评论 #41890939 未加载
评论 #41893765 未加载
评论 #41891144 未加载
b3ing7 months ago
Hope it starts to chip into React’s usershare and more companies adopt it, but I know that’s a slow process especially for the big companies.<p>I got out of front end development for most of the years Angular and React have dominated and it looked like a mess, but Svelte and even Astro make sense, maybe I’m just old school. I would totally go back to the frontend with these new frameworks.
评论 #41893840 未加载
评论 #41893278 未加载
评论 #41895751 未加载
zuhsetaqi7 months ago
From the changlog on Github:<p>The new version brings:<p><pre><code> - even better performance, - a more granular reactivity system with runes, - more expressive template syntax with snippets and event attributes, - native TypeScript support, - and backwards compatibility with the previous syntax!</code></pre>
评论 #41889920 未加载
pier257 months ago
I&#x27;ve been using Svelte since v3 was released almost daily. I&#x27;ve been using v5 for the past couple of weeks and it&#x27;s fantastic.<p>The biggest improvement IMO is that you can now write reactive logic intuitively outside your components and it just works without needing to use complex machinery or patterns like Mobx, Redux, or Vuex.<p>I&#x27;ve been doing frontend since the 90s and used everything under the sun. Svelte 5 is the most pragmatic and elegant solution I&#x27;ve ever used.
评论 #41892944 未加载
评论 #41894361 未加载
h_tbob7 months ago
I don&#x27;t understand how React is so popular, still. With Svelte and Vue, I don&#x27;t think anybody should do a new project with React.
评论 #41891956 未加载
评论 #41892093 未加载
评论 #41892799 未加载
评论 #41893733 未加载
评论 #41895645 未加载
评论 #41896081 未加载
simonsarris7 months ago
I <i>love</i> Svelte and use it for all my personal projects and all company projects (except strictly static sites are still built with just 11ty but I hate it and want to move off it).<p>But I&#x27;m going to wait a bit on v5 for the company, scanning all the issue headlines, it looks like there are a still a lot of unresolved edge cases: <a href="https:&#x2F;&#x2F;github.com&#x2F;sveltejs&#x2F;svelte&#x2F;issues">https:&#x2F;&#x2F;github.com&#x2F;sveltejs&#x2F;svelte&#x2F;issues</a><p>As for my latest personal project, upgrading right now so I can help find more of those edge cases :D
评论 #41890321 未加载
评论 #41890161 未加载
评论 #41890438 未加载
评论 #41891804 未加载
WuxiFingerHold7 months ago
Svelte 5 is <i>almost</i> heaven, I thought. But it&#x27;s <i>full</i> heaven.<p>To keep it short: The Svelte team did a remarkable job improving every aspect but preseriving the characteristics and distinctive features (fast, small, easy, elegant).<p>Now, where I struggled (using Svelte 5 on a business logic heavy SPA since RC in April):<p>Signal in general are extremly easy to use, but quite hard to track. You have to &quot;know&quot; or &quot;find out&quot; if something is reactive. Vue makes it easy with their .value API, but also not 100% foolproof.<p>With React: Everything is a value. Unidirectional data flows. It&#x27;s very easy to follow the flow of the data.<p>With Angular: Data pipelines are built using RxJS. Hard to learn, but extremely powerful. You can follow the data flow quite well. Not as easy as with React, but once you are good with RxJS, still easy enough.<p>With Svelte 5: Runes look like values. This mental model is good enough most of the time. It&#x27;s especially great in small contexts where you exactly know where your variable comes from or where everything is reactive. But Runes also behave like signals and proxies. So, you sometimes need to know exactly what is in your bag. Is it a value? A signal ($state with value or $state.raw with object or array)? A proxy ($state with array or object)? In larger contexts it gets really hard to track.<p>Why is Svelte still <i>full</i> heaven to me: I realized that Runes are just the basic building blocks. They are the common basic toolkit. I don&#x27;t have to use them in large business logic areas of my apps. I can create (nominal typed, using TS of course) custom wrapper classes, e.g. to only allow signals, not proxies. This wrapper classes could disallow mutation. Passing those around makes it type safe. If I see a value, it is a value. If I see a type of my reactive wrapper class, it is reactive. Or, I can use RxJS and Svelte 5. Or I can mimic Vue&#x27;s or Solid&#x27;s APIs (as Rich showcased).<p>There&#x27;s a spot in the new docs (wip) where the Svelte team is going to explain Runes. I think they&#x27;re also (as other Signal experts - I hope Prof. Signal Carniato solves this for all of us :-)) working on better debugging tools.<p>I&#x27;m happy.<p>Big thanks and respect to the Svelte team.
评论 #41893483 未加载
dvrp7 months ago
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.<p>Lately I’ve also been wondering about the relationship and correlation between software writing skills and writing skills.
评论 #41890750 未加载
评论 #41907020 未加载
评论 #41891837 未加载
评论 #41890202 未加载
codeflo7 months ago
Someone on Twitter claimed that Svelte 5&#x27;s runes are basically a nicer (custom) syntax for Solid.js -- is that true? I find the way Solid.js decouples signals from components to be a huge step up from React&#x27;s state management in terms of abstraction capability and composability.
评论 #41891393 未加载
评论 #41891147 未加载
clessg7 months ago
Exciting, I love Svelte! Does anybody have experience with both Vue and Svelte? It&#x27;s been a while since I used Vue but it seems like both frameworks have converged quite a bit over the years. With this release I&#x27;m particularly curious now: why would somebody pick one over the other?
评论 #41920974 未加载
评论 #41891677 未加载
Squarex7 months ago
What&#x27;s the preffered way to make simple SPAs using Svelte now? I&#x27;m using this +layout.ts with sveltekit: &gt; export const ssr = false; export const prerender = false;<p>But it feels awkward for real SPAs - internal applications that have no need for server side rendering.
评论 #41891738 未加载
评论 #41890358 未加载
评论 #41890328 未加载
评论 #41890361 未加载
评论 #41897256 未加载
taikahessu7 months ago
Full v5.x changelog: <a href="https:&#x2F;&#x2F;github.com&#x2F;sveltejs&#x2F;svelte&#x2F;blob&#x2F;main&#x2F;packages&#x2F;svelte&#x2F;CHANGELOG.md">https:&#x2F;&#x2F;github.com&#x2F;sveltejs&#x2F;svelte&#x2F;blob&#x2F;main&#x2F;packages&#x2F;svelte...</a>
codelikeawolf7 months ago
This really made my day. I decided to convert a pretty large project over to v5 a couple of months ago because the new APIs were so much nicer. I rolled the dice a bit because I wasn&#x27;t sure if I was going to hit weird edge cases, but everything went smoothly. Congrats to the Svelte team and major kudos for coming up with runes!
gfs7 months ago
Where would one even start learning more about front-end development in today&#x27;s world? Ignoring the dizzying amount of frameworks, how could I become knowledgeable enough to connect my back-end experience to design the &quot;full stack?&quot;
评论 #41890172 未加载
评论 #41890993 未加载
评论 #41890188 未加载
评论 #41890130 未加载
评论 #41890154 未加载
评论 #41894600 未加载
评论 #41891656 未加载
评论 #41892163 未加载
评论 #41890215 未加载
sureIy7 months ago
Unpopular opinion: Svelte 4 was much better. It was truly invisible and it used basic JS syntax to do what you wanted. Now runes ruined it.
评论 #41906659 未加载
sureglymop7 months ago
When I recently looked at SvelteKit, what confused me the most was the universal load function.<p>If you use &quot;if !browser&quot; with sveltes browser object, the things inside that branch will only run on the server.<p>But because svelte is compiled, these functions get compiled to two different versions, one for the server and one for the client, in which that if statement has been completely compiled out. That in itself isn&#x27;t bad but it&#x27;s weird that normal code and control flow influences compilation. In other languages this would be a macro or something that clearly expresses that it&#x27;s metaprogramming.<p>Then there are some other weird things like props being merged and potentially overwriting each other in a deep level. But that is by design and can be reasoned about.<p>What also felt weird to me is that there is no recommended way to do initialization logic such as reading in a config, reading from the environment and preparing something for the rest of the lifetime of the application.<p>Has anyone had similar experiences&#x2F;confusions when learning SvelteKit?
评论 #41893882 未加载
评论 #41893139 未加载
yawnxyz7 months ago
Is there are Svelte 5 Runes tutorial for those who are familiar with previous Svelte and Sveltekit?
评论 #41890905 未加载
评论 #41891525 未加载
评论 #41890871 未加载
notpushkin7 months ago
Good work! I’m not really sold on the runes stuff though (tldr: <a href="https:&#x2F;&#x2F;svelte.dev&#x2F;blog&#x2F;runes" rel="nofollow">https:&#x2F;&#x2F;svelte.dev&#x2F;blog&#x2F;runes</a>)<p>The old way is a bit “magical” in a sense that it does some stuff under the hood to implement the intention behind your code, but it reads really straightforward:<p><pre><code> let counter = 0; &#x2F;&#x2F; ... &lt;div&gt;{counter}&lt;&#x2F;div&gt; </code></pre> `let` in a .svelte compoment makes a variable reactive. If your state is outside a component, you use stores.<p>With the `$store` rune, the way you make reactive stores inside and outside components is the same, <i>but</i> it only works in .svelte.js&#x2F;ts. The unification is great – but why not just use `let` in .svelte.js, too?<p><pre><code> &#x2F;&#x2F; counter.svelte.js export function createCounter() { let count = 0; return { get count() { return count }, increment: () =&gt; count += 1 }; } &#x2F;&#x2F; App.svelte &lt;script&gt; import { createCounter } from &#x27;.&#x2F;counter.svelte.js&#x27;; const counter = createCounter(); &lt;&#x2F;script&gt; &lt;button on:click={counter.increment}&gt; clicks: {counter.count} &lt;&#x2F;button&gt; </code></pre> I understand it can be really tricky – e.g. you might want to use let for things that are not modified in runtime and do not need reactivity, but it should be possible to determine in compile time. (Actually after writing this all up I think I know why Svelte went with runes instead, haha!)<p>But again – really good work and I hope to try it out on my next project!
评论 #41891025 未加载
评论 #41890504 未加载
k__7 months ago
Finally.<p>Runes are a pretty slick addition, as someone who comes from React, this feels like home.
dvrp7 months ago
Blog post will be published on Monday:<p><a href="https:&#x2F;&#x2F;x.com&#x2F;Rich_Harris&#x2F;status&#x2F;1847682508822913359" rel="nofollow">https:&#x2F;&#x2F;x.com&#x2F;Rich_Harris&#x2F;status&#x2F;1847682508822913359</a>
jauntywundrkind7 months ago
From listening to webdev podcast #1, Syntax.fm, the gist I get is that a lot of what used to be invisible compiler magic is now more visible &amp; explicit.<p>The compiler user to rewrite property access to make reactivity happen. Now you can kind of see yourself updating &amp; reading&#x2F;reacting as you sprinkle runes in. Implicit to explicit magic, with Runes as the headline demonstration of that. Other examples very welcome!
KaoruAoiShiho7 months ago
Considering trying out Vue or Svelte after working with React (hate react). Do they have a batteries included bootstrap with social auth?
评论 #41892115 未加载
评论 #41891842 未加载
russellpekala7 months ago
If you like Svelte, Yuzu Health is hiring developers to work in Svelte in New York City. <a href="https:&#x2F;&#x2F;yuzu.health&#x2F;careers&#x2F;senior-software-engineer" rel="nofollow">https:&#x2F;&#x2F;yuzu.health&#x2F;careers&#x2F;senior-software-engineer</a><p>Seems like the number of companies using Svelte in production is growing but still not super high.
评论 #41892449 未加载
adamnemecek7 months ago
I learned Svelte 3 over a year ago and I found it very pleasant. Unlike React, Svelte is an integrated framework, no &quot;pick your router&quot; nonsense, I don&#x27;t want to be picking a router.<p>I like the direction Svelte going in, the old syntax was ok but not great.<p>I wonder how this new Svelte compares with some of the other new kids on the block like solid.js and alpine.js.
评论 #41890000 未加载
impulser_7 months ago
Why should someone use Svelte 5 over Vue 3?<p>Performance might be the only reason IMO, but once Vue Vapor is release that will most likely not be an advantage.<p>The Vue3 and Svelte 5 API are almost the exact same, but Vue can be used in TS&#x2F;JS and Svelte 5 can&#x27;t.<p>I do think SvelteKit is better than Nuxt by a lot. Maybe that&#x27;s a big advantage.
评论 #41891256 未加载
评论 #41891663 未加载
评论 #41892984 未加载
nzoschke7 months ago
Congrats. I discovered Svelte through the 5 RC and immediately fell in love.<p>I’m in the process of porting an HTML audio and Spotify Web Playback music player to Svelte5 and it feels so clean and productive.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;nzoschke&#x2F;jukelab">https:&#x2F;&#x2F;github.com&#x2F;nzoschke&#x2F;jukelab</a>
frio7 months ago
This is fantastic news. Between the Svelte 5 RC and Deno 2, I’ve been really enjoying working with the JS&#x2F;TS ecosystem for the first time in a long time — it’s just been vaguely difficult keeping up with the (minor) tweaks in the RCs along the way. Congratulations to the team :).
joshdavham7 months ago
Since we&#x27;re all here: what UI libraries are y&#x27;all using in your SvelteKit apps?
评论 #41891881 未加载
评论 #41891872 未加载
stormfather7 months ago
An interesting datapoint:<p>I made my first website a few months ago (I&#x27;m an ML engineer). I tried in both Svelte and React.<p>I used Sonnet as a copilot the whole time and expected Svelte to be more difficult because there are orders of magnitude less training data on it.<p>To the contrary! The LLM tied itself in knots very quickly with React but mostly did ok with Svelte&#x2F;Sveltekit. Also, the Svelte stuff it makes is usually snappier. However it does have a wider range of UI widgets it can grasp with React.<p>It seems that my opinion that React is horrendously and hideously overcomplicated is at least somewhat objective! Svelte has been quite pleasant.<p>To any devs out there that have to work with React, you have my sympathies. Compared to Svelte it&#x27;s just flaming hot putrid garbage.
评论 #41890838 未加载
评论 #41891113 未加载
bippihippi17 months ago
can I do async derived stores by default yet? It was kinda tricky to get working in svelte 4 and even Square&#x2F;svelte-store wasn&#x27;t super ergonomic. Would be super nice if it was built in
评论 #41936522 未加载
gumbul7 months ago
Do they still operate with very little backwards compatibility policy? They killed the sapper project and replaced it with sveltekit. Is sveltekit still alive?
评论 #41890448 未加载
评论 #41890820 未加载
评论 #41891596 未加载
ChocolateGod7 months ago
Been using Svelte for about 8 months and have fallen in love with it, using it in production for both personal and company projects.<p>My only gripe is it doesn&#x27;t support &lt;template&gt; tags or class list arrays out the box, meaning I&#x27;ve had to use preprocessors instead, the latter for me makes it far nicer to mentally visualise components when using dynamic tailwind classes.
manishsharan7 months ago
Svelte vs React is discussion that will never end.<p>For those of us who do not like to code complex logic and state in javascript, I can recommed htmx <a href="https:&#x2F;&#x2F;htmx.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;htmx.org&#x2F;</a>. Also, I am more comfortable writing backend code and this just fits my style better.
stevev7 months ago
I love Vue. Svelte is great! Unfortunately nothing beats react especially if one plans to develop for mobile. Despite how ugly the nuances in react are compared to those two, it’s still more mature making the other two trying to catch up and feel outdated in terms of features.
fold_left7 months ago
I&#x27;m curious what users of Svelte think about <a href="https:&#x2F;&#x2F;qwik.dev" rel="nofollow">https:&#x2F;&#x2F;qwik.dev</a>, have many of you been tempted by it? There are a lot of similarities and both are great at keeping file sizes down with a great DX.
评论 #41894073 未加载
iamkneel7 months ago
The blog post is up: <a href="https:&#x2F;&#x2F;svelte.dev&#x2F;blog&#x2F;svelte-5-is-alive" rel="nofollow">https:&#x2F;&#x2F;svelte.dev&#x2F;blog&#x2F;svelte-5-is-alive</a>
solatic7 months ago
Svelte noob here: can someone more experienced explain why runes are getting people excited? My untrained eye starting reading the Svelte runes documentation and it just made me go &quot;well I guess Svelte is getting React Hooks?&quot;
izackp7 months ago
My first web project was with svelte.<p>Lack of a debugger for the server sided JavaScript seems just as silly to me as server sided JavaScript. I would consider that alone a non-starter.<p>I’d recommend another solution for experienced devs.
amelius7 months ago
Doesn&#x27;t the philosophy behind Svelte justify a broader scope than just Web apps?<p>Shouldn&#x27;t this be a more general programming language, not tied to the web?
评论 #41906751 未加载
beginnings7 months ago
all the big frameworks bar react are switching to the solid model of signals and fine-grained reactivity<p>people would be better off just using the real thing, Solid
tamimio7 months ago
Is there any svelte components or better a full boilerplate&#x2F;template to save the time building front-ends?
ledgerdev7 months ago
What&#x27;s the latest on building PWA&#x27;s with Svelte&#x2F;Kit 5?
crowdyriver7 months ago
nice and everything, but it still has plenty of performance issues and crashes with the tsserver. Using solid start because of that, tooling is not there yet.
kolanos7 months ago
Any recommendations for component libraries for Svelte?
评论 #41891664 未加载
neontomo7 months ago
any sense in porting a v4 project to 5?
purple-leafy7 months ago
Svelte. Interesting framework, I dipped into React then tried Svelte and loved it initially - very noob friendly.<p>I really liked having HTML&#x2F;CSS&#x2F;Js all in one place.<p>But then tailwind became popular, and I realised I could get this same UX with React + Tailwind.<p>Now I prefer React + Tailwind to Svelte.<p>No Svelte jobs, weird compiler magic. Hated SvelteKit
评论 #41900162 未加载