Change8

@sveltejs/kit@3.0.0-next.19

Breaking Changes
📦 sveltekitView on GitHub →
5 breaking1 features🐛 4 fixes🔧 17 symbols

Summary

This release introduces significant changes to module structure and error handling, moving several types and functions to new locations for better organization. It also includes improvements to development workflows and bug fixes.

⚠️ Breaking Changes

  • The `defineParams` function and its associated types have been moved from `@sveltejs/kit` to `@sveltejs/kit/params`.
  • All errors are now run through the `handleError` hook. The `handleValidationError` function has been removed and remote function validation errors are now passed to `handleError` with `kind: 'validation'`.
  • The `Page`, `ReadonlyURL`, and `ReadonlyURLSearchParams` types have been moved from `@sveltejs/kit` to `$app/state`.
  • The `BeforeNavigate`, `OnNavigate`, `AfterNavigate`, `Navigation`, `NavigationTarget`, `NavigationType`, `GotoOptions`, and `Navigation*` variant types have been moved from `@sveltejs/kit` to `$app/navigation`.
  • The `ActionResult` and `SubmitFunction` types have been moved from `@sveltejs/kit` to `$app/forms`.

Migration Steps

  1. Import `defineParams` and its types from `@sveltejs/kit/params` instead of `@sveltejs/kit`.
  2. Update imports for `Page`, `ReadonlyURL`, and `ReadonlyURLSearchParams` from `@sveltejs/kit` to `$app/state`.
  3. Update imports for `BeforeNavigate`, `OnNavigate`, `AfterNavigate`, `Navigation`, `NavigationTarget`, `NavigationType`, `GotoOptions`, and `Navigation*` variant types from `@sveltejs/kit` to `$app/navigation`.
  4. Update imports for `ActionResult` and `SubmitFunction` from `@sveltejs/kit` to `$app/forms`.
  5. Remove calls to `handleValidationError` and handle validation errors within the `handleError` hook by checking for `event.kind === 'validation'`.

✨ New Features

  • Files with a '+' prefix that contain test/spec/stories are now ignored.

🐛 Bug Fixes

  • The dev manifest is now rebuilt when route files disappear during an incremental update.
  • Externalized `@opentelemetry/api` to prevent bundler chunk colocation between `instrumentation.server.js` and application code.
  • Prerender errors are now surfaced during development.
  • Adjusted error overload for optional `App.Error` parameters.

Affected Symbols