-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
225 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react' | ||
|
||
export const dynamic = 'force-dynamic' | ||
|
||
export default async function Layout({ children }) { | ||
console.log('re-fetching in layout') | ||
const data = await fetch( | ||
'https://next-data-api-endpoint.vercel.app/api/random' | ||
) | ||
const randomNumber = await data.text() | ||
|
||
return ( | ||
<div> | ||
<p id="random-number">{randomNumber}</p> | ||
|
||
{children} | ||
</div> | ||
) | ||
} |
11 changes: 11 additions & 0 deletions
11
test/e2e/app-dir/app-prefetch/app/force-dynamic/search-params/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Link from 'next/link' | ||
|
||
export default function Home({ searchParams }) { | ||
return ( | ||
<> | ||
<div id="search-params-data">{JSON.stringify(searchParams)}</div> | ||
<Link href="?foo=true">Add search params</Link> | ||
<Link href="/force-dynamic/search-params">Clear Params</Link> | ||
</> | ||
) | ||
} |
10 changes: 10 additions & 0 deletions
10
test/e2e/app-dir/app-prefetch/app/force-dynamic/test-page/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Link from 'next/link' | ||
|
||
export default function Page() { | ||
return ( | ||
<div id="test-page"> | ||
Hello from /force-dynamic/test-page{' '} | ||
<Link href="/force-dynamic/test-page/sub-page">To Sub Page</Link> | ||
</div> | ||
) | ||
} |
10 changes: 10 additions & 0 deletions
10
test/e2e/app-dir/app-prefetch/app/force-dynamic/test-page/sub-page/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Link from 'next/link' | ||
|
||
export default function Page() { | ||
return ( | ||
<div id="sub-page"> | ||
Hello from /force-dynamic/test-page/sub-page{' '} | ||
<Link href="/force-dynamic/test-page">Back to Test Page</Link> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react' | ||
|
||
export const revalidate = 0 | ||
|
||
export default async function Layout({ children }) { | ||
console.log('re-fetching in layout') | ||
const data = await fetch( | ||
'https://next-data-api-endpoint.vercel.app/api/random' | ||
) | ||
const randomNumber = await data.text() | ||
|
||
return ( | ||
<div> | ||
<p id="random-number">{randomNumber}</p> | ||
|
||
{children} | ||
</div> | ||
) | ||
} |
11 changes: 11 additions & 0 deletions
11
test/e2e/app-dir/app-prefetch/app/revalidate-0/search-params/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Link from 'next/link' | ||
|
||
export default function Home({ searchParams }) { | ||
return ( | ||
<> | ||
<div id="search-params-data">{JSON.stringify(searchParams)}</div> | ||
<Link href="?foo=true">Add search params</Link> | ||
<Link href="/revalidate-0/search-params">Clear Params</Link> | ||
</> | ||
) | ||
} |
10 changes: 10 additions & 0 deletions
10
test/e2e/app-dir/app-prefetch/app/revalidate-0/test-page/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Link from 'next/link' | ||
|
||
export default function Page() { | ||
return ( | ||
<div id="test-page"> | ||
Hello from /revalidate-0/test-page{' '} | ||
<Link href="/revalidate-0/test-page/sub-page">To Sub Page</Link> | ||
</div> | ||
) | ||
} |
10 changes: 10 additions & 0 deletions
10
test/e2e/app-dir/app-prefetch/app/revalidate-0/test-page/sub-page/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Link from 'next/link' | ||
|
||
export default function Page() { | ||
return ( | ||
<div id="sub-page"> | ||
Hello from /revalidate-0/test-page/sub-page{' '} | ||
<Link href="/revalidate-0/test-page">Back to Test Page</Link> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.