SvelteKit 3

(svelte.dev)

98 points | by sampsn 4 hours ago

10 comments

  • jamies 1 hour ago
    Such a great project. I converted my React-enjoying cofounders to Svelte/SvelteKit worried they wouldn't like it, but they absolutely love it!

    We use Svelte extensively at Orb.net for our website (duh), but also as a framework for our desktop and mobile apps. Wails serves our golang and SvelteKit/Svelte provide the UX. It's been tremendous for multiplatform productivity, and binaries are less than 20mb! Nothing like Electron!

    • OzzyB 37 minutes ago
      +1 for Wails mention: just discovered it recently which brought me to Svelte--couldn't be more impressed. Golang "backend" w/ a Svelte "frontend" to build desktop apps the fraction of the size of Electron is a killer imo.
  • killingtime74 1 hour ago
    The thing I like about Svelte the most is that it's closer to raw HTML. Rather than having to keep up with all the React developments if you're not using it all the time.
  • blakeashleyjr 2 hours ago
    Sveltekit has been a breath of fresh air for me over the last few years.

    I've had to work on a Next.js for work and much prefer Sveltekit. Excited to try this release!

    • 383toast 2 hours ago
      what's the point of svelte in a world where the llm is much better at react due to massively more available training data?
      • meowface 8 minutes ago
        It's actually the opposite now. I have never used Svelte until LLMs came around. LLMs are better at writing Svelte than React, and then you also get a faster frontend by default.

        It's like Rust. Way more Python than Rust in the training data, but with LLMs you're much better off defaulting to a Rust backend and Svelte frontend than any other combination. I'd say "unless you have a specific reason", but besides legacy requirements, there is actually no reason.

      • pampas 2 hours ago
        I don't think that's true anymore. I've seen a few benchmarks where svelte results in less tokens than React frameworks to complete the task. There was a time when LLMs were awful at svelte (especially v5) due to stale knowledge but that's not the case today. The knowledge cutoff isn't so bad and LLMs are much better at copying the patterns in your own codebase rather than relying on baked in knowledge.

        Edit: This is the benchmark. But if you suspect it's wrong it's always fun to run your own evals. https://martinalderson.com/posts/which-web-frameworks-are-mo...

      • alpha_squared 1 hour ago
        This seems like flame bait, but I'll take the question seriously: I would rather write a Svelte application by hand than manage a React one via LLM. It's just a more intuitive framework, fewer pitfalls, cleaner reactivity, and is much more performant out of the box.
      • jitl 2 hours ago
        In my experience LLMs write mediocre React code: it works, but is the most naive implementation possible for a given task. It needs to be bullied extensively to write performant React that considers prop stability, does updates in event handlers instead of convoluted useEffect chains, etc. I haven't tried Svelte in a while but "lots of React in training data" doesn't feel like a huge boon to me.
        • casper14 1 hour ago
          Tells you something about the average React code
          • ceejayoz 29 minutes ago
            Or that there are a lot of very basic React tutorials out there.

            Like how half of PHP's problem for a while was w3schools.

      • onemoresoop 20 minutes ago
        React is a resource hog on the client. I really dislike it as a user. In terms of maintaining a codebase though, with LLMs it’s probably not a problem anymore with all the changes React keeps on undergoing. If you don’t need it why bother with it?
      • digitaltrees 44 minutes ago
        There is an argument to choose the ecosystem with the best code quality so the training data pushes the general balance to better systems. There is a lot of bad react code not to mention lots of change in react itself over time.
      • afavour 51 minutes ago
        IMO a lot of React apps are written badly, with an explosion of dependencies. I don’t want to be responsible for a project trained on that.
      • Recursing 2 hours ago
        In my experience LLMs write better svelte code then React code, as there's fewer footguns (e.g. useEffect is much more brittle in React)
      • zem 2 hours ago
        every time I see this argument I think of the fact that one of my current side projects is written in D with qt bindings off github - an obscure library for an obscure language - and claude had zero issues with it. I had to guide the architecture pretty heavily, but the fiddly bits of interfacing multithreaded c libraries to D's garbage collector and qt's event loop were all thanks to the LLM, and done a lot quicker than I would have.
      • theflyinghorse 1 hour ago
        I don't think LLMs are much better at react. I've migrated two apps from next to sveltekit and it was a breeze using codex.
      • transdev12 2 hours ago
        I can’t really speak directly to your question because I don’t have LLMs write react, but I get great results from svelte.

        At this point I don’t think it’s about training examples, once there is sufficient training data it becomes a problem of verifiability, ie how easily can the model check its work for success.

      • stevenhubertron 50 minutes ago
        LLMs are great at Svelte
      • sampsn 2 hours ago
        i have had similar thoughts. But i hold on to the idea that its still valuable to invent new tools and ways of doing things. other wise, why not just use html css and javascript and not use react at all?
      • winfredJa 2 hours ago
        svelte is way more performant than react.
      • esafak 2 hours ago
        LLMs don't struggle with Svelte. Why wouldn't you use it?
      • nozzlegear 2 hours ago
        What's the point of anything?
  • jesse_dot_id 8 minutes ago
    SvelteKit has incredible DX. I use it for everything these days.
  • ramijames 31 minutes ago
    I migrated from Nuxt to SvelteKit last year and never went back. It's great.
  • chrysoprace 1 hour ago
    Been using SvelteKit 3 on a couple of personal projects since the beta and haven't had any issues. The best part is that it barely introduces new features and instead improves on existing features.
  • argentinian 1 hour ago
    Can somebody with experience using both compare Svelte/Sveltekit with Vue/Nuxt?
    • brachkow 0 minutes ago
      I do. I wrote on this extensively there – https://www.brachkow.com/notes/my-experience-with-svelte/

      In short:

      1. Svelte is a good framework, but most of the praise comes from React folk. In my experience, Svelte is less polished and comfortable to work with than Vue.

      2. The biggest problem with Vue is that your choice of SSR frameworks is limited to Nuxt, and Nuxt is, to put it mildly... not a good framework. It is full of reinventing the wheel, ambiguity, and foot guns. In my experience, I regretted every project I used Nuxt for.

      As I needed good SSR, SvelteKit was a breeze: everything just renders on the server when I want it to, proper client/server separation, MVC-looking code.

      3. Svelte has way lower adoption than Vue, not to mention React. So there are not many 3rd party libraries, and even big and default tools like Storybook or ESLint struggle with it.

      It also tends to switch syntaxes a lot. Even this announcement contains a mention of switching from +page files to queries. This hurts AI usage a lot.

      As a conclusion: A year ago, I would say that you should pick Svelte where SSR is critical, and stay on Vue for the rest. But as we have https://inertiajs.com/ right now, you can do SSR of any complexity in Vue and any backend you have.

  • tamimio 37 minutes ago
    A couple years ago I wanted to make a ui for an embedded software I made, after few research I got bamboozled with webdev eco system, it was the most frustrating thing to read, then found svelte in its first version and never looked anywhere else, the closest to vanilla, simple, and fast.
  • slopinthebag 19 minutes ago
    i don't use svelte/kit for technical reasons, but there is no doubt they have the best developer experience of all the js frameworks, it's well-considered and coherent. they have the most aura for sure.
  • sharktheone 4 hours ago
    Still waiting for remote functions to become ready :/
    • chrysoprace 1 hour ago
      They're effectively ready to use even if experimental; the migration path is typically pretty painless when features are stabilised and the codemods get you most of the way. There's a couple of missing features for them but if you don't need those then it's not a problem.
    • nlh 1 hour ago
      I've been using them in production for several months and zero issues. A few small workarounds here and there but otherwise they've been great.
    • pampas 2 hours ago
      I've had no problem using them in 2.x
    • cassepipe 1 hour ago
      What was used instead before ?
      • chrysoprace 1 hour ago
        The idiomatic way to do data fetching in stable SvelteKit is via load functions.[0]

        They still do a good job and allow you to cache the results and invalidate that cache, but they are at a route/layout level rather than at a component level, which is what remote functions solve.

        [0] https://svelte.dev/docs/kit/load