sveltejs/kit @sveltejs/[email protected] → @sveltejs/[email protected]

Release 2.58.0 adds a small set of remote-function API changes, plus a handful of bug fixes around forms, resolve, and CSR-only rendering. It also includes a few documentation and tooling updates, but the user-facing work is concentrated in the remote functions and form utilities.

What's new

  • RemoteQueryFunction now accepts an optional third generic parameter, Validated, which defaults to Input and represents the argument type after schema validation or transformation. This gives you a clearer type for queries whose validator changes the incoming value. (#15739)
  • requested now yields { arg, query } entries instead of just the validated argument, and limit is required again as originally intended. The returned query stays bound to the original request, so you can refresh the right query instance directly inside the loop. (#15739)

Breaking changes

  • requested now returns { arg, query } entries rather than the validated argument itself. Update loops over requested(...) to destructure the entry and use query.refresh() or query-aware logic instead of assuming the iterator value is the validated input. (#15739)
  • limit is now required in requested. If you were calling it without a second argument, add the limit back in. (#15739)

Fixes

  • query().current, .error, .loading, and .ready now work again in non-reactive contexts. (#15699)
  • deep_set no longer crashes when a nested path passes through an existing null or undefined value. (#15600)
  • Remote form fields with nullable array inputs regain the correct .as('checkbox') typing and similar helpers. (#15723)
  • Removing SSI comments in transformPageChunk no longer triggers a false hydration warning. (#15695)
  • resolve now throws when given an external URL instead of rewriting it into a broken path. (#15733)
  • Form state is reset on redirect again, matching normal form submission behavior. (#15724)
  • CSR-only pages now load stylesheets and fonts before client-side rendering starts, which avoids a flash of unstyled content. (#15718)

Other notable changes

  • The return type for the function passed to enhance is now MaybePromise<void>, which matches its async use in practice. (#15710)
  • query.run is now documented, along with a note on query caching. (#15661)

Contributors

@ottomated @elliott-with-the-longest-name-on-github @RazinShafayet2007 @aubergene @Stadly @teemingc @Rohan5commit @Rich-Harris @benmccann @yahmed-66