You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7f8ab2d
Browse filesBrowse the repository at this point in the historyBrowse files
feat(web): a server function reference can declare its own client send (#4170)
* feat(web): wrapServerFunctionsFetch, a send layer that composes with the app's fetch
An integration that answers some server-function requests itself (a
prerendered build's static artifacts) had to install itself as the
transport fetch, so it and an app's own configureServerFunctionsClient
({ fetch }) replaced each other depending on which ran last. A layer wraps
a send that reads the configured fetch at call time, so the order no
longer matters.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01NkjGmX4hAoiU9VhXNt7j3E
* perf(web): leave the transport's direct send in place until a layer is added
An unlayered app now ships no extra bytes: with wrapServerFunctionsFetch
tree-shaken, the send variable is never assigned and minifies away.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01NkjGmX4hAoiU9VhXNt7j3E
* refactor(web): a per-reference send instead of a global send layer
wrapServerFunctionsFetch added a second, global transport hook. A
reference can now declare its own send in its metadata instead
(withMeta(fn, { fetch: (address, init, next) => ... })): the transport uses
it for that function's requests with the app's configured send as next.
The intent lives on the declaration, the app's fetch stays the app's, and
there is nothing to order.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01NkjGmX4hAoiU9VhXNt7j3E
---------
Co-authored-by: Claude <[email protected]>
A server function reference can declare its own client send with `withMeta(fn, { fetch: (address, init, next) => ... })`. The transport uses it for that function's requests, with the configured send (the app's `fetch`, or the global) as `next`, so an integration that answers some calls itself (a prerendered build's static artifacts) no longer competes with the app's `configureServerFunctionsClient({ fetch })`. Exported type `ServerFunctionsSend`.
0 commit comments