Skip to content

Commit bb5d3ca

Browse files
committed
add checks for revalidatedTags along with pendingRevalidates
1 parent afafe3d commit bb5d3ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+5217
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
This is a [Next.js](https://nextjs.org/) template to use when reporting a [bug in the Next.js repository](https://github.com/vercel/next.js/issues) with the `app/` directory.
2+
3+
## Getting Started
4+
5+
These are the steps you should follow when creating a bug report:
6+
7+
- Bug reports must be verified against the `next@canary` release. The canary version of Next.js ships daily and includes all features and fixes that have not been released to the stable version yet. Think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces before opening a new issue. Issues not verified against `next@canary` will be closed after 30 days.
8+
- Make sure your issue is not a duplicate. Use the [GitHub issue search](https://github.com/vercel/next.js/issues) to see if there is already an open issue that matches yours. If that is the case, upvoting the other issue's first comment is desirable as we often prioritize issues based on the number of votes they receive. Note: Adding a "+1" or "same issue" comment without adding more context about the issue should be avoided. If you only find closed related issues, you can link to them using the issue number and `#`, eg.: `I found this related issue: #3000`.
9+
- If you think the issue is not in Next.js, the best place to ask for help is our [Discord community](https://nextjs.org/discord) or [GitHub discussions](https://github.com/vercel/next.js/discussions). Our community is welcoming and can often answer a project-related question faster than the Next.js core team.
10+
- Make the reproduction as minimal as possible. Try to exclude any code that does not help reproducing the issue. E.g. if you experience problems with Routing, including ESLint configurations or API routes aren't necessary. The less lines of code is to read through, the easier it is for the Next.js team to investigate. It may also help catching bugs in your codebase before publishing an issue.
11+
- Don't forget to create a new repository on GitHub and make it public so that anyone can view it and reproduce it.
12+
13+
## How to use this template
14+
15+
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example:
16+
17+
```bash
18+
npx create-next-app --example reproduction-template reproduction-app
19+
```
20+
21+
```bash
22+
yarn create next-app --example reproduction-template reproduction-app
23+
```
24+
25+
```bash
26+
pnpm create next-app --example reproduction-template reproduction-app
27+
```
28+
29+
## Learn More
30+
31+
To learn more about Next.js, take a look at the following resources:
32+
33+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
34+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
35+
- [How to Contribute to Open Source (Next.js)](https://www.youtube.com/watch?v=cuoNzXFLitc) - a video tutorial by Lee Robinson
36+
- [Triaging in the Next.js repository](https://github.com/vercel/next.js/blob/canary/contributing.md#triaging) - how we work on issues
37+
- [CodeSandbox](https://codesandbox.io/s/github/vercel/next.js/tree/canary/examples/reproduction-template) - Edit this repository on CodeSandbox
38+
39+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
40+
41+
## Deployment
42+
43+
If your reproduction needs to be deployed, the easiest way is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
44+
45+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
25.3 KB
Binary file not shown.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { cookies } from "next/headers";
2+
3+
export const dynamic = "force-dynamic"
4+
5+
export default function RootLayout({ children }) {
6+
// console.log('render layout', cookies());
7+
8+
return (
9+
<html>
10+
<head />
11+
<body>
12+
<p id="home">{cookies().get("count")?.value || "0"}</p>
13+
{children}
14+
</body>
15+
</html>
16+
);
17+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { revalidatePath } from "next/cache";
2+
import { redirect } from "next/navigation";
3+
import { cookies } from "next/headers";
4+
5+
/** Add your relevant code here for the issue to reproduce */
6+
export default function Home() {
7+
const count = cookies().get("count")?.value || "0";
8+
// console.log('render home', count);
9+
10+
return (
11+
<form>
12+
<button
13+
formAction={async () => {
14+
"use server";
15+
const count = cookies().get("count")?.value || "0";
16+
cookies().set("count", String(Number(count) + 1));
17+
}}
18+
>
19+
Count: {count}
20+
</button>
21+
<button
22+
formAction={async () => {
23+
"use server";
24+
cookies().delete("count");
25+
revalidatePath("/", "layout");
26+
redirect("/");
27+
}}
28+
>
29+
reset
30+
</button>
31+
32+
<button
33+
formAction={async () => {
34+
"use server";
35+
redirect("/");
36+
}}
37+
>
38+
to /
39+
</button>
40+
</form>
41+
);
42+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { revalidatePath } from "next/cache";
2+
import { redirect } from "next/navigation";
3+
import { cookies } from "next/headers";
4+
5+
/** Add your relevant code here for the issue to reproduce */
6+
export default function Home() {
7+
const count = cookies().get("count")?.value || "0";
8+
// console.log('render home', count);
9+
10+
return (
11+
<form>
12+
<button
13+
formAction={async () => {
14+
"use server";
15+
const count = cookies().get("count")?.value || "0";
16+
cookies().set("count", String(Number(count) + 1));
17+
}}
18+
>
19+
Count: {count}
20+
</button>
21+
<button
22+
formAction={async () => {
23+
"use server";
24+
cookies().delete("count");
25+
revalidatePath("/", "layout");
26+
redirect("/");
27+
}}
28+
>
29+
reset
30+
</button>
31+
32+
<button
33+
formAction={async () => {
34+
"use server";
35+
redirect("/p2");
36+
}}
37+
>
38+
to /p2
39+
</button>
40+
</form>
41+
);
42+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* @type {import('next').NextConfig}
3+
*/
4+
const nextConfig = {
5+
reactStrictMode: true,
6+
};
7+
8+
export default nextConfig;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"private": true,
3+
"scripts": {
4+
"dev": "next dev",
5+
"build": "next build",
6+
"start": "next start"
7+
},
8+
"dependencies": {
9+
"next": "canary",
10+
"react": "19.0.0-rc-5d19e1c8-20240923",
11+
"react-dom": "19.0.0-rc-5d19e1c8-20240923"
12+
},
13+
"devDependencies": {
14+
"@types/node": "20.12.12",
15+
"@types/react": "18.3.3",
16+
"@types/react-dom": "18.3.0",
17+
"typescript": "5.3.3"
18+
}
19+
}

0 commit comments

Comments
 (0)