Skip to content

Commit 868d8d8

Browse files
committed
small cleanup
1 parent 8c2c040 commit 868d8d8

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/build/content/prerendered.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ export const copyPrerenderedContent = async (ctx: PluginContext): Promise<void>
137137
})
138138
: false
139139

140+
// https://github.com/vercel/next.js/pull/68602 changed the cache kind for Pages router pages from `PAGE` to `PAGES` and from `ROUTE` to `APP_ROUTE`.
140141
const shouldUseEnumKind = ctx.nextVersion
141142
? satisfies(ctx.nextVersion, '>=15.0.0-canary.114 <15.0.0-d || >15.0.0-rc.0', {
142143
includePrerelease: true,

src/run/handlers/cache.cts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ export class NetlifyCacheHandler implements CacheHandler {
191191
}
192192

193193
async get(...args: Parameters<CacheHandler['get']>): ReturnType<CacheHandler['get']> {
194-
debugger
195194
return this.tracer.withActiveSpan('get cache key', async (span) => {
196195
const [key, ctx = {}] = args
197196
getLogger().debug(`[NetlifyCacheHandler.get]: ${key}`)
@@ -232,7 +231,10 @@ export class NetlifyCacheHandler implements CacheHandler {
232231

233232
case 'ROUTE':
234233
case 'APP_ROUTE': {
235-
span.addEvent('APP_ROUTE', { lastModified: blob.lastModified, status: blob.value.status })
234+
span.addEvent(blob.value?.kind, {
235+
lastModified: blob.lastModified,
236+
status: blob.value.status,
237+
})
236238

237239
const valueWithoutRevalidate = this.captureRouteRevalidateAndRemoveFromObject(blob.value)
238240

@@ -246,7 +248,7 @@ export class NetlifyCacheHandler implements CacheHandler {
246248
}
247249
case 'PAGE':
248250
case 'PAGES': {
249-
span.addEvent('PAGE', { lastModified: blob.lastModified })
251+
span.addEvent(blob.value?.kind, { lastModified: blob.lastModified })
250252

251253
const { revalidate, ...restOfPageValue } = blob.value
252254

@@ -258,7 +260,7 @@ export class NetlifyCacheHandler implements CacheHandler {
258260
}
259261
}
260262
case 'APP_PAGE': {
261-
span.addEvent('APP_PAGE', { lastModified: blob.lastModified })
263+
span.addEvent(blob.value?.kind, { lastModified: blob.lastModified })
262264

263265
const { revalidate, rscData, ...restOfPageValue } = blob.value
264266

0 commit comments

Comments
 (0)