Change8

@sveltejs/kit@3.0.0-next.13

Breaking Changes
📦 sveltekitView on GitHub →
2 breaking2 features🐛 21 fixes1 deprecations🔧 10 symbols

Summary

This release introduces shallow routing to `goto` and preserves page state across reloads. It also includes several bug fixes and performance improvements, alongside breaking changes to `goto` options and the `error` function signature.

⚠️ Breaking Changes

  • The `noScroll` and `keepFocus` options of `goto` have been replaced by a single `reset` option. Update your `goto` calls to use `reset` instead of `noScroll` or `keepFocus`. Similarly, the `data-sveltekit-noscroll` and `data-sveltekit-keepfocus` attributes are now `data-sveltekit-reset`.
  • The `error(status, {...})` function signature is deprecated. Use `error(status, message, {...})` instead, providing a message string as the second argument.

Migration Steps

  1. Replace `goto` options `noScroll` and `keepFocus` with the `reset` option.
  2. Update `data-sveltekit-noscroll` and `data-sveltekit-keepfocus` attributes to `data-sveltekit-reset`.
  3. Update calls from `error(status, {...})` to `error(status, message, {...})`.

✨ New Features

  • Added shallow routing to `goto`.
  • Page state set through `goto(..., { state, persistState: true })` is now preserved across reloads.

🐛 Bug Fixes

  • Deduplicated repeated CSP directive handling.
  • Avoided Vite dev server reload on initial page request.
  • Prevented setting a `null` `accept-language` header on internal `fetch` sub-requests when the incoming request has none.
  • Correctly detected prerendered paths in server `fetch` when `paths.base` is set.
  • Prevented duplication of remote modules in the generated manifest.
  • Excluded inlined files from the page's `$app/manifest` immutable list.
  • Avoided quadratic remote form issue merging.
  • Prevented serialization of fetch responses when the request body is not a string or TypedArray.
  • Read the error status of `App.Error` in the `prerender` and `query.live` remote functions.
  • Propagated errors from prerendered remote responses instead of re-running the function.
  • Respected the status returned from `handleError` on the fallback error page served to error-page sub-requests.
  • Skipped unnecessary `version.json` checks if `updated.current` is already `true`.
  • Allowed generation of `$app/tsconfig` without TypeScript installed.
  • Used a `Set` to check element ids when validating fragment links during prerendering.
  • Only included `_app/immutable` files in `$app/manifest`'s `immutable` in the service worker.
  • Logged errors caught by the Vite dev server handler.
  • Resolved `root` per instance of the SvelteKit Vite plugin.
  • Ignored path casing differences when warning about overridden Vite config on Windows.
  • Preserved the current URL search parameters when submitting a remote form without JavaScript.
  • Treeshaked prerendered remote functions in the right chunks.
  • Handled errors during development if the adapter does not support instrumentation and it exists.

Affected Symbols

⚡ Deprecations

  • `pushState` and `replaceState` in `goto` are deprecated in favor of shallow routing.