@sveltejs/kit@3.0.0-next.0
Breaking Changes📦 sveltekitView on GitHub →
⚠ 15 breaking✨ 2 features🐛 3 fixes⚡ 1 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
- Ensure your TypeScript version is 6 or higher.
- Ensure all cookie names only contain ASCII characters.
- Upgrade your Node.js environment to version 22 or newer.
- Remove usage of the `preloadStrategy` option; preloading now defaults to `modulepreload`.
- Review cookie configurations; the default path is now `/`.
- Remove imports from `@sveltejs/kit/node/polyfills`.
- Update configuration to use `config.kit.output.linkHeaderPreload` if you were configuring link header preloading.
- Upgrade `@sveltejs/vite-plugin-svelte` to version 7 or newer.
- Update adapter functions to no longer expect or use `createEntries` on the `Builder` object.
- Replace usage of the CSRF `checkOrigin` option with `trustedOrigins`.
- Check navigation event handlers; only `popstate` events will have a `delta` property.
- Remove usage of the deprecated `pragma` header in version polling.
- Upgrade Svelte to version 5.48.0 or newer.
- Upgrade Vite to version 8 or newer.
- 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
cookie v1config.kit.output.linkHeaderPreload@sveltejs/vite-plugin-svelte v7Builder object (in adapter functions)checkOrigin (CSRF option)trustedOriginspopstate navigation eventspragma header (version polling)Svelte 5.48.0Vite 8error (type)isHttpError (type)redirect (type)isRedirect (type)data-sveltekit-* option 'off'$app/env/public
⚡ Deprecations
- Response helpers are deprecated in favor of platform-provided alternatives.