Skip to content

Commit

Permalink
skip PPR
Browse files Browse the repository at this point in the history
  • Loading branch information
ztanner committed Jul 31, 2024
1 parent 4b3f866 commit d2fcdeb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ function createPrefetchCacheKey(
// In the auto case, since loading.js & layout.js won't have access to search params,
// we can safely re-use that cache entry. But for full prefetches, we should not
// re-use the cache entry as the response may differ.
if (prefetchKind === PrefetchKind.FULL) {
// TODO: Investigate how this should work with PPR. For now, PPR always keys on the full URL.
if (prefetchKind === PrefetchKind.FULL || process.env.__NEXT_PPR) {
// if we have a full prefetch, we can include the search param in the key,
// as we'll be getting back a full response. The server might have read the search
// params when generating the full response.
Expand Down
12 changes: 1 addition & 11 deletions test/e2e/app-dir/navigation/navigation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { retry, waitFor } from 'next-test-utils'
import type { Response } from 'playwright'

describe('app dir - navigation', () => {
const { next, isNextDev, isNextStart, isNextDeploy } = nextTestSetup({
const { next, isNextDev, isNextDeploy } = nextTestSetup({
files: __dirname,
})

Expand Down Expand Up @@ -176,16 +176,6 @@ describe('app dir - navigation', () => {
)
}

if (isNextStart || isNextDeploy) {
await browser.waitForIdleNetwork()
// there should be an RSC call for the prefetch
expect(hasRscRequest).toBe(true)
}

// Wait for all network requests to finish, and then initialize the flag
// used to determine if any RSC requests are made
hasRscRequest = false

await checkLink(6, 128)
await checkLink(50, 744)
await checkLink(160, 2284)
Expand Down
3 changes: 2 additions & 1 deletion test/ppr-tests-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
"test/e2e/app-dir/searchparams-static-bailout/searchparams-static-bailout.test.ts",
"test/e2e/app-dir/app-client-cache/client-cache.experimental.test.ts",
"test/e2e/app-dir/app-client-cache/client-cache.original.test.ts",
"test/e2e/app-dir/app-client-cache/client-cache.defaults.test.ts"
"test/e2e/app-dir/app-client-cache/client-cache.defaults.test.ts",
"test/e2e/app-dir/searchparams-reuse-loading/searchparams-reuse-loading.test.ts"
]
}
}

0 comments on commit d2fcdeb

Please sign in to comment.