Change8

@sveltejs/kit@2.58.0

Breaking Changes
📦 sveltekitView on GitHub →
2 breaking1 features🐛 8 fixes🔧 7 symbols

Summary

This release introduces improved typing for `RemoteQueryFunction` and fixes several bugs related to reactivity, form handling, and rendering stability. It also includes breaking changes requiring explicit `limit` in `requested` and altering its yielded structure.

⚠️ Breaking Changes

  • The `requested` function now yields `{ arg, query }` entries instead of just the validated argument.
  • The `requested` function now requires the `limit` parameter to be explicitly provided.

Migration Steps

  1. When using `requested`, update code to destructure the yielded value as `{ arg, query }` instead of using the validated argument directly.
  2. Ensure `limit` is explicitly passed to the `requested` function.

✨ New Features

  • `RemoteQueryFunction` now accepts an optional third generic parameter `Validated` (defaulting to `Input`) representing the argument type after schema validation/transformation.

🐛 Bug Fixes

  • Fixed an issue where `query().current`, `.error`, `.loading`, and `.ready` failed to work in non-reactive contexts.
  • Prevented a crash in `deep_set` when encountering nullish nested values.
  • Restored correct `RemoteFormFields` typing for nullable array fields (e.g., when using `.default([])`), ensuring `.as('checkbox')` and related methods function correctly.
  • Stopped issuing warnings about removed SSI comments within `transformPageChunk` because SSI comments (`<!--#`) are distinct from Svelte hydration comments.
  • Changed the return type of the `enhance` function from `void` to `MaybePromise<void>`.
  • Fixed an error thrown when `resolve` is called with an external URL.
  • Avoided Flash of Unstyled Content (FOUC) for Client-Side Rendered (CSR) only pages by loading styles and fonts before CSR begins.
  • Ensured the form result is reset upon a redirect.

Affected Symbols