From bc5b6aaf1da2a8e8cd390b61976b4bf3897104e9 Mon Sep 17 00:00:00 2001 From: Sam Ko Date: Tue, 1 Aug 2023 10:15:09 -0700 Subject: [PATCH 1/4] Switch default reproduction-template to app --- .../reproduction-template-app-dir/next-env.d.ts | 5 ----- .../.gitignore | 0 .../README.md | 11 +++++------ .../next.config.js | 3 --- .../package.json | 6 +++--- .../pages/index.tsx | 0 .../public/favicon.ico | Bin .../tsconfig.json | 9 ++------- examples/reproduction-template/README.md | 11 ++++++----- .../app/layout.tsx | 0 .../app/page.tsx | 0 examples/reproduction-template/package.json | 6 +++--- examples/reproduction-template/tsconfig.json | 9 +++++++-- 13 files changed, 26 insertions(+), 34 deletions(-) delete mode 100644 examples/reproduction-template-app-dir/next-env.d.ts rename examples/{reproduction-template-app-dir => reproduction-template-pages}/.gitignore (100%) rename examples/{reproduction-template-app-dir => reproduction-template-pages}/README.md (87%) rename examples/{reproduction-template-app-dir => reproduction-template-pages}/next.config.js (67%) rename examples/{reproduction-template-app-dir => reproduction-template-pages}/package.json (72%) rename examples/{reproduction-template => reproduction-template-pages}/pages/index.tsx (100%) rename examples/{reproduction-template-app-dir => reproduction-template-pages}/public/favicon.ico (100%) rename examples/{reproduction-template-app-dir => reproduction-template-pages}/tsconfig.json (72%) rename examples/{reproduction-template-app-dir => reproduction-template}/app/layout.tsx (100%) rename examples/{reproduction-template-app-dir => reproduction-template}/app/page.tsx (100%) diff --git a/examples/reproduction-template-app-dir/next-env.d.ts b/examples/reproduction-template-app-dir/next-env.d.ts deleted file mode 100644 index 4f11a03dc6cc3..0000000000000 --- a/examples/reproduction-template-app-dir/next-env.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/// -/// - -// NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/examples/reproduction-template-app-dir/.gitignore b/examples/reproduction-template-pages/.gitignore similarity index 100% rename from examples/reproduction-template-app-dir/.gitignore rename to examples/reproduction-template-pages/.gitignore diff --git a/examples/reproduction-template-app-dir/README.md b/examples/reproduction-template-pages/README.md similarity index 87% rename from examples/reproduction-template-app-dir/README.md rename to examples/reproduction-template-pages/README.md index d0104580e71cc..a736e34c2f66a 100644 --- a/examples/reproduction-template-app-dir/README.md +++ b/examples/reproduction-template-pages/README.md @@ -1,4 +1,4 @@ -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. +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). ## Getting Started @@ -8,22 +8,21 @@ These are the steps you should follow when creating a bug report: - 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 desireable 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`. - 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. - 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. -- Don't forget to create a new repository on GitHub and make it public so that anyone can view it and reproduce it. ## How to use this template 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: ```bash -npx create-next-app --example reproduction-template-app-dir reproduction-app +npx create-next-app --example reproduction-template reproduction-app ``` ```bash -yarn create next-app --example reproduction-template-app-dir reproduction-app +yarn create next-app --example reproduction-template reproduction-app ``` ```bash -pnpm create next-app --example reproduction-template-app-dir reproduction-app +pnpm create next-app --example reproduction-template reproduction-app ``` ## Learn More @@ -34,7 +33,7 @@ To learn more about Next.js, take a look at the following resources: - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. - [How to Contribute to Open Source (Next.js)](https://www.youtube.com/watch?v=cuoNzXFLitc) - a video tutorial by Lee Robinson - [Triaging in the Next.js repository](https://github.com/vercel/next.js/blob/canary/contributing.md#triaging) - how we work on issues -- [CodeSandbox](https://codesandbox.io/s/github/vercel/next.js/tree/canary/examples/reproduction-template-app-dir) - Edit this repository on CodeSandbox +- [CodeSandbox](https://codesandbox.io/s/github/vercel/next.js/tree/canary/examples/reproduction-template) - Edit this repository on CodeSandbox You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! diff --git a/examples/reproduction-template-app-dir/next.config.js b/examples/reproduction-template-pages/next.config.js similarity index 67% rename from examples/reproduction-template-app-dir/next.config.js rename to examples/reproduction-template-pages/next.config.js index 978d4e5ccfcb9..0e5c476c943b1 100644 --- a/examples/reproduction-template-app-dir/next.config.js +++ b/examples/reproduction-template-pages/next.config.js @@ -1,7 +1,4 @@ /** @type {import("next").NextConfig} */ module.exports = { reactStrictMode: true, - experimental: { - appDir: true, - }, } diff --git a/examples/reproduction-template-app-dir/package.json b/examples/reproduction-template-pages/package.json similarity index 72% rename from examples/reproduction-template-app-dir/package.json rename to examples/reproduction-template-pages/package.json index f47d5a6dd9da8..e1033f6cfe4f6 100644 --- a/examples/reproduction-template-app-dir/package.json +++ b/examples/reproduction-template-pages/package.json @@ -11,8 +11,8 @@ "react-dom": "^18.2.0" }, "devDependencies": { - "@types/node": "^18.11.13", - "@types/react": "^18.0.26", - "typescript": "^4.9.4" + "@types/node": "20.4.5", + "@types/react": "18.2.18", + "typescript": "5.1.3" } } diff --git a/examples/reproduction-template/pages/index.tsx b/examples/reproduction-template-pages/pages/index.tsx similarity index 100% rename from examples/reproduction-template/pages/index.tsx rename to examples/reproduction-template-pages/pages/index.tsx diff --git a/examples/reproduction-template-app-dir/public/favicon.ico b/examples/reproduction-template-pages/public/favicon.ico similarity index 100% rename from examples/reproduction-template-app-dir/public/favicon.ico rename to examples/reproduction-template-pages/public/favicon.ico diff --git a/examples/reproduction-template-app-dir/tsconfig.json b/examples/reproduction-template-pages/tsconfig.json similarity index 72% rename from examples/reproduction-template-app-dir/tsconfig.json rename to examples/reproduction-template-pages/tsconfig.json index af566b49c13e5..1563f3e878573 100644 --- a/examples/reproduction-template-app-dir/tsconfig.json +++ b/examples/reproduction-template-pages/tsconfig.json @@ -13,13 +13,8 @@ "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, - "jsx": "preserve", - "plugins": [ - { - "name": "next" - } - ] + "jsx": "preserve" }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], "exclude": ["node_modules"] } diff --git a/examples/reproduction-template/README.md b/examples/reproduction-template/README.md index a736e34c2f66a..d0104580e71cc 100644 --- a/examples/reproduction-template/README.md +++ b/examples/reproduction-template/README.md @@ -1,4 +1,4 @@ -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). +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. ## Getting Started @@ -8,21 +8,22 @@ These are the steps you should follow when creating a bug report: - 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 desireable 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`. - 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. - 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. +- Don't forget to create a new repository on GitHub and make it public so that anyone can view it and reproduce it. ## How to use this template 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: ```bash -npx create-next-app --example reproduction-template reproduction-app +npx create-next-app --example reproduction-template-app-dir reproduction-app ``` ```bash -yarn create next-app --example reproduction-template reproduction-app +yarn create next-app --example reproduction-template-app-dir reproduction-app ``` ```bash -pnpm create next-app --example reproduction-template reproduction-app +pnpm create next-app --example reproduction-template-app-dir reproduction-app ``` ## Learn More @@ -33,7 +34,7 @@ To learn more about Next.js, take a look at the following resources: - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. - [How to Contribute to Open Source (Next.js)](https://www.youtube.com/watch?v=cuoNzXFLitc) - a video tutorial by Lee Robinson - [Triaging in the Next.js repository](https://github.com/vercel/next.js/blob/canary/contributing.md#triaging) - how we work on issues -- [CodeSandbox](https://codesandbox.io/s/github/vercel/next.js/tree/canary/examples/reproduction-template) - Edit this repository on CodeSandbox +- [CodeSandbox](https://codesandbox.io/s/github/vercel/next.js/tree/canary/examples/reproduction-template-app-dir) - Edit this repository on CodeSandbox You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! diff --git a/examples/reproduction-template-app-dir/app/layout.tsx b/examples/reproduction-template/app/layout.tsx similarity index 100% rename from examples/reproduction-template-app-dir/app/layout.tsx rename to examples/reproduction-template/app/layout.tsx diff --git a/examples/reproduction-template-app-dir/app/page.tsx b/examples/reproduction-template/app/page.tsx similarity index 100% rename from examples/reproduction-template-app-dir/app/page.tsx rename to examples/reproduction-template/app/page.tsx diff --git a/examples/reproduction-template/package.json b/examples/reproduction-template/package.json index f47d5a6dd9da8..e1033f6cfe4f6 100644 --- a/examples/reproduction-template/package.json +++ b/examples/reproduction-template/package.json @@ -11,8 +11,8 @@ "react-dom": "^18.2.0" }, "devDependencies": { - "@types/node": "^18.11.13", - "@types/react": "^18.0.26", - "typescript": "^4.9.4" + "@types/node": "20.4.5", + "@types/react": "18.2.18", + "typescript": "5.1.3" } } diff --git a/examples/reproduction-template/tsconfig.json b/examples/reproduction-template/tsconfig.json index 1563f3e878573..af566b49c13e5 100644 --- a/examples/reproduction-template/tsconfig.json +++ b/examples/reproduction-template/tsconfig.json @@ -13,8 +13,13 @@ "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, - "jsx": "preserve" + "jsx": "preserve", + "plugins": [ + { + "name": "next" + } + ] }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], "exclude": ["node_modules"] } From 0eb2c1cd944676929681ddf15a42f84dccf4620b Mon Sep 17 00:00:00 2001 From: Sam Ko Date: Tue, 1 Aug 2023 10:27:20 -0700 Subject: [PATCH 2/4] Update README.md --- examples/reproduction-template-pages/README.md | 6 +++--- examples/reproduction-template/README.md | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/reproduction-template-pages/README.md b/examples/reproduction-template-pages/README.md index a736e34c2f66a..f334dc8a102c7 100644 --- a/examples/reproduction-template-pages/README.md +++ b/examples/reproduction-template-pages/README.md @@ -14,15 +14,15 @@ These are the steps you should follow when creating a bug report: 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: ```bash -npx create-next-app --example reproduction-template reproduction-app +npx create-next-app --example reproduction-template-pages reproduction-app ``` ```bash -yarn create next-app --example reproduction-template reproduction-app +yarn create next-app --example reproduction-template-pages reproduction-app ``` ```bash -pnpm create next-app --example reproduction-template reproduction-app +pnpm create next-app --example reproduction-template-pages reproduction-app ``` ## Learn More diff --git a/examples/reproduction-template/README.md b/examples/reproduction-template/README.md index d0104580e71cc..51df0e31628f3 100644 --- a/examples/reproduction-template/README.md +++ b/examples/reproduction-template/README.md @@ -15,15 +15,15 @@ These are the steps you should follow when creating a bug report: 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: ```bash -npx create-next-app --example reproduction-template-app-dir reproduction-app +npx create-next-app --example reproduction-template reproduction-app ``` ```bash -yarn create next-app --example reproduction-template-app-dir reproduction-app +yarn create next-app --example reproduction-template reproduction-app ``` ```bash -pnpm create next-app --example reproduction-template-app-dir reproduction-app +pnpm create next-app --example reproduction-template reproduction-app ``` ## Learn More @@ -42,4 +42,4 @@ You can check out [the Next.js GitHub repository](https://github.com/vercel/next 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. -Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. +Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. From b130d154906e63ef47263384933e210b2fe88329 Mon Sep 17 00:00:00 2001 From: Sam Ko Date: Tue, 1 Aug 2023 11:00:11 -0700 Subject: [PATCH 3/4] Update examples/reproduction-template/README.md Co-authored-by: Steven --- examples/reproduction-template/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/reproduction-template/README.md b/examples/reproduction-template/README.md index 51df0e31628f3..8ee8bea486387 100644 --- a/examples/reproduction-template/README.md +++ b/examples/reproduction-template/README.md @@ -34,7 +34,7 @@ To learn more about Next.js, take a look at the following resources: - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. - [How to Contribute to Open Source (Next.js)](https://www.youtube.com/watch?v=cuoNzXFLitc) - a video tutorial by Lee Robinson - [Triaging in the Next.js repository](https://github.com/vercel/next.js/blob/canary/contributing.md#triaging) - how we work on issues -- [CodeSandbox](https://codesandbox.io/s/github/vercel/next.js/tree/canary/examples/reproduction-template-app-dir) - Edit this repository on CodeSandbox +- [CodeSandbox](https://codesandbox.io/s/github/vercel/next.js/tree/canary/examples/reproduction-template) - Edit this repository on CodeSandbox You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! From 2c9446b4e79b69c097d5c1421263878c7507e695 Mon Sep 17 00:00:00 2001 From: Sam Ko Date: Tue, 1 Aug 2023 11:01:54 -0700 Subject: [PATCH 4/4] Update reproduction-template-pages/README.md --- examples/reproduction-template-pages/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/reproduction-template-pages/README.md b/examples/reproduction-template-pages/README.md index f334dc8a102c7..0f3b078b0fd23 100644 --- a/examples/reproduction-template-pages/README.md +++ b/examples/reproduction-template-pages/README.md @@ -33,7 +33,7 @@ To learn more about Next.js, take a look at the following resources: - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. - [How to Contribute to Open Source (Next.js)](https://www.youtube.com/watch?v=cuoNzXFLitc) - a video tutorial by Lee Robinson - [Triaging in the Next.js repository](https://github.com/vercel/next.js/blob/canary/contributing.md#triaging) - how we work on issues -- [CodeSandbox](https://codesandbox.io/s/github/vercel/next.js/tree/canary/examples/reproduction-template) - Edit this repository on CodeSandbox +- [CodeSandbox](https://codesandbox.io/s/github/vercel/next.js/tree/canary/examples/reproduction-template-pages) - Edit this repository on CodeSandbox You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!