Change8

@sveltejs/kit@3.0.0-next.12

Breaking Changes
📦 sveltekitView on GitHub →
6 breaking5 features🐛 16 fixes1 deprecations🔧 19 symbols

Summary

This release introduces new `$app` modules for manifest and service workers, enhances form handling validation, and includes several bug fixes. It also contains significant breaking changes related to type renames, path handling, and access restrictions within queries.

⚠️ Breaking Changes

  • Renamed `Pathname` type to `Path` and `Asset` to `AssetPath`. Update your imports accordingly.
  • Leading `/` has been removed from `Path` and `AssetPath`. Adjust any logic that relies on the presence of a leading slash.
  • The `tsconfig.json` file is now written to `node_modules/$app/tsconfig`. Ensure your build process or IDE is configured to find it there.
  • Accessing `event.url`, `event.params`, and `event.route` inside queries will now result in an error. Move this logic outside of queries.
  • The `$service-worker` module has been deleted. Migrate any functionality to the new `$app/service-worker` module.
  • New deployments are now detected on data, remote, and form action responses, tab focus, and visibility change. The default `version.pollInterval` has been set to 1 hour. Review your deployment and polling configurations.

Migration Steps

  1. Update imports from `Pathname` to `Path` and `Asset` to `AssetPath`.
  2. Remove leading `/` from `Path` and `AssetPath` if your code relies on it.
  3. Configure your build process or IDE to find `tsconfig.json` at `node_modules/$app/tsconfig`.
  4. Move `event.url`, `event.params`, and `event.route` access out of queries.
  5. Migrate functionality from the deleted `$service-worker` module to the new `$app/service-worker` module.
  6. Review your deployment and polling configurations due to changes in deployment detection and default `version.pollInterval`.

✨ New Features

  • Added `$app/manifest` module with `immutable`, `assets`, `prerendered`, and `routes` exports.
  • Validation added to ensure all remote form fields are created with `form.fields.foo.as(...)`.
  • The `$app/paths` module is now importable in service workers.
  • Introduced the `$app/service-worker` module.
  • Improved tsconfig validation.

🐛 Bug Fixes

  • Default cookies to `secure: false` during development.
  • Allow `undefined` values to be passed to form field `.as(...)` where applicable.
  • Include queries refreshed from within another query in the serialized response.
  • Generate sourcemaps for remote modules.
  • Avoid empty `getElementById()` call on hash routing navigation.
  • Warn if hook files are spelled as 'hook' instead of 'hooks'.
  • Prevent infinite loops when server-side queries refresh each other in a cycle during the single-flight drain.
  • Populate `version` in service workers.
  • Resolve remote modules as external during dev prebundling so packages can re-export remote functions.
  • Refetch route-tracking server data when navigating away from an error page.
  • Serialize `query(...).set(...)`/`query(...).refresh()` values into the rendered HTML when called from within a query during SSR.
  • Fall back to the page's form actions when a sibling endpoint has no POST handler.
  • Return a lightweight 404 instead of rendering the error page for subresource requests.
  • Preserve stripped path prefixes by making trailing-slash redirects relative.
  • Deduplicate type-stripping logic in `tweak_types`.
  • More informative error message when running a command inside a query or prerender function.

Affected Symbols

⚡ Deprecations

  • The `alias` option is deprecated.