Skip to content
Source
Sign inSign up
TanStack/router

fix: trace nested server function factory re-export chain #6166

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

Showing 12 changed files with 27 additions and 0 deletions (loading 9).

x
0 of 12 viewed, 12 left
13 additions and 0 deletionse2e/react-start/server-functions/src/routes/factory/-functions/functions.tsModified
View file
@@ -6,6 +6,8 @@
import { reexportFactory } from './reexportIndex'
// Test star re-export syntax: `export * from './module'`
import { starReexportFactory } from './starReexportIndex'
+// Test nested star re-export syntax: A -> B -> C chain
+import { nestedReexportFactory } from './nestedReexportA'
​
export const fooFn = createFooServerFn().handler(({ context }) => {
return {
@@ -115,3 +117,14 @@
+​
+// Test that nested star re-exported factories (A -> B -> C chain) work correctly
+// The middleware from nestedReexportFactory should execute and add { nested: 'nested-middleware-executed' } to context
+export const nestedReexportedFactoryFn = nestedReexportFactory().handler(
+ ({ context }) => {
+ return {
+ name: 'nestedReexportedFactoryFn',
+ context,
+ }
+ },
+)