Change8

@sveltejs/kit@3.0.0-next.0

Breaking Changes
📦 sveltekitView on GitHub →
15 breaking2 features🐛 3 fixes1 deprecations🔧 16 symbols

Summary

This release enforces significant dependency upgrades, including Node 22, TypeScript 6, Svelte 5.48.0, and Vite 8, while removing several deprecated APIs and configuration options.

⚠️ Breaking Changes

  • TypeScript 6 is now the minimum required version.
  • Cookie names must now contain only ASCII characters due to upgrade to cookie v1.
  • Node 22 or newer is now required.
  • The `preloadStrategy` option has been removed; `modulepreload` will always be used.
  • The default `path` option for cookies is now set to `'/'`.
  • The `@sveltejs/kit/node/polyfills` module has been removed.
  • The `Link` header preload mechanism is now controlled by `config.kit.output.linkHeaderPreload` (this is a breaking change as it introduces a new config option and likely affects how preloading is configured).
  • Requires `@sveltejs/vite-plugin-svelte` version 7 or newer.
  • The `createEntries` function has been removed from the `Builder` object passed to adapter functions.
  • The deprecated CSRF `checkOrigin` option is removed in favor of `trustedOrigins`.
  • The `delta` property on navigation events now only exists for `popstate` events.
  • The deprecated `pragma` header in version polling has been removed for improved CORS support.
  • Requires Svelte version 5.48.0 or newer.
  • Requires Vite 8. This provides new functionality but breaks compatibility with older Vite versions.
  • The `data-sveltekit-*` option `'off'` is removed in favor of using `false`.

Migration Steps

  1. Ensure your TypeScript version is 6 or higher.
  2. Ensure all cookie names only contain ASCII characters.
  3. Upgrade your Node.js environment to version 22 or newer.
  4. Remove usage of the `preloadStrategy` option; preloading now defaults to `modulepreload`.
  5. Review cookie configurations; the default path is now `/`.
  6. Remove imports from `@sveltejs/kit/node/polyfills`.
  7. Update configuration to use `config.kit.output.linkHeaderPreload` if you were configuring link header preloading.
  8. Upgrade `@sveltejs/vite-plugin-svelte` to version 7 or newer.
  9. Update adapter functions to no longer expect or use `createEntries` on the `Builder` object.
  10. Replace usage of the CSRF `checkOrigin` option with `trustedOrigins`.
  11. Check navigation event handlers; only `popstate` events will have a `delta` property.
  12. Remove usage of the deprecated `pragma` header in version polling.
  13. Upgrade Svelte to version 5.48.0 or newer.
  14. Upgrade Vite to version 8 or newer.
  15. Replace usage of `data-sveltekit-*="off"` with `data-sveltekit-*="false"`.

✨ New Features

  • Path resolution now uses the Vite config `root` option instead of `process.cwd()` to better support monorepo configurations like Vitest workspaces.
  • Added explicit environment variables support.

🐛 Bug Fixes

  • Removed the check for `svelte.config.js` before running `sync`.
  • A placeholder `tsconfig.json` is now generated to suppress sync-time warnings.
  • Allowed the use of `$app/env/public` in service workers.

Affected Symbols

⚡ Deprecations

  • Response helpers are deprecated in favor of platform-provided alternatives.