Skip to content
Source
Sign inSign up
TanStack/router

fix: no invalidation for server functions in dev #5513

Mergedschiller-manuel(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/5513/headmerged by schiller-manuel(GitHub profile, opens in a new tab)

Showing 16 changed files with 13 additions and 44 deletions (loading 13).

x
0 of 16 viewed, 16 left
10 additions and 16 deletionsdocs/start/framework/react/guide/server-functions.mdModified
View file
@@ -228,21 +228,19 @@
​
Handle request cancellation with `AbortSignal` for long-running operations.
​
-### Function ID generation
+### Function ID generation for production build
​
Server functions are addressed by a generated, stable function ID under the hood. These IDs are embedded into the client/SSR builds and used by the server to locate and import the correct module at runtime.
​
-Defaults:
+By default, IDs are SHA256 hashes of the same seed to keep bundles compact and avoid leaking file paths.
+If two server functions end up with the same ID (including when using a custom generator), the system de-duplicates by appending an incrementing suffix like `_1`, `_2`, etc.
​
-- In development, IDs are URL-safe strings derived from `${filename}--${functionName}` to aid debugging.
-- In production, IDs are SHA256 hashes of the same seed to keep bundles compact and avoid leaking file paths.
-- If two server functions end up with the same ID (including when using a custom generator), the system de-duplicates by appending an incrementing suffix like `_1`, `_2`, etc.
-- IDs are stable for a given file/function tuple for the lifetime of the process (hot updates keep the same mapping).
-​
Customization:
​
-You can customize function ID generation by providing a `generateFunctionId` function when configuring the TanStack Start Vite plugin.
+You can customize function ID generation for the production build by providing a `generateFunctionId` function when configuring the TanStack Start Vite plugin.
​
+Prefer deterministic inputs (filename + functionName) so IDs remain stable between builds.
+​
Please note that this customization is **experimental** und subject to change.