From 88b6c472447052f080bb8e510bc015cff9e40714 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Mon, 4 Jan 2021 02:58:52 -0600 Subject: [PATCH 01/38] Ensure isReady is set correctly for auto static dynamic route (#20729) Follow-up to https://github.com/vercel/next.js/pull/20628 this ensures `isReady` is not initially true when the query isn't present but the page is an automatically statically optimized dynamic route --- packages/next/next-server/lib/router/router.ts | 8 +++++--- .../build-output/test/index.test.js | 2 +- .../{auto-export.js => auto-export/[slug].js} | 0 .../router-is-ready/pages/auto-export/index.js | 18 ++++++++++++++++++ .../router-is-ready/test/index.test.js | 10 ++++++++++ 5 files changed, 34 insertions(+), 4 deletions(-) rename test/integration/router-is-ready/pages/{auto-export.js => auto-export/[slug].js} (100%) create mode 100644 test/integration/router-is-ready/pages/auto-export/index.js diff --git a/packages/next/next-server/lib/router/router.ts b/packages/next/next-server/lib/router/router.ts index 1208d86e4e08a..00958c73dc5aa 100644 --- a/packages/next/next-server/lib/router/router.ts +++ b/packages/next/next-server/lib/router/router.ts @@ -535,8 +535,10 @@ export default class Router implements BaseRouter { this.query = query // if auto prerendered and dynamic route wait to update asPath // until after mount to prevent hydration mismatch - this.asPath = - isDynamicRoute(pathname) && self.__NEXT_DATA__.autoExport ? pathname : as + const autoExportDynamic = + isDynamicRoute(pathname) && self.__NEXT_DATA__.autoExport + + this.asPath = autoExportDynamic ? pathname : as this.basePath = basePath this.sub = subscription this.clc = null @@ -550,7 +552,7 @@ export default class Router implements BaseRouter { this.isReady = !!( self.__NEXT_DATA__.gssp || self.__NEXT_DATA__.gip || - !self.location.search + (!autoExportDynamic && !self.location.search) ) if (process.env.__NEXT_I18N_SUPPORT) { diff --git a/test/integration/build-output/test/index.test.js b/test/integration/build-output/test/index.test.js index 208060cb80e12..36efddc1d58f1 100644 --- a/test/integration/build-output/test/index.test.js +++ b/test/integration/build-output/test/index.test.js @@ -101,7 +101,7 @@ describe('Build Output', () => { expect(parseFloat(err404Size) - 3.7).toBeLessThanOrEqual(0) expect(err404Size.endsWith('kB')).toBe(true) - expect(parseFloat(err404FirstLoad)).toBeCloseTo(65.4, 1) + expect(parseFloat(err404FirstLoad)).toBeCloseTo(65.5, 1) expect(err404FirstLoad.endsWith('kB')).toBe(true) expect(parseFloat(sharedByAll)).toBeCloseTo(62, 1) diff --git a/test/integration/router-is-ready/pages/auto-export.js b/test/integration/router-is-ready/pages/auto-export/[slug].js similarity index 100% rename from test/integration/router-is-ready/pages/auto-export.js rename to test/integration/router-is-ready/pages/auto-export/[slug].js diff --git a/test/integration/router-is-ready/pages/auto-export/index.js b/test/integration/router-is-ready/pages/auto-export/index.js new file mode 100644 index 0000000000000..f325029ae5880 --- /dev/null +++ b/test/integration/router-is-ready/pages/auto-export/index.js @@ -0,0 +1,18 @@ +import { useRouter } from 'next/router' + +export default function Page(props) { + const router = useRouter() + + if (typeof window !== 'undefined') { + if (!window.isReadyValues) { + window.isReadyValues = [] + } + window.isReadyValues.push(router.isReady) + } + + return ( + <> +

auto-export page

+ + ) +} diff --git a/test/integration/router-is-ready/test/index.test.js b/test/integration/router-is-ready/test/index.test.js index b2a9509e52a02..659b4decd1bb4 100644 --- a/test/integration/router-is-ready/test/index.test.js +++ b/test/integration/router-is-ready/test/index.test.js @@ -49,6 +49,16 @@ function runTests(isDev) { expect(await browser.eval('window.isReadyValues')).toEqual([false, true]) }) + it('isReady should be true after query update for dynamic auto-export page without query', async () => { + const browser = await webdriver(appPort, '/auto-export/first') + expect(await browser.eval('window.isReadyValues')).toEqual([false, true]) + }) + + it('isReady should be true after query update for dynamic auto-export page with query', async () => { + const browser = await webdriver(appPort, '/auto-export/first?hello=true') + expect(await browser.eval('window.isReadyValues')).toEqual([false, true]) + }) + it('isReady should be true after query update for getStaticProps page with query', async () => { const browser = await webdriver(appPort, '/gsp?hello=world') expect(await browser.eval('window.isReadyValues')).toEqual([false, true]) From 9a0d704f763413f03575b3fd0236e49d0fd5f57e Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Mon, 4 Jan 2021 10:42:57 +0100 Subject: [PATCH 02/38] Clarify how to use Environment Variables on Vercel (#20708) Updates the env documentation to mention `.vercelignore` when using the Vercel CLI. Also clears up parts of the other paragraphs and updates the links as these topics now have dedicated pages in the Vercel docs. --- docs/basic-features/environment-variables.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/basic-features/environment-variables.md b/docs/basic-features/environment-variables.md index 68d1629a666c7..9a155be3f32df 100644 --- a/docs/basic-features/environment-variables.md +++ b/docs/basic-features/environment-variables.md @@ -109,16 +109,18 @@ Next.js allows you to set defaults in `.env` (all environments), `.env.developme ## Environment Variables on Vercel -When deploying on [Vercel](https://vercel.com) you can configure secrets in the [Environment Variables](https://vercel.com/docs/v2/build-step#environment-variables) section of the project in the Vercel dashboard. +When deploying your Next.js application to [Vercel](https://vercel.com), Environment Variables can be configured [in the Project Settings](https://vercel.com/docs/environment-variables). -You can still use `.env`, `.env.development` and `.env.production` to add defaults. +All types of Environment Variables should be configured there. Even Environment Variables used in Development – which can be [downloaded onto your local device](https://vercel.com/docs/environment-variables#development-environment-variables) afterwards. -If you've configured [Development Environment Variables](https://vercel.com/docs/v2/build-step#development-environment-variables) you can pull them into a `.env.local` for usage on your local machine using the following command: +If you've configured [Development Environment Variables](https://vercel.com/docs/environment-variables#development-environment-variables) you can pull them into a `.env.local` for usage on your local machine using the following command: ```bash vercel env pull .env.local ``` +When using the Vercel CLI to deploy make sure you add a [`.vercelignore`](https://vercel.com/guides/prevent-uploading-sourcepaths-with-vercelignore?query=vercelignore#allowlist) that includes files that should not be uploaded, generally these are the same files included in `.gitignore`. + ## Test Environment Variables Apart from `development` and `production` environments, there is a 3rd option available: `test`. In the same way you can set defaults for development or production environments, you can do the same with `.env.test` file for testing environment (though this one is not so common as the previous two). From 74166ea7e802f5b5fd1d74a5a3f097bcda11ea59 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 4 Jan 2021 10:45:57 +0100 Subject: [PATCH 03/38] Remove outdated documentation (#20714) Fixes #20487 --- .../next.config.js/build-target.md | 47 ------------------- .../next.config.js/compression.md | 2 +- docs/manifest.json | 4 -- 3 files changed, 1 insertion(+), 52 deletions(-) delete mode 100644 docs/api-reference/next.config.js/build-target.md diff --git a/docs/api-reference/next.config.js/build-target.md b/docs/api-reference/next.config.js/build-target.md deleted file mode 100644 index 3de94984c77b0..0000000000000 --- a/docs/api-reference/next.config.js/build-target.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -description: Learn more about the build targets used by Next.js, which decide the way your application is built and run. ---- - -# Build Target - -Next.js supports various build targets, each changing the way your application is built and run. We'll explain each of the targets below. - -## `server` target - -> This is the default target, however, we highly recommend the [`serverless` target](#serverless-target). The `serverless` target enforces [additional constraints](https://rauchg.com/2020/2019-in-review#serverless-upgrades-itself) to keep you in the [Pit of Success](https://blog.codinghorror.com/falling-into-the-pit-of-success/). - -This target is compatible with both `next start` and [custom server](/docs/advanced-features/custom-server.md) setups (it's mandatory for a custom server). - -Your application will be built and deployed as a monolith. This is the default target and no action is required on your part to opt-in. - -## `serverless` target - -> Deployments to [Vercel](https://vercel.com) will automatically enable this target. You should not opt-into it yourself. - -This target will output independent pages that don't require a monolithic server. - -It's only compatible with `next start` or Serverless deployment platforms (like [Vercel](https://vercel.com)) — you cannot use the custom server API. - -To opt-into this target, set the following configuration in your `next.config.js`: - -```js -module.exports = { - target: 'serverless', -} -``` - -## Related - - - - diff --git a/docs/api-reference/next.config.js/compression.md b/docs/api-reference/next.config.js/compression.md index c20ebe798e1c7..6947040d2ec01 100644 --- a/docs/api-reference/next.config.js/compression.md +++ b/docs/api-reference/next.config.js/compression.md @@ -4,7 +4,7 @@ description: Next.js provides gzip compression to compress rendered content and # Compression -Next.js provides [**gzip**](https://tools.ietf.org/html/rfc6713#section-3) compression to compress rendered content and static files. Compression only works with the [`server` target](/docs/api-reference/next.config.js/build-target.md#server-target). In general you will want to enable compression on a HTTP proxy like [nginx](https://www.nginx.com/), to offload load from the `Node.js` process. +Next.js provides [**gzip**](https://tools.ietf.org/html/rfc6713#section-3) compression to compress rendered content and static files. In general you will want to enable compression on a HTTP proxy like [nginx](https://www.nginx.com/), to offload load from the `Node.js` process. To disable **compression**, open `next.config.js` and disable the `compress` config: diff --git a/docs/manifest.json b/docs/manifest.json index 140527683c976..6f248588ba11f 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -292,10 +292,6 @@ "title": "CDN Support with Asset Prefix", "path": "/docs/api-reference/next.config.js/cdn-support-with-asset-prefix.md" }, - { - "title": "Build Target", - "path": "/docs/api-reference/next.config.js/build-target.md" - }, { "title": "Custom Webpack Config", "path": "/docs/api-reference/next.config.js/custom-webpack-config.md" From 7076758c8d0534a7745bc7f6142d0ac85d9e5a7b Mon Sep 17 00:00:00 2001 From: Alexander Kachkaev Date: Mon, 4 Jan 2021 10:14:15 +0000 Subject: [PATCH 04/38] Call res.write('') inside apiRes.redirect() helper to prevent an edge case (#20461) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR is a small follow-up to #14705. It saves Next.js users from falling into a [pretty nasty trap](https://github.com/nodejs/node/issues/36620) in which I ended up last Friday. It took more than two days to investigate what was going on, so I hope I'm the last person who’s doing it 😅 Next.js-specific MWE: https://github.com/kachkaev/hanging-response-in-next-via-redirect-plus-compression (needs to be ran locally using Node 14.0.0+). > Screenshot 2020-12-24 at 20 50 00 To reproduce the bug I’m fixing: 1. Pick a large http body size (64 or 128 KB) 1. Check _Call res.end() after res.redirect() in /api/redirect_ 1. Navigate to a heavy page or an api handler via redirect 1. Observe that the http response is never finished. If you set `compress` to `false` in `next.config.js` or pick a small payload size (< `zlib.Z_DEFAULT_CHUNK` after compression), the bug will not be observed. This is explained by the use of `res.on("drain", ...)` [by the `compression` package](https://github.com/expressjs/compression/blob/3fea81d0eaed1eb872bf3e0405f20d9e175ab2cf/index.js#L193-L218). The package itself is not the reason for an issue though, it seems to be in the Node’s built-in `http` package. I’m happy to provide more info or GitHub CI to the MWE if needed. I was also thinking of adding some Next.js-specific testing, but could not come up with a compact and clear test plan. Happy to do this if there are any ideas. cc @botv (author of #14705) --- packages/next/next-server/server/api-utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/next/next-server/server/api-utils.ts b/packages/next/next-server/server/api-utils.ts index 8436622fa74e7..f04176eb33d96 100644 --- a/packages/next/next-server/server/api-utils.ts +++ b/packages/next/next-server/server/api-utils.ts @@ -212,7 +212,9 @@ export function redirect( `Invalid redirect arguments. Please use a single argument URL, e.g. res.redirect('/destination') or use a status code and URL, e.g. res.redirect(307, '/destination').` ) } - res.writeHead(statusOrUrl, { Location: url }).end() + res.writeHead(statusOrUrl, { Location: url }) + res.write('') + res.end() return res } From 4a296d55eb6b3a391796b69692d951b8100b7018 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 4 Jan 2021 11:30:35 +0100 Subject: [PATCH 05/38] Create bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000000000..af468c75278a3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,44 @@ +name: Bug Report +about: Create a bug report for the Next.js core / examples +title: "" +labels: "template: bug" +issue_body: true +inputs: +- type: description + attributes: + value: Thanks for taking the time to file a bug report! Please fill out this form as completely as possible. +- type: input + attributes: + label: What version of Next.js are you using? [e.g. 10.0.1] + required: true +- type: input + attributes: + label: What version of Node.js are you using? [e.g. 12.0.0] + required: true +- type: input + attributes: + label: What browser are you using? [e.g. Chrome, Safari] + required: true +- type: input + attributes: + label: What operating system are you using? [e.g. macOS, Windows] + required: true +- type: input + attributes: + label: How are you deploying your application? [e.g. next start, next export, Vercel, Other platform] + required: true +- type: textarea + attributes: + label: Describe the Bug + description: A clear and concise description of what the bug is. + required: true +- type: textarea + attributes: + label: Expected Behavior + description: A clear and concise description of what you expected to happen. + required: true +- type: textarea + attributes: + label: To Reproduce + description: Steps to reproduce the behavior, please provide a clear code snippets that always reproduces the issue or a GitHub repository. + required: true From 6c4ee56ec9d89de825b9d77f3dcdbe4e09f1954c Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 4 Jan 2021 11:35:30 +0100 Subject: [PATCH 06/38] Update bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index af468c75278a3..cbc804a814fa9 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -9,23 +9,28 @@ inputs: value: Thanks for taking the time to file a bug report! Please fill out this form as completely as possible. - type: input attributes: - label: What version of Next.js are you using? [e.g. 10.0.1] + label: What version of Next.js are you using? + description: For example: 10.0.1 required: true - type: input attributes: - label: What version of Node.js are you using? [e.g. 12.0.0] + label: What version of Node.js are you using? + description: For example: 12.0.0 required: true - type: input attributes: - label: What browser are you using? [e.g. Chrome, Safari] + label: What browser are you using? + description: For example: Chrome, Safari required: true - type: input attributes: - label: What operating system are you using? [e.g. macOS, Windows] + label: What operating system are you using? + description: For example: macOS, Windows required: true - type: input attributes: - label: How are you deploying your application? [e.g. next start, next export, Vercel, Other platform] + label: How are you deploying your application? + description: For example: next start, next export, Vercel, Other platform required: true - type: textarea attributes: @@ -40,5 +45,5 @@ inputs: - type: textarea attributes: label: To Reproduce - description: Steps to reproduce the behavior, please provide a clear code snippets that always reproduces the issue or a GitHub repository. + description: Steps to reproduce the behavior, please provide a clear code snippets that always reproduces the issue or a GitHub repository. Screenshots can be provided in the issue body below. required: true From 5cb8aee415d82d43f817586ad4ef81d600012fdc Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 4 Jan 2021 11:35:53 +0100 Subject: [PATCH 07/38] Update bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index cbc804a814fa9..d98744f13ed57 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -10,12 +10,12 @@ inputs: - type: input attributes: label: What version of Next.js are you using? - description: For example: 10.0.1 + description: "For example: 10.0.1" required: true - type: input attributes: label: What version of Node.js are you using? - description: For example: 12.0.0 + description: "For example: 12.0.0" required: true - type: input attributes: From febb06558fbf02394eab1e4d354eafeba9f87b67 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 4 Jan 2021 11:36:35 +0100 Subject: [PATCH 08/38] Update bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index d98744f13ed57..2ad834c8a43ea 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -20,17 +20,17 @@ inputs: - type: input attributes: label: What browser are you using? - description: For example: Chrome, Safari + description: "For example: Chrome, Safari" required: true - type: input attributes: label: What operating system are you using? - description: For example: macOS, Windows + description: "For example: macOS, Windows" required: true - type: input attributes: label: How are you deploying your application? - description: For example: next start, next export, Vercel, Other platform + description: "For example: next start, next export, Vercel, Other platform" required: true - type: textarea attributes: From ecafd218c7d2be54199f7a25d94ca6082df861f4 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 4 Jan 2021 11:36:47 +0100 Subject: [PATCH 09/38] Update bug_report.yml From a61ba7b0d1b86d1983d28aada9a741c1957b9016 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 4 Jan 2021 11:39:49 +0100 Subject: [PATCH 10/38] Update bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 2ad834c8a43ea..417353f17671f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -47,3 +47,4 @@ inputs: label: To Reproduce description: Steps to reproduce the behavior, please provide a clear code snippets that always reproduces the issue or a GitHub repository. Screenshots can be provided in the issue body below. required: true + value: "1. Go to '...'\n2. Click on '....'\n3. Scroll down to '....'\n4. See error" From 8085e69ca901ef95c3601d8fac2d9104c003268d Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 4 Jan 2021 12:38:17 +0100 Subject: [PATCH 11/38] Rename bug_report.yml to 1.bug_report.yml --- .github/ISSUE_TEMPLATE/{bug_report.yml => 1.bug_report.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/ISSUE_TEMPLATE/{bug_report.yml => 1.bug_report.yml} (100%) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/1.bug_report.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/bug_report.yml rename to .github/ISSUE_TEMPLATE/1.bug_report.yml From b7b4e4d4557474f4ed8c1cd290c3cfe5b8dca69f Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 4 Jan 2021 12:39:13 +0100 Subject: [PATCH 12/38] Delete 1.Bug_report.md This file has been replaced by the bug-report issue template --- .github/ISSUE_TEMPLATE/1.Bug_report.md | 42 -------------------------- 1 file changed, 42 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/1.Bug_report.md diff --git a/.github/ISSUE_TEMPLATE/1.Bug_report.md b/.github/ISSUE_TEMPLATE/1.Bug_report.md deleted file mode 100644 index 9488cca282ec9..0000000000000 --- a/.github/ISSUE_TEMPLATE/1.Bug_report.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -name: Bug report -about: Create a bug report for the Next.js core / examples -labels: 'template: bug' ---- - - - -# Bug report - -## Describe the bug - -A clear and concise description of what the bug is. - -## To Reproduce - -Steps to reproduce the behavior, please provide code snippets or a repository: - -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -## Expected behavior - -A clear and concise description of what you expected to happen. - -## Screenshots - -If applicable, add screenshots to help explain your problem. - -## System information - -- OS: [e.g. macOS, Windows] -- Browser (if applies) [e.g. chrome, safari] -- Version of Next.js: [e.g. 10.0.1] -- Version of Node.js: [e.g. 12.0.0] -- Deployment: [e.g. next start, next export, Vercel, other platform] - -## Additional context - -Add any other context about the problem here. From 7c5565152693fdbc354c89ea65fa81a137bd611a Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 4 Jan 2021 12:40:36 +0100 Subject: [PATCH 13/38] Update 1.bug_report.yml --- .github/ISSUE_TEMPLATE/1.bug_report.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/1.bug_report.yml b/.github/ISSUE_TEMPLATE/1.bug_report.yml index 417353f17671f..2ad834c8a43ea 100644 --- a/.github/ISSUE_TEMPLATE/1.bug_report.yml +++ b/.github/ISSUE_TEMPLATE/1.bug_report.yml @@ -47,4 +47,3 @@ inputs: label: To Reproduce description: Steps to reproduce the behavior, please provide a clear code snippets that always reproduces the issue or a GitHub repository. Screenshots can be provided in the issue body below. required: true - value: "1. Go to '...'\n2. Click on '....'\n3. Scroll down to '....'\n4. See error" From e8e35a8ca51b0f87c654be76b90f1fd41fec620e Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 4 Jan 2021 12:44:27 +0100 Subject: [PATCH 14/38] Create 2.feature_request.yml --- .github/ISSUE_TEMPLATE/2.feature_request.yml | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/2.feature_request.yml diff --git a/.github/ISSUE_TEMPLATE/2.feature_request.yml b/.github/ISSUE_TEMPLATE/2.feature_request.yml new file mode 100644 index 0000000000000..c24995c7d8faa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/2.feature_request.yml @@ -0,0 +1,24 @@ +name: Feature Request +about: Create a feature request for the Next.js core +title: "" +labels: "template: story" +issue_body: true +inputs: +- type: description + attributes: + value: Thanks for taking the time to file a feature request! Please fill out this form as completely as possible. +- type: textarea + attributes: + label: Describe the feature you'd like to request + description: A clear and concise description of what you want and what your use case is. + required: true +- type: textarea + attributes: + label: Describe the solution you'd like + description: A clear and concise description of what you want to happen. + required: true +- type: textarea + attributes: + label: Describe alternatives you've considered + description: A clear and concise description of any alternative solutions or features you've considered. + required: true From 9c174c0db0bedf705b419cdb5bf04b2214f8cef5 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 4 Jan 2021 12:47:54 +0100 Subject: [PATCH 15/38] Update 2.feature_request.yml --- .github/ISSUE_TEMPLATE/2.feature_request.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/2.feature_request.yml b/.github/ISSUE_TEMPLATE/2.feature_request.yml index c24995c7d8faa..c158914994cbe 100644 --- a/.github/ISSUE_TEMPLATE/2.feature_request.yml +++ b/.github/ISSUE_TEMPLATE/2.feature_request.yml @@ -7,6 +7,9 @@ inputs: - type: description attributes: value: Thanks for taking the time to file a feature request! Please fill out this form as completely as possible. +- type: description + attributes: + value: "Feature requests will be converted to the GitHub Discussions \"Ideas\" section." - type: textarea attributes: label: Describe the feature you'd like to request From d98481d5615a761cf908ad6f3d74b90d79497cf6 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 4 Jan 2021 12:48:45 +0100 Subject: [PATCH 16/38] Delete 2.Feature_request.md --- .github/ISSUE_TEMPLATE/2.Feature_request.md | 25 --------------------- 1 file changed, 25 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/2.Feature_request.md diff --git a/.github/ISSUE_TEMPLATE/2.Feature_request.md b/.github/ISSUE_TEMPLATE/2.Feature_request.md deleted file mode 100644 index 67ac9a7fb2f1b..0000000000000 --- a/.github/ISSUE_TEMPLATE/2.Feature_request.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -name: Feature request -about: Create a feature request for the Next.js core -labels: 'template: story' ---- - - - -# Feature request - -## Is your feature request related to a problem? Please describe. - -A clear and concise description of what you want and what your use case is. - -## Describe the solution you'd like - -A clear and concise description of what you want to happen. - -## Describe alternatives you've considered - -A clear and concise description of any alternative solutions or features you've considered. - -## Additional context - -Add any other context or screenshots about the feature request here. From 89aab7dd90777d41a3b4a07d6e5648a3fc755d62 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 4 Jan 2021 12:58:25 +0100 Subject: [PATCH 17/38] Update 1.bug_report.yml --- .github/ISSUE_TEMPLATE/1.bug_report.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/1.bug_report.yml b/.github/ISSUE_TEMPLATE/1.bug_report.yml index 2ad834c8a43ea..0aba35d1fe134 100644 --- a/.github/ISSUE_TEMPLATE/1.bug_report.yml +++ b/.github/ISSUE_TEMPLATE/1.bug_report.yml @@ -7,6 +7,9 @@ inputs: - type: description attributes: value: Thanks for taking the time to file a bug report! Please fill out this form as completely as possible. +- type: description + attributes: + value: If you leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Help" section. - type: input attributes: label: What version of Next.js are you using? @@ -47,3 +50,6 @@ inputs: label: To Reproduce description: Steps to reproduce the behavior, please provide a clear code snippets that always reproduces the issue or a GitHub repository. Screenshots can be provided in the issue body below. required: true +- type: description + attributes: + value: Before posting the issue go through the steps you've written down to make sure the steps provided are detailed and clear. Contributors should be able to follow the steps provided in order to reproduce the bug. These steps are used to add integration tests to ensure the same issue does not happen again. Thanks in advance! From ed78ee8187eff03ee4e703df5f706760f7562d9f Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 4 Jan 2021 13:00:29 +0100 Subject: [PATCH 18/38] Update 1.bug_report.yml --- .github/ISSUE_TEMPLATE/1.bug_report.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/1.bug_report.yml b/.github/ISSUE_TEMPLATE/1.bug_report.yml index 0aba35d1fe134..4e11d7c2ee443 100644 --- a/.github/ISSUE_TEMPLATE/1.bug_report.yml +++ b/.github/ISSUE_TEMPLATE/1.bug_report.yml @@ -53,3 +53,11 @@ inputs: - type: description attributes: value: Before posting the issue go through the steps you've written down to make sure the steps provided are detailed and clear. Contributors should be able to follow the steps provided in order to reproduce the bug. These steps are used to add integration tests to ensure the same issue does not happen again. Thanks in advance! +- type: description + attributes: + value: Contributors should be able to follow the steps provided in order to reproduce the bug. +- type: description + attributes: + value: These steps are used to add integration tests to ensure the same issue does not happen again. Thanks in advance! + + From cbb45205a3902a224d1865b1d2c1779530533d08 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 4 Jan 2021 13:00:57 +0100 Subject: [PATCH 19/38] Update 1.bug_report.yml --- .github/ISSUE_TEMPLATE/1.bug_report.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/1.bug_report.yml b/.github/ISSUE_TEMPLATE/1.bug_report.yml index 4e11d7c2ee443..076ddd0f39e3f 100644 --- a/.github/ISSUE_TEMPLATE/1.bug_report.yml +++ b/.github/ISSUE_TEMPLATE/1.bug_report.yml @@ -52,8 +52,7 @@ inputs: required: true - type: description attributes: - value: Before posting the issue go through the steps you've written down to make sure the steps provided are detailed and clear. Contributors should be able to follow the steps provided in order to reproduce the bug. These steps are used to add integration tests to ensure the same issue does not happen again. Thanks in advance! -- type: description + value: Before posting the issue go through the steps you've written down to make sure the steps provided are detailed and clear. attributes: value: Contributors should be able to follow the steps provided in order to reproduce the bug. - type: description From 62a1f1b74702652cf51c6555877e5aa32faa2b5c Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 4 Jan 2021 13:02:06 +0100 Subject: [PATCH 20/38] Update 1.bug_report.yml --- .github/ISSUE_TEMPLATE/1.bug_report.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/ISSUE_TEMPLATE/1.bug_report.yml b/.github/ISSUE_TEMPLATE/1.bug_report.yml index 076ddd0f39e3f..243e96b551a0c 100644 --- a/.github/ISSUE_TEMPLATE/1.bug_report.yml +++ b/.github/ISSUE_TEMPLATE/1.bug_report.yml @@ -53,6 +53,7 @@ inputs: - type: description attributes: value: Before posting the issue go through the steps you've written down to make sure the steps provided are detailed and clear. +- type: description attributes: value: Contributors should be able to follow the steps provided in order to reproduce the bug. - type: description From 54cc9fcf47a370d8cbc5b7d0373b9f746164e2e1 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 4 Jan 2021 13:49:37 +0100 Subject: [PATCH 21/38] Create 3.example_bug_report.yml --- .../ISSUE_TEMPLATE/3.example_bug_report.yml | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/3.example_bug_report.yml diff --git a/.github/ISSUE_TEMPLATE/3.example_bug_report.yml b/.github/ISSUE_TEMPLATE/3.example_bug_report.yml new file mode 100644 index 0000000000000..e1a35cd481924 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/3.example_bug_report.yml @@ -0,0 +1,66 @@ +name: Example Bug Report +about: Create a bug report for the examples +title: "" +labels: "type: example,template: bug" +issue_body: true +inputs: +- type: description + attributes: + value: Thanks for taking the time to file a examples bug report! Please fill out this form as completely as possible. +- type: description + attributes: + value: If you leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Help" section. +- type: input + attributes: + label: What example does this report relate to? + description: "For example: with-styled-components" + required: true +- type: input + attributes: + label: What version of Next.js are you using? + description: "For example: 10.0.1" + required: true +- type: input + attributes: + label: What version of Node.js are you using? + description: "For example: 12.0.0" + required: true +- type: input + attributes: + label: What browser are you using? + description: "For example: Chrome, Safari" + required: true +- type: input + attributes: + label: What operating system are you using? + description: "For example: macOS, Windows" + required: true +- type: input + attributes: + label: How are you deploying your application? + description: "For example: next start, next export, Vercel, Other platform" + required: true +- type: textarea + attributes: + label: Describe the Bug + description: A clear and concise description of what the bug is. + required: true +- type: textarea + attributes: + label: Expected Behavior + description: A clear and concise description of what you expected to happen. + required: true +- type: textarea + attributes: + label: To Reproduce + description: Steps to reproduce the behavior, please provide a clear code snippets that always reproduces the issue or a GitHub repository. Screenshots can be provided in the issue body below. + required: true +- type: description + attributes: + value: Before posting the issue go through the steps you've written down to make sure the steps provided are detailed and clear. +- type: description + attributes: + value: Contributors should be able to follow the steps provided in order to reproduce the bug. +- type: description + attributes: + value: Thanks in advance! From de752b36a9a8c8b0e0dab0bda58d67236e061e4b Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 4 Jan 2021 13:50:06 +0100 Subject: [PATCH 22/38] Update 1.bug_report.yml --- .github/ISSUE_TEMPLATE/1.bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/1.bug_report.yml b/.github/ISSUE_TEMPLATE/1.bug_report.yml index 243e96b551a0c..cb1595a723331 100644 --- a/.github/ISSUE_TEMPLATE/1.bug_report.yml +++ b/.github/ISSUE_TEMPLATE/1.bug_report.yml @@ -1,5 +1,5 @@ name: Bug Report -about: Create a bug report for the Next.js core / examples +about: Create a bug report for the Next.js core title: "" labels: "template: bug" issue_body: true From 66be9c7a0eff4d80a9726e0f4f864de05778151b Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 4 Jan 2021 13:52:30 +0100 Subject: [PATCH 23/38] Change order of templates --- .../ISSUE_TEMPLATE/2.example_bug_report.yml | 66 +++++++++++++++++++ .github/ISSUE_TEMPLATE/2.feature_request.yml | 27 -------- .../ISSUE_TEMPLATE/3.example_bug_report.yml | 66 ------------------- .github/ISSUE_TEMPLATE/3.feature_request.yml | 27 ++++++++ 4 files changed, 93 insertions(+), 93 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/2.example_bug_report.yml delete mode 100644 .github/ISSUE_TEMPLATE/2.feature_request.yml delete mode 100644 .github/ISSUE_TEMPLATE/3.example_bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/3.feature_request.yml diff --git a/.github/ISSUE_TEMPLATE/2.example_bug_report.yml b/.github/ISSUE_TEMPLATE/2.example_bug_report.yml new file mode 100644 index 0000000000000..25da453dfd7a5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/2.example_bug_report.yml @@ -0,0 +1,66 @@ +name: Example Bug Report +about: Create a bug report for the examples +title: '' +labels: 'type: example,template: bug' +issue_body: true +inputs: + - type: description + attributes: + value: Thanks for taking the time to file a examples bug report! Please fill out this form as completely as possible. + - type: description + attributes: + value: If you leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Help" section. + - type: input + attributes: + label: What example does this report relate to? + description: 'For example: with-styled-components' + required: true + - type: input + attributes: + label: What version of Next.js are you using? + description: 'For example: 10.0.1' + required: true + - type: input + attributes: + label: What version of Node.js are you using? + description: 'For example: 12.0.0' + required: true + - type: input + attributes: + label: What browser are you using? + description: 'For example: Chrome, Safari' + required: true + - type: input + attributes: + label: What operating system are you using? + description: 'For example: macOS, Windows' + required: true + - type: input + attributes: + label: How are you deploying your application? + description: 'For example: next start, next export, Vercel, Other platform' + required: true + - type: textarea + attributes: + label: Describe the Bug + description: A clear and concise description of what the bug is. + required: true + - type: textarea + attributes: + label: Expected Behavior + description: A clear and concise description of what you expected to happen. + required: true + - type: textarea + attributes: + label: To Reproduce + description: Steps to reproduce the behavior, please provide a clear code snippets that always reproduces the issue or a GitHub repository. Screenshots can be provided in the issue body below. + required: true + - type: description + attributes: + value: Before posting the issue go through the steps you've written down to make sure the steps provided are detailed and clear. + - type: description + attributes: + value: Contributors should be able to follow the steps provided in order to reproduce the bug. + - type: description + attributes: + value: Thanks in advance! diff --git a/.github/ISSUE_TEMPLATE/2.feature_request.yml b/.github/ISSUE_TEMPLATE/2.feature_request.yml deleted file mode 100644 index c158914994cbe..0000000000000 --- a/.github/ISSUE_TEMPLATE/2.feature_request.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Feature Request -about: Create a feature request for the Next.js core -title: "" -labels: "template: story" -issue_body: true -inputs: -- type: description - attributes: - value: Thanks for taking the time to file a feature request! Please fill out this form as completely as possible. -- type: description - attributes: - value: "Feature requests will be converted to the GitHub Discussions \"Ideas\" section." -- type: textarea - attributes: - label: Describe the feature you'd like to request - description: A clear and concise description of what you want and what your use case is. - required: true -- type: textarea - attributes: - label: Describe the solution you'd like - description: A clear and concise description of what you want to happen. - required: true -- type: textarea - attributes: - label: Describe alternatives you've considered - description: A clear and concise description of any alternative solutions or features you've considered. - required: true diff --git a/.github/ISSUE_TEMPLATE/3.example_bug_report.yml b/.github/ISSUE_TEMPLATE/3.example_bug_report.yml deleted file mode 100644 index e1a35cd481924..0000000000000 --- a/.github/ISSUE_TEMPLATE/3.example_bug_report.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Example Bug Report -about: Create a bug report for the examples -title: "" -labels: "type: example,template: bug" -issue_body: true -inputs: -- type: description - attributes: - value: Thanks for taking the time to file a examples bug report! Please fill out this form as completely as possible. -- type: description - attributes: - value: If you leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Help" section. -- type: input - attributes: - label: What example does this report relate to? - description: "For example: with-styled-components" - required: true -- type: input - attributes: - label: What version of Next.js are you using? - description: "For example: 10.0.1" - required: true -- type: input - attributes: - label: What version of Node.js are you using? - description: "For example: 12.0.0" - required: true -- type: input - attributes: - label: What browser are you using? - description: "For example: Chrome, Safari" - required: true -- type: input - attributes: - label: What operating system are you using? - description: "For example: macOS, Windows" - required: true -- type: input - attributes: - label: How are you deploying your application? - description: "For example: next start, next export, Vercel, Other platform" - required: true -- type: textarea - attributes: - label: Describe the Bug - description: A clear and concise description of what the bug is. - required: true -- type: textarea - attributes: - label: Expected Behavior - description: A clear and concise description of what you expected to happen. - required: true -- type: textarea - attributes: - label: To Reproduce - description: Steps to reproduce the behavior, please provide a clear code snippets that always reproduces the issue or a GitHub repository. Screenshots can be provided in the issue body below. - required: true -- type: description - attributes: - value: Before posting the issue go through the steps you've written down to make sure the steps provided are detailed and clear. -- type: description - attributes: - value: Contributors should be able to follow the steps provided in order to reproduce the bug. -- type: description - attributes: - value: Thanks in advance! diff --git a/.github/ISSUE_TEMPLATE/3.feature_request.yml b/.github/ISSUE_TEMPLATE/3.feature_request.yml new file mode 100644 index 0000000000000..c4fbcccf7078f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/3.feature_request.yml @@ -0,0 +1,27 @@ +name: Feature Request +about: Create a feature request for the Next.js core +title: '' +labels: 'template: story' +issue_body: true +inputs: + - type: description + attributes: + value: Thanks for taking the time to file a feature request! Please fill out this form as completely as possible. + - type: description + attributes: + value: 'Feature requests will be converted to the GitHub Discussions "Ideas" section.' + - type: textarea + attributes: + label: Describe the feature you'd like to request + description: A clear and concise description of what you want and what your use case is. + required: true + - type: textarea + attributes: + label: Describe the solution you'd like + description: A clear and concise description of what you want to happen. + required: true + - type: textarea + attributes: + label: Describe alternatives you've considered + description: A clear and concise description of any alternative solutions or features you've considered. + required: true From ad1150d2d1810c2d59d29fdb9ba216942a2fa836 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Mon, 4 Jan 2021 13:53:26 +0100 Subject: [PATCH 24/38] Run prettier against new issue templates --- .github/ISSUE_TEMPLATE/1.bug_report.yml | 116 ++++++++++++------------ 1 file changed, 57 insertions(+), 59 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/1.bug_report.yml b/.github/ISSUE_TEMPLATE/1.bug_report.yml index cb1595a723331..b9b94618e9a34 100644 --- a/.github/ISSUE_TEMPLATE/1.bug_report.yml +++ b/.github/ISSUE_TEMPLATE/1.bug_report.yml @@ -1,63 +1,61 @@ name: Bug Report about: Create a bug report for the Next.js core -title: "" -labels: "template: bug" +title: '' +labels: 'template: bug' issue_body: true inputs: -- type: description - attributes: - value: Thanks for taking the time to file a bug report! Please fill out this form as completely as possible. -- type: description - attributes: - value: If you leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Help" section. -- type: input - attributes: - label: What version of Next.js are you using? - description: "For example: 10.0.1" - required: true -- type: input - attributes: - label: What version of Node.js are you using? - description: "For example: 12.0.0" - required: true -- type: input - attributes: - label: What browser are you using? - description: "For example: Chrome, Safari" - required: true -- type: input - attributes: - label: What operating system are you using? - description: "For example: macOS, Windows" - required: true -- type: input - attributes: - label: How are you deploying your application? - description: "For example: next start, next export, Vercel, Other platform" - required: true -- type: textarea - attributes: - label: Describe the Bug - description: A clear and concise description of what the bug is. - required: true -- type: textarea - attributes: - label: Expected Behavior - description: A clear and concise description of what you expected to happen. - required: true -- type: textarea - attributes: - label: To Reproduce - description: Steps to reproduce the behavior, please provide a clear code snippets that always reproduces the issue or a GitHub repository. Screenshots can be provided in the issue body below. - required: true -- type: description - attributes: - value: Before posting the issue go through the steps you've written down to make sure the steps provided are detailed and clear. -- type: description - attributes: - value: Contributors should be able to follow the steps provided in order to reproduce the bug. -- type: description - attributes: - value: These steps are used to add integration tests to ensure the same issue does not happen again. Thanks in advance! - - + - type: description + attributes: + value: Thanks for taking the time to file a bug report! Please fill out this form as completely as possible. + - type: description + attributes: + value: If you leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Help" section. + - type: input + attributes: + label: What version of Next.js are you using? + description: 'For example: 10.0.1' + required: true + - type: input + attributes: + label: What version of Node.js are you using? + description: 'For example: 12.0.0' + required: true + - type: input + attributes: + label: What browser are you using? + description: 'For example: Chrome, Safari' + required: true + - type: input + attributes: + label: What operating system are you using? + description: 'For example: macOS, Windows' + required: true + - type: input + attributes: + label: How are you deploying your application? + description: 'For example: next start, next export, Vercel, Other platform' + required: true + - type: textarea + attributes: + label: Describe the Bug + description: A clear and concise description of what the bug is. + required: true + - type: textarea + attributes: + label: Expected Behavior + description: A clear and concise description of what you expected to happen. + required: true + - type: textarea + attributes: + label: To Reproduce + description: Steps to reproduce the behavior, please provide a clear code snippets that always reproduces the issue or a GitHub repository. Screenshots can be provided in the issue body below. + required: true + - type: description + attributes: + value: Before posting the issue go through the steps you've written down to make sure the steps provided are detailed and clear. + - type: description + attributes: + value: Contributors should be able to follow the steps provided in order to reproduce the bug. + - type: description + attributes: + value: These steps are used to add integration tests to ensure the same issue does not happen again. Thanks in advance! From e848a9e504585819a076ed9b6712d4f9aef84952 Mon Sep 17 00:00:00 2001 From: Kristoffer K Date: Mon, 4 Jan 2021 16:30:46 +0100 Subject: [PATCH 25/38] fix(next): add missing peer dependencies for sass support (#17606) --- .github/workflows/build_test_deploy.yml | 11 ++------- packages/next/package.json | 20 ++++++++++++++--- test-pnp.sh | 30 +++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 12 deletions(-) create mode 100644 test-pnp.sh diff --git a/.github/workflows/build_test_deploy.yml b/.github/workflows/build_test_deploy.yml index bd8eafaac3a2c..dc5d8784f63bd 100644 --- a/.github/workflows/build_test_deploy.yml +++ b/.github/workflows/build_test_deploy.yml @@ -115,20 +115,13 @@ jobs: runs-on: ubuntu-latest env: NODE_OPTIONS: '--unhandled-rejections=strict' + YARN_COMPRESSION_LEVEL: '0' steps: - uses: actions/checkout@v2 - run: yarn install --frozen-lockfile --check-files - - run: | - mkdir -p ./e2e-tests/next-pnp - cp -r ./examples/with-typescript/. ./e2e-tests/next-pnp - cd ./e2e-tests/next-pnp - touch yarn.lock - yarn set version berry - yarn config set pnpFallbackMode none - yarn link --all --private ../.. - yarn build + - run: bash ./test-pnp.sh testsPass: name: thank you, next diff --git a/packages/next/package.json b/packages/next/package.json index 1cb9696499772..767c8d573cc03 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -107,12 +107,26 @@ "webpack": "4.44.1", "webpack-sources": "1.4.3" }, + "optionalDependencies": { + "sharp": "0.26.3" + }, "peerDependencies": { "react": "^16.6.0 || ^17", - "react-dom": "^16.6.0 || ^17" + "react-dom": "^16.6.0 || ^17", + "node-sass": "^4.0.0", + "sass": "^1.3.0", + "fibers": ">= 3.1.0" }, - "optionalDependencies": { - "sharp": "0.26.3" + "peerDependenciesMeta": { + "node-sass": { + "optional": true + }, + "sass": { + "optional": true + }, + "fibers": { + "optional": true + } }, "devDependencies": { "@babel/code-frame": "7.12.11", diff --git a/test-pnp.sh b/test-pnp.sh new file mode 100644 index 0000000000000..c9a74cd2df0fd --- /dev/null +++ b/test-pnp.sh @@ -0,0 +1,30 @@ +declare -a testCases=( + "with-typescript" + "with-next-sass" +) + +set -e + +# Speeds up testing locally +export CI=1 + +rm -rf ./e2e-tests + +initialDir=$(pwd) + +for testCase in "${testCases[@]}" +do + cd $initialDir + + echo "--- Testing $testCase ---" + mkdir -p "./e2e-tests/$testCase" + cp -r "./examples/$testCase/." "./e2e-tests/$testCase" + cd "./e2e-tests/$testCase" + + touch yarn.lock + yarn set version berry + yarn config set pnpFallbackMode none + yarn link --all --private -r ../.. + + yarn build +done From 246c265fca5e1a0dd049068fd589a7266fd20e40 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Mon, 4 Jan 2021 10:31:56 -0500 Subject: [PATCH 26/38] v10.0.5-canary.9 --- lerna.json | 2 +- packages/create-next-app/package.json | 2 +- packages/eslint-plugin-next/package.json | 2 +- packages/next-bundle-analyzer/package.json | 2 +- packages/next-codemod/package.json | 2 +- packages/next-env/package.json | 2 +- packages/next-mdx/package.json | 2 +- .../next-plugin-google-analytics/package.json | 2 +- packages/next-plugin-sentry/package.json | 2 +- packages/next-plugin-storybook/package.json | 2 +- packages/next-polyfill-module/package.json | 2 +- packages/next-polyfill-nomodule/package.json | 2 +- packages/next/package.json | 18 +++++++++--------- packages/react-dev-overlay/package.json | 2 +- packages/react-refresh-utils/package.json | 2 +- 15 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index 97efbe1c24e1b..54310c2c4acc3 100644 --- a/lerna.json +++ b/lerna.json @@ -17,5 +17,5 @@ "registry": "https://registry.npmjs.org/" } }, - "version": "10.0.5-canary.8" + "version": "10.0.5-canary.9" } diff --git a/packages/create-next-app/package.json b/packages/create-next-app/package.json index 6d84a07af3e21..66f35afe979b6 100644 --- a/packages/create-next-app/package.json +++ b/packages/create-next-app/package.json @@ -1,6 +1,6 @@ { "name": "create-next-app", - "version": "10.0.5-canary.8", + "version": "10.0.5-canary.9", "keywords": [ "react", "next", diff --git a/packages/eslint-plugin-next/package.json b/packages/eslint-plugin-next/package.json index 348d6db398e7c..643866fb7ac7d 100644 --- a/packages/eslint-plugin-next/package.json +++ b/packages/eslint-plugin-next/package.json @@ -1,6 +1,6 @@ { "name": "@next/eslint-plugin-next", - "version": "10.0.5-canary.8", + "version": "10.0.5-canary.9", "description": "ESLint plugin for NextJS.", "main": "lib/index.js", "license": "MIT", diff --git a/packages/next-bundle-analyzer/package.json b/packages/next-bundle-analyzer/package.json index 02610bd70b530..d0ee79abfd89c 100644 --- a/packages/next-bundle-analyzer/package.json +++ b/packages/next-bundle-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "@next/bundle-analyzer", - "version": "10.0.5-canary.8", + "version": "10.0.5-canary.9", "main": "index.js", "license": "MIT", "repository": { diff --git a/packages/next-codemod/package.json b/packages/next-codemod/package.json index 46e79d6c5d3ad..163db6690e599 100644 --- a/packages/next-codemod/package.json +++ b/packages/next-codemod/package.json @@ -1,6 +1,6 @@ { "name": "@next/codemod", - "version": "10.0.5-canary.8", + "version": "10.0.5-canary.9", "license": "MIT", "dependencies": { "chalk": "4.1.0", diff --git a/packages/next-env/package.json b/packages/next-env/package.json index 75a1b4bee42d7..d307d6c205d52 100644 --- a/packages/next-env/package.json +++ b/packages/next-env/package.json @@ -1,6 +1,6 @@ { "name": "@next/env", - "version": "10.0.5-canary.8", + "version": "10.0.5-canary.9", "keywords": [ "react", "next", diff --git a/packages/next-mdx/package.json b/packages/next-mdx/package.json index 9d167cd15519d..dacea6096e4be 100644 --- a/packages/next-mdx/package.json +++ b/packages/next-mdx/package.json @@ -1,6 +1,6 @@ { "name": "@next/mdx", - "version": "10.0.5-canary.8", + "version": "10.0.5-canary.9", "main": "index.js", "license": "MIT", "repository": { diff --git a/packages/next-plugin-google-analytics/package.json b/packages/next-plugin-google-analytics/package.json index 791f60daed94a..264529d12ea89 100644 --- a/packages/next-plugin-google-analytics/package.json +++ b/packages/next-plugin-google-analytics/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-google-analytics", - "version": "10.0.5-canary.8", + "version": "10.0.5-canary.9", "repository": { "url": "vercel/next.js", "directory": "packages/next-plugin-google-analytics" diff --git a/packages/next-plugin-sentry/package.json b/packages/next-plugin-sentry/package.json index 8ce1effa90e73..f143f1c3a906a 100644 --- a/packages/next-plugin-sentry/package.json +++ b/packages/next-plugin-sentry/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-sentry", - "version": "10.0.5-canary.8", + "version": "10.0.5-canary.9", "repository": { "url": "vercel/next.js", "directory": "packages/next-plugin-sentry" diff --git a/packages/next-plugin-storybook/package.json b/packages/next-plugin-storybook/package.json index 11af1cea79fd2..481066b876e9f 100644 --- a/packages/next-plugin-storybook/package.json +++ b/packages/next-plugin-storybook/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-storybook", - "version": "10.0.5-canary.8", + "version": "10.0.5-canary.9", "repository": { "url": "vercel/next.js", "directory": "packages/next-plugin-storybook" diff --git a/packages/next-polyfill-module/package.json b/packages/next-polyfill-module/package.json index 247fdd12d0fde..8e272f600433a 100644 --- a/packages/next-polyfill-module/package.json +++ b/packages/next-polyfill-module/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-module", - "version": "10.0.5-canary.8", + "version": "10.0.5-canary.9", "description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)", "main": "dist/polyfill-module.js", "license": "MIT", diff --git a/packages/next-polyfill-nomodule/package.json b/packages/next-polyfill-nomodule/package.json index 0cd76f98aab27..a4d9cf64a4e97 100644 --- a/packages/next-polyfill-nomodule/package.json +++ b/packages/next-polyfill-nomodule/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-nomodule", - "version": "10.0.5-canary.8", + "version": "10.0.5-canary.9", "description": "A polyfill for non-dead, nomodule browsers.", "main": "dist/polyfill-nomodule.js", "license": "MIT", diff --git a/packages/next/package.json b/packages/next/package.json index 767c8d573cc03..560692b32cae8 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "next", - "version": "10.0.5-canary.8", + "version": "10.0.5-canary.9", "description": "The React Framework", "main": "./dist/server/next.js", "license": "MIT", @@ -63,10 +63,10 @@ "@ampproject/toolbox-optimizer": "2.7.1-alpha.0", "@babel/runtime": "7.12.5", "@hapi/accept": "5.0.1", - "@next/env": "10.0.5-canary.8", - "@next/polyfill-module": "10.0.5-canary.8", - "@next/react-dev-overlay": "10.0.5-canary.8", - "@next/react-refresh-utils": "10.0.5-canary.8", + "@next/env": "10.0.5-canary.9", + "@next/polyfill-module": "10.0.5-canary.9", + "@next/react-dev-overlay": "10.0.5-canary.9", + "@next/react-refresh-utils": "10.0.5-canary.9", "@opentelemetry/api": "0.14.0", "ast-types": "0.13.2", "babel-plugin-transform-define": "2.0.0", @@ -111,11 +111,11 @@ "sharp": "0.26.3" }, "peerDependencies": { + "fibers": ">= 3.1.0", + "node-sass": "^4.0.0", "react": "^16.6.0 || ^17", "react-dom": "^16.6.0 || ^17", - "node-sass": "^4.0.0", - "sass": "^1.3.0", - "fibers": ">= 3.1.0" + "sass": "^1.3.0" }, "peerDependenciesMeta": { "node-sass": { @@ -144,7 +144,7 @@ "@babel/preset-react": "7.12.10", "@babel/preset-typescript": "7.12.7", "@babel/types": "7.12.12", - "@next/polyfill-nomodule": "10.0.5-canary.8", + "@next/polyfill-nomodule": "10.0.5-canary.9", "@taskr/clear": "1.1.0", "@taskr/esnext": "1.1.0", "@taskr/watch": "1.1.0", diff --git a/packages/react-dev-overlay/package.json b/packages/react-dev-overlay/package.json index 6ce55c0145205..a306b33e75021 100644 --- a/packages/react-dev-overlay/package.json +++ b/packages/react-dev-overlay/package.json @@ -1,6 +1,6 @@ { "name": "@next/react-dev-overlay", - "version": "10.0.5-canary.8", + "version": "10.0.5-canary.9", "description": "A development-only overlay for developing React applications.", "repository": { "url": "vercel/next.js", diff --git a/packages/react-refresh-utils/package.json b/packages/react-refresh-utils/package.json index f27961bb946b2..38fe96ce57867 100644 --- a/packages/react-refresh-utils/package.json +++ b/packages/react-refresh-utils/package.json @@ -1,6 +1,6 @@ { "name": "@next/react-refresh-utils", - "version": "10.0.5-canary.8", + "version": "10.0.5-canary.9", "description": "An experimental package providing utilities for React Refresh.", "repository": { "url": "vercel/next.js", From 104b8d47320160e1c39512ef1f79f9c41b1add8b Mon Sep 17 00:00:00 2001 From: Kristoffer K Date: Mon, 4 Jan 2021 17:24:16 +0100 Subject: [PATCH 27/38] fix(next-mdx): resolve webpack loader (#17983) **What's the problem this PR addresses?** `@next/mdx` adds the webpack loader `@mdx-js/loader` without resolving it to an absolute path Depends on https://github.com/vercel/next.js/pull/17606 **How did you fix it?** `require.resolve` the webpack loader before adding it --- examples/with-mdx/package.json | 1 + packages/next-mdx/index.js | 2 +- packages/next-mdx/package.json | 3 ++- test-pnp.sh | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/with-mdx/package.json b/examples/with-mdx/package.json index 96d98b11cde3d..44c4a6c2b2ed5 100644 --- a/examples/with-mdx/package.json +++ b/examples/with-mdx/package.json @@ -8,6 +8,7 @@ }, "dependencies": { "@mdx-js/loader": "^1.5.1", + "@mdx-js/react": "^1.6.18", "@next/mdx": "^9.1.1", "next": "latest", "react": "^16.8.6", diff --git a/packages/next-mdx/index.js b/packages/next-mdx/index.js index 869865320b2c7..27f9f66290738 100644 --- a/packages/next-mdx/index.js +++ b/packages/next-mdx/index.js @@ -8,7 +8,7 @@ module.exports = (pluginOptions = {}) => (nextConfig = {}) => { use: [ options.defaultLoaders.babel, { - loader: '@mdx-js/loader', + loader: require.resolve('@mdx-js/loader'), options: pluginOptions.options, }, ], diff --git a/packages/next-mdx/package.json b/packages/next-mdx/package.json index dacea6096e4be..d7071244f9e80 100644 --- a/packages/next-mdx/package.json +++ b/packages/next-mdx/package.json @@ -8,6 +8,7 @@ "directory": "packages/next-mdx" }, "peerDependencies": { - "@mdx-js/loader": ">=0.15.0" + "@mdx-js/loader": ">=0.15.0", + "@mdx-js/react": "*" } } diff --git a/test-pnp.sh b/test-pnp.sh index c9a74cd2df0fd..6ea70845a22b8 100644 --- a/test-pnp.sh +++ b/test-pnp.sh @@ -1,6 +1,7 @@ declare -a testCases=( "with-typescript" "with-next-sass" + "with-mdx" ) set -e From fc75baeb3c42e83ebed3d08e05ef06fb50a2d17b Mon Sep 17 00:00:00 2001 From: matamatanot <39780486+matamatanot@users.noreply.github.com> Date: Tue, 5 Jan 2021 03:09:07 +0900 Subject: [PATCH 28/38] Move sizes var declaration just before used (#18402) As with `const width`, it should be declared just before it is used. --- packages/next/next-server/server/image-optimizer.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/next/next-server/server/image-optimizer.ts b/packages/next/next-server/server/image-optimizer.ts index 890cea6cd902b..9c19ee031d247 100644 --- a/packages/next/next-server/server/image-optimizer.ts +++ b/packages/next/next-server/server/image-optimizer.ts @@ -34,7 +34,6 @@ export async function imageOptimizer( const { nextConfig, distDir } = server const imageData: ImageConfig = nextConfig.images || imageConfigDefault const { deviceSizes = [], imageSizes = [], domains = [], loader } = imageData - const sizes = [...deviceSizes, ...imageSizes] if (loader !== 'default') { await server.render404(req, res, parsedUrl) @@ -115,6 +114,8 @@ export async function imageOptimizer( return { finished: true } } + const sizes = [...deviceSizes, ...imageSizes] + if (!sizes.includes(width)) { res.statusCode = 400 res.end(`"w" parameter (width) of ${width} is not allowed`) From cb50b040eae9d6f961101272d09d1000f03783a0 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Mon, 4 Jan 2021 14:57:52 -0500 Subject: [PATCH 29/38] fix(next/head): assign bool attrs to match server (#20748) This pull request correctly assigns boolean attributes for ` + {/* this should not execute twice on the client (intentionally sets defer to `yas` to test boolean coercion) */} + + {/* such style can be used for alternate links on _app vs individual pages */} {['pl', 'en'].map((language) => ( { }) describe('updating head while client routing', () => { + it('should only execute async and defer scripts once', async () => { + let browser + try { + browser = await webdriver(context.appPort, '/head') + + await browser.waitForElementByCss('h1') + await waitFor(2000) + expect( + Number(await browser.eval('window.__test_async_executions')) + ).toBe(1) + expect( + Number(await browser.eval('window.__test_defer_executions')) + ).toBe(1) + } finally { + if (browser) { + await browser.close() + } + } + }) + it('should update head during client routing', async () => { let browser try { diff --git a/test/integration/client-navigation/test/rendering.js b/test/integration/client-navigation/test/rendering.js index 7b60e91228667..817e23dc61eb7 100644 --- a/test/integration/client-navigation/test/rendering.js +++ b/test/integration/client-navigation/test/rendering.js @@ -186,6 +186,12 @@ export default function (render, fetch, ctx) { expect(html).toContain('') }) + test('header helper renders boolean attributes correctly children', async () => { + const html = await render('/head') + expect(html).toContain('