SvelteKit 3

Source: svelte.dev
76 points by sampsn 3 hours ago on hackernews | 20 comments

Version 3.0 of SvelteKit, the official application framework for Svelte, is now available.

If you’ve used earlier versions of SvelteKit, everything will feel very familiar — it’s the same framework with a little more polish, a little more type safety, and a little less junk. We’ve made migration as seamless as we can with the sv migrate command...

npx sv migrate sveltekit-3 --tasks all --confirm

...which will automatically migrate as much of your codebase as possible, and generate a TODO list for everything else. (If you’re agentically inclined, your robot friends will make short work of it.)

To create a new app, run sv create:

As with any major version bump there are a handful of breaking changes to be aware of, which are covered in the migration guide (or, more briefly, in the recent release candidate announcement).

Quick highlights:

  • configuration now lives in vite.config.ts instead of svelte.config.js
  • the $lib alias is now #lib, making use of standard subpath imports
  • environment variables are more powerful and easier to use
  • service workers are less boilerplatey
  • error handling is improved across the board

Are remote functions ready yet?

Not quite. But it’s our top priority!

Remote functions are a set of utilities for secure, efficient, type-safe client-server communication. You’ve likely seen some version of this idea in other frameworks, but we think you’re going to prefer this one.

Using them requires Async Svelte, which for now requires an experimental flag. Bear with us.

Join us in Ljubljana next month

This is as good a place as any to remind everyone that the next in-person Svelte Summit is taking place on November 19-20 in the lovely town of Ljubljana, Slovenia. Among other things it will be a celebration of Svelte’s 10th birthday, and we’d love to share some cake with you.