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
RemoteQueryFunctionnow accepts an optional third generic parameter,Validated, which defaults toInputand represents the argument type after schema validation or transformation. This gives you a clearer type for queries whose validator changes the incoming value. (#15739)requestednow yields{ arg, query }entries instead of just the validated argument, andlimitis required again as originally intended. The returnedquerystays bound to the original request, so you can refresh the right query instance directly inside the loop. (#15739)
Breaking changes
requestednow returns{ arg, query }entries rather than the validated argument itself. Update loops overrequested(...)to destructure the entry and usequery.refresh()orquery-aware logic instead of assuming the iterator value is the validated input. (#15739)limitis now required inrequested. If you were calling it without a second argument, add the limit back in. (#15739)
Fixes
query().current,.error,.loading, and.readynow work again in non-reactive contexts. (#15699)deep_setno longer crashes when a nested path passes through an existingnullorundefinedvalue. (#15600)- Remote form fields with nullable array inputs regain the correct
.as('checkbox')typing and similar helpers. (#15723) - Removing SSI comments in
transformPageChunkno longer triggers a false hydration warning. (#15695) resolvenow 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
enhanceis nowMaybePromise<void>, which matches its async use in practice. (#15710) query.runis 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