Skip to content
Source
Sign inSign up
TanStack/router

fix: compile factories #6188

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

Showing 18 changed files with 164 additions and 0 deletions (loading 14).

x
0 of 18 viewed, 18 left
9 additions and 0 deletionse2e/react-start/server-functions/src/routes/middleware/index.tsxModified
View file
@@ -41,6 +41,15 @@
Server imports in middleware are stripped from client build
</Route.Link>
</li>
+ <li>
+ <Route.Link
+ to="./middleware-factory"
+ data-testid="middleware-factory-link"
+ >
+ Middleware factories with server imports are stripped from client
+ build
+ </Route.Link>
+ </li>
</ul>
</div>
126 additions and 0 deletionse2e/react-start/server-functions/src/routes/middleware/middleware-factory.tsxAdded
View file
@@ -0,0 +1,126 @@
+import { createFileRoute } from '@tanstack/react-router'
+import { createMiddleware, createServerFn } from '@tanstack/react-start'
+import { getRequestHeaders } from '@tanstack/react-start/server'
+import React from 'react'
+​