Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No config or fetch resource option for server function on client to proxy to server function on server. #3411

Open
rsdlt opened this issue Feb 12, 2025 · 0 comments
Labels
start Everything about TanStack Start

Comments

@rsdlt
Copy link

rsdlt commented Feb 12, 2025

Which project does this relate to?

Start

Describe the bug

Today it's not possible to define the server information (host, port, etc.) or a fetch resource, for server functions on the client to proxy the request to the server function on the server for execution.

When the client is served isolated from the server environment, for example client served on WebView on iOS via CapacitorJS, the server function on the client cannot be configured to define where the server, with its counterpart server function, is located in order to proxy it.

Your Example Website or App

https://stackblitz.com/github/tanstack/router/tree/main/examples/react/quickstart-file-based?file=src%2Froutes%2F__root.tsx

Steps to Reproduce the Bug or Issue

  1. Create an isomorphic server function.
  2. Build the client and server code.
  3. Serve the client via CapacitorJs or similar, isolated from the Nitro server (WebView on iOS or Android)
  4. Deploy the server on its own IP, isolated from the client.
  5. Server function executed on the client cannot be configured to proxy its counterpart on the server.

Expected behavior

As a user I'd expect to be able to define or configure the resource to fetch when the server function on the client proxy the server function on the server.

This resource can be one expected by standard Fetch API:

  • a string containing the URL
  • an object, such an instance of URL, which has a stringifier that produces a string containing the URL
  • a Request instance

Or the server information (host / port) could be define via configuration, so that it applies to all server functions.

Screenshots or Videos

Image

In this diagram, because the client app is served via CapacitorJS on an iOS device, the server function on the client cannot be configured on how to reach its counterpart on the server because it does not have the IP / Host or fetch resource information.

Platform

  • OS: iOS, Android, WebView

Additional context

I believe having this would make the use of isomorphic server functions much more convenient when developing hybrid mobile applications.

@schiller-manuel schiller-manuel added the enhancement New feature or request label Feb 12, 2025
@SeanCassiere SeanCassiere added start Everything about TanStack Start and removed enhancement New feature or request labels Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
start Everything about TanStack Start
Projects
None yet
Development

No branches or pull requests

3 participants