Skip to content

Commit 1c7146f

Browse files
review
1 parent 0b6b6cf commit 1c7146f

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎packages/router-core/src/ssr/ssr-server.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,14 @@ export function attachRouterServerSsrUtils({
238238
const matches = matchesToDehydrate.map(dehydrateMatch)
239239

240240
let manifestToDehydrate: Manifest | undefined = undefined
241-
// For currently matched routes, send full manifest (preloads + assets)
242-
// For all other routes, only send assets (no preloads as they are handled via dynamic imports)
241+
// For currently matched routes, send full manifest (preloads + assets).
242+
// For unmatched routes, include assets only when includeUnmatchedRouteAssets
243+
// is true; otherwise omit them entirely. Preloads for unmatched routes are
244+
// still excluded because they are handled via dynamic imports.
243245
if (manifest) {
244246
// Prod-only caching; in dev manifests may be replaced/updated (HMR)
245247
const currentRouteIdsList = matchesToDehydrate.map((m) => m.routeId)
246-
const manifestCacheKey = currentRouteIdsList.join('\0')
248+
const manifestCacheKey = `${currentRouteIdsList.join('\0')}\0includeUnmatchedRouteAssets=${includeUnmatchedRouteAssets}`
247249

248250
let filteredRoutes: FilteredRoutes | undefined
249251

‎packages/start-plugin-core/tests/start-manifest-plugin/manifestBuilder.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { deserialize } from 'seroval'
21
import { describe, expect, test } from 'vitest'
2+
import { deserialize } from 'seroval'
33
import {
44
appendUniqueAssets,
55
appendUniqueStrings,

0 commit comments

Comments
 (0)