Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/large-insects-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tanstack/start-server-core': patch
---

Skip a full router.update for faster createStartHandler
4 changes: 3 additions & 1 deletion packages/start-server-core/src/createStartHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,9 @@ export function createStartHandler<TRegister = Register>(
getStartContext({ throwIfNotFound: false })?.requestAssets,
})

routerInstance.update({ additionalContext: { serverContext } })
// `additionalContext` is request-scoped and only read from router.options
// during load; avoid a full router.update() and redundant location parse.
routerInstance.options.additionalContext = { serverContext }
await routerInstance.load()

if (routerInstance.state.redirect) {
Expand Down
Loading