Repository navigation
Start: public helper to call one server function without rendering a route #8622
alexander-zuev
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Problem. A test that calls one server function through the real Start handler has no public client. createClientRpc reads the private tanstack-start:start-storage-context before it sends anything. serverFnFetcher, which builds the HTTP request, is not exported. createStartHandler does not help: its callback runs only after the route loads, a non-HTML request returns 406, and a /_serverFn/ request never calls the callback. Reaching the public handler means copying an untyped wire protocol (x-tsr-serverFn, seroval, { result, error, context }), which a Start upgrade can break with no type error.
Request. Export a helper that calls one server function through a fetch handler, without rendering a route and without building that private context:
It should build and parse the request, run the app's real handler, and not call getRouter() or router.load().
Context. @tanstack/react-start 1.168.60. Related: discussion #2701 and issue #7507. This is the HTTP side of that gap.
All reactions