11 ms·
Svelte 5 is going to be radical
- smrtinsert 3y agoThere's no ignoring svelte despite a lot of devs pushing back against it due to years in React and "existing resources and community". The performance is superior and that will drive adoption. It's a much better development experience. Sort of feels fun again.
- Takennickname 3y agoI think the future is frameworks like Astro that allow you to use any library you want. That'll make the most sense until someone comes up with a new paradigm all together.
- 65 3y ago> until someone comes up with a new paradigm all together. Like Bun?
- postalrat 3y agoIf react can get server components to work then it will be going in a completely different direction. React as your connection to the server.
- chrisco255 3y agoConfused about your comment, they already work.
- Zealotux 3y agoPerformance is never what drives adoption of general solutions like front end frameworks, developer productivity is way above that as a metric and yeah: React having a massive ecosystem is it’s killer feature. Trust me, I wish we could move one from React for something more reasonable like Solid or Svelte, but no amount of benchmark will change the trend. Feels like Twitter is living in a parallel universe.
- baby 3y agoWhy don’t you move to Vue/Nuxt? I’ve made the move years ago and I’m happy
- SkyMarshal 3y agoI’ve just started learning Svelte for a side project, but I think you can make an argument for developer productivity with it too. React doesn’t have a monopoly on that.
- lolinder 3y agoCould you make the argument, then? How does Svelte make up for the massive ecosystem gap?
- azangru 3y agoWhat if you don't need a massive ecosystem? For example, the project I am currently working on has (checks package.json) react-router, react bindings for redux, and react-spring (the latter could easily be dropped; it is almost not used). Plus Storybook, but that's not even react-specific. That's all.
- lolinder 3y agoThe ecosystem is more than the libraries. Do you use the VS Code or WebStorm integrations? Do you use one of the many options we have for bundlers and dev servers? Do you use the browser dev tools? Svelte has to recreate plugins for all of these things and more. I haven't yet tried Svelte (I'm waiting for Svelte 5), but the tooling needs to be at least comparable to Vue's if I'm going to consider adopting it.
- robertoandred 3y agoIf you run into performance issues with React it's a code issue.
- bastawhiz 3y ago> The performance is superior and that will drive adoption This has never been true. Nobody adopts React in 2023 because it's the fastest (as in performance) option. Other frameworks have been far faster for the better part of a decade. Why would shaving a handful of milliseconds here and there change the game now? People choose React because you could have gone from 0.15 to 18.0 with maybe a week of effort, often less. It has escape hatches where they're needed. Almost every tool you could need works with React. There's essentially nothing that you can't accomplish with React as the foundation. Nobody has gotten fired for choosing React.
- doodlesdev 3y ago> People choose React because you could have gone from 0.15 to 18.0 with maybe a week of effort, often less. That's only if you are not using other libraries, otherwise it will take much more time than that and the upgrade would very likely require you to rewrite your components as functions which will be a massive undertaking, specially for larger codebases which already made extensive use of OOP patterns to keep code modular. It's even worse if you consider that React is unusable for most projects without a lot of associated tooling that also faces breaking changes often (i.e. your build tooling, your CD/CI environment and deploy workflow, etc.). In reality React is anything but stable, it has in 10 years faced multiple paradigm shifts in terms of development experience, had most of its codebase changed or refactored multiple times, etc. > Nobody has gotten fired for choosing React. This is an (unfortunately) very true piece of wisdom which I have to agree with.
- pcthrowaway 3y agoI spent a couple of days trying to migrate a react app at v17 bootstrapped with create-react-app to v18 and Vite, but eventually gave up because all the tooling and libraries and deployment processes needed attention along that migration path. I'd be very surprised if 0.15 to 18.0 could be as seamless as you claim, for a real production application with hundreds of components and a few dozen dependencies
- ttfkam 3y agoWhile yes, Svelte is faster out of the box than React, that's not its main draw in my opinion. When you learn React, you learn React's idioms, its methodology, the common component libraries, etc. You learn its API and patterns. Svelte follows the patterns established by HTML and CSS, and builds upon them. If you know how to write static HTML, you will already be familiar with the structure of a Svelte component. If you know CSS, the <style> tag in Svelte is natural to you (except that CSS styles are scoped to component by default, so it's actually easier than plain CSS). For the JS, you don't have to research to find out what the hot client state management tool of the week for React is. You don't have to worry about useState vs useEffect vs useMemo. You don't have to worry about how to integrate with a reactive library like rxjs. You just write what looks like plain JS + things like "$:" and "$store", and you're done. Developer performance is what matters most here. React has an advantage for now due to a decade of inertia, but folks coming up who don't already know React or folks who are feeling burned out by React due to huge transitions like classes-to-functions? They're the target audience who's gonna try Svelte and realize they've been living with Stockholm Syndrome for a while now. Things like useMemo(…) are abstraction leaks. They are mental overhead and boilerplate over and above the actual problems people are trying to solve. Gimme someone with HTML/CSS knowledge and basic JavaScript skills, and I'll deliver a viable Svelte developer in a day or two. That's something React cannot match and will never match. Will React disappear? Of course not. Even COBOL is still in use. No one's dumping React and a large codebase on a whim. But when more folks realize they can use GridJS and ChartJS and other vanilla JS libraries out of the box with Svelte without an elaborate stack of bespoke wrappers to make them work, React's ecosystem will not seem quite so rich in comparison. Folks writing for greenfield are gonna think twice about React.
- Rapzid 3y agoOr people believe yet another language and compiler is the wrong direction. Same with React's skunkworks compiler project. SolidJS has shown what can be done performance-wise without all that nonsense. And Mobx+React/Vue is quite performant. Also, switching costs are incredibly high.
- ttfkam 3y agoSolidJS is currently faster at runtime. Not sure it could beat Svelte at developer time. And with the reported speed improvements in Svelte 5 (waiting to see how those bear out in the real world), the difference isn't going to be how fast in runs in your browser; it'll be how fast you can go from a blank IDE text window to a user's browser. let features = 0; let people = 1; $: featuresPerPerson = features / people; function addPerson() { people++; } function addFeature() { features++; } Folks might consider it magic, but it's a lot closer to our mental model of the problem than anything SolidJS can give. As for "magic", we're working with sand we shot with lightning to make it think. If you don't like magic, you're in the wrong vocation. The only question is whether or not the magic is useful, predictable, and reliable. I consider Svelte to be that right kind of magic.
- chrisco255 3y agoWhen building nontrivial applications, I don't want my UI framework to be radical from version to version. Performance improvements are great and all but if radical means substantial change to the design, an upgrade amounts to a rewrite.
- gjsman-1000 3y agoNo kidding. I'm literally back to just generic server-rendered templates wherever I can get away with it. I don't want to fix UI code, ever, whenever I can help it.
- alternatex 3y agoWhich one do you use? All of them went through breaking changes. Also, I'm pretty sure "radical" was referring to the performance improvements, not API/syntax change. Svelte has very simple syntax, there isn't much you can change.
- deleted 3y ago[deleted]
- spankalee 3y agoIt would be radical to use standard JS and not require a compiler. Let's hope!
- simonbarker87 3y agoNo change between a v4 and v5 should be “radical”. Sure make changes, even breaking changes but “radical” does not inspire confidence that the migration will be straightforward or that the people running the project have any respect for what users have already built. I hope this is just Rebase style hype and that in reality the changes are more measured than implied here.
- bastardoperator 3y agoGiven a version number MAJOR.MINOR.PATCH, increment the: MAJOR version when you make incompatible API changes <-- You are Here MINOR version when you add functionality in a backward compatible manner PATCH version when you make backward compatible bug fixes
- simonbarker87 3y agoNot disputing you can have breaking changes. Radical implies Angular v1 to v2 types changes, which was disastrous for a lot of people who had built large complex apps on v1 that then had to be maintained for years because a v2 rewrite was too big.
- Raed667 3y agoI get the flex. But for the kind of application I'm building professionally, updating thousands of rows is hardly a concern. I spend most of my time thinking about state and data lifecycle. It has been a while since a framework actually slowed me down enough for me or my users to notice.
- azemetre 3y agoSvelte 4 was recently released (like 2 months ago), and Svelte 5 is already being primed. I wonder if these types of messaging/marketing hurt adoption? If you're looking for something stable and you see large version changes, why would you adopt it? You'd think with all the react misfires over the last year (telling the community common of useEffect is wrong, server components landing flat, poor performance) that the community would be open for adopting something new like solid, svelte, vue, or hell even htmx; but react still climbs in usage rates. If you're working on an average crud app and just need something to handle an SPA why would you choose svelte? In less than a year there's breaking changes, now add another potential one. I want to say this hurts optics more than it helps, because I know my coworkers at boring enterprise company will just say it's unstable. It doesn't matter how performant it is, it doesn't matter how similar to react/vanillaJS it is; all they see is a library with massive changes that breaks compatibility and fractures what little 3rd party libraries there are, doesn't matter if this argument is right that's the perception. So we decide to do another project in react and the world continues turning. I think I'm understanding why htmx is becoming popular...
- yewenjie 3y agoSvelte 4 was just a maintenance release (also after a couple of years of Svelte 3) to smooth-out the way to Svelte 5.
- lolinder 3y agoBut why did Svelte 4's maintenance changes need to be a major version bump? Why not make the changes as minor version changes to Svelte 3, then bundle all breaking changes into Svelte 4?
- lol768 3y agoBecause major version bumps are 'sexy' nowadays. Have you seen the insane abuse that the Chrome (and later, Firefox) teams have subjected their version numbers to? In the first ten years Firefox existed, it went from version 0.1 to version 5. They're completely meaningless concepts now. It is ludicrous we are now on major version >100 for both browsers!
- tedunangst 3y agoLooks like vanillajs is the winner.
- azangru 3y agoVanilla js is always the winner. Question is though, how many of us are good enough to write vanilla the way that it stays the winner.
- tedunangst 3y agoYes, I would think a framework that cares about performance would include optimizations that are too difficult or tedious to perform by hand. It should be faster than vanilla js.
- ttfkam 3y agoSvelte works quite well with Vanilla JS libraries. https://hackmd.io/@roguegpu/r1RKQMdt3 https://hackmd.io/@roguegpu/r1RKQMdt3
- adonig 3y ago[dead]
- teucris 3y agoI’m anticipating something that pushes Svelte more into the “language” category Rich has talked about before: https://gist.github.com/Rich-Harris/0f910048478c2a6505d1c32185b61934 https://gist.github.com/Rich-Harris/0f910048478c2a6505d1c321... Putting perf aside for a moment, I think the way svelte components are defined is a superpower, and more compile-time ergonomics like that could really differentiate Svelte.
- toastercat 3y agoI like Rich and his work in general, but he really tends to sniff his own farts sometimes. This is definitely one of those examples.
- teucris 3y agoThat gist I linked definitely doesn’t smell like a fart to me.
- toastercat 3y agoWhat I mean by that is that it reads a little egotistical/self-absorbed, but a lot of JS thought leaders who push a big framework do the same thing. There are definitely worse offenders in this realm though.
- rich_harris 3y agoAlright, since HN is doing its tedious grumpy-old-man thing, let me just spell this out: Your old Svelte components will continue to work. There'll be some 'breaking changes' in the persnickety semantic versioning sense, but migration will be smooth. It's a big priority for us. But the thing you'll be able to easily and incrementally migrate _to_? It's radical. I'll get off your lawn now.
- colesantiago 3y agoHey Rich, Will Svelte or Sveltekit get incremental builds like NextJS?
- swyx 3y ago(am not rich, just giving thoughts on why i disagree with the premise of the question) incremental build is a static site concern and i think its pretty clear the industry has more or less given up on that as a scaling strategy for websites in favor of serverless/edge rendering (which you can blend with static generation to get almost the same thing as incremental builds)
- rich_harris 3y agoAs swyx said, it's probably not a priority for us. You can basically get the same benefits by using Incremental Static Regeneration, which is turnkey if you're using Vercel (not through any tight framework<->platform integration, but rather because the platform offers the feature and the Vercel adapter exposes it — any other platform could do the same thing): https://kit.svelte.dev/docs/adapter-vercel#incremental-static-regeneration https://kit.svelte.dev/docs/adapter-vercel#incremental-stati...
- x-complexity 3y agoBig thanks for all the work you've done: I've been using SvelteKit mainly for experimentation & one-offs. Svelte v3 -> v4 migrations have so far been a breeze for me: An entry update to package.json and an 'npm update' is all I need to do to migrate, and I've been doing basic CRUD & SSR/CSR SVG renders in my test projects. I have no clue what kind of esoteric state management / render manipulations everyone else has been doing to make Svelte angry.
- arpowers 3y agoIs Vercel officially backing Svelte now?
- toastercat 3y agoYes, Rich and I believe other Svelte core maintainers now work for Vercel. Rich I think has worked there for a number of years now.
- Rauchg 3y agoIndeed. We're super happy and honored to support Svelte!
- pineapple_guy 3y agoIf anything needs to be radically improved with svelte it’s bundle size and IDE tooling
- ttfkam 3y agoNot sure I agree about Svelte's bundle size being a problem, but v4 already improved tooling quite a bit by switching to JSDoc and judicious type export limits. Intellisense for library functions, the ability to drill down seamlessly from your code to library code, and helping IDEs choose the correct import have all greatly improved.
- solarkraft 3y agoSo ... how much time should I invest in learning Svelte 4? (Maybe this question has already been answered in the replies to the post, but they're not visible for whatever-the-fuck-elon-smoked-today reasons)
- csjh 3y agoLearning Svelte 4 is no different than learning Svelte 3, the changes are almost entirely behind the curtains. Apparently Svelte 5 will also be very minimal breaking changes, so any knowledge will pass over trivially. In other words, invest all your time in learning svelte :>
- ecf 3y agoUsing “radical” to describe a tool just reeks of hype driven development.