diff --git a/.github/actions/next-stats-action/src/index.js b/.github/actions/next-stats-action/src/index.js index 2bacd52b3501d..d7332d5edc893 100644 --- a/.github/actions/next-stats-action/src/index.js +++ b/.github/actions/next-stats-action/src/index.js @@ -1,3 +1,5 @@ +const path = require('path') +const fs = require('fs-extra') const exec = require('./util/exec') const logger = require('./util/logger') const runConfigs = require('./run') @@ -25,6 +27,13 @@ if (!allowedActions.has(actionInfo.actionName) && !actionInfo.isRelease) { ;(async () => { try { + if (await fs.pathExists(path.join(process.cwd(), 'SKIP_NEXT_STATS.txt'))) { + console.log( + 'SKIP_NEXT_STATS.txt file present, exiting stats generation..' + ) + process.exit(0) + } + const { stdout: gitName } = await exec( 'git config user.name && git config user.email' ) diff --git a/.github/workflows/build_test_deploy.yml b/.github/workflows/build_test_deploy.yml index 3220cb97664f9..02cacac16397d 100644 --- a/.github/workflows/build_test_deploy.yml +++ b/.github/workflows/build_test_deploy.yml @@ -184,3 +184,14 @@ jobs: key: ${{ github.sha }} - run: ./publish-release.sh + + prStats: + name: Release Stats + runs-on: ubuntu-latest + needs: [publishRelease] + steps: + - uses: actions/checkout@v2 + - run: ./release-stats.sh + - uses: ./.github/actions/next-stats-action + env: + PR_STATS_COMMENT_TOKEN: ${{ secrets.PR_STATS_COMMENT_TOKEN }} diff --git a/.github/workflows/release_stats.yml b/.github/workflows/release_stats.yml deleted file mode 100644 index c734488bdc264..0000000000000 --- a/.github/workflows/release_stats.yml +++ /dev/null @@ -1,13 +0,0 @@ -on: release - -name: Generate Release Stats - -jobs: - prStats: - name: Release Stats - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: ./.github/actions/next-stats-action - env: - PR_STATS_COMMENT_TOKEN: ${{ secrets.PR_STATS_COMMENT_TOKEN }} diff --git a/docs/api-reference/next.config.js/exportPathMap.md b/docs/api-reference/next.config.js/exportPathMap.md index bd6a7c28c090a..c28f201852b6c 100644 --- a/docs/api-reference/next.config.js/exportPathMap.md +++ b/docs/api-reference/next.config.js/exportPathMap.md @@ -13,6 +13,8 @@ description: Customize the pages that will be exported as HTML files when using +`exportPathMap` allows you to specify a mapping of request paths to page destinations, to be used during export. + Let's start with an example, to create a custom `exportPathMap` for an app with the following pages: - `pages/index.js` diff --git a/docs/api-reference/next.config.js/rewrites.md b/docs/api-reference/next.config.js/rewrites.md index c50bc290724e4..41ed98dd25303 100644 --- a/docs/api-reference/next.config.js/rewrites.md +++ b/docs/api-reference/next.config.js/rewrites.md @@ -17,6 +17,8 @@ Rewrites allow you to map an incoming request path to a different destination pa Rewrites are only available on the Node.js environment and do not affect client-side routing. +Rewrites are not able to override public files or routes in the pages directory as these have higher priority than rewrites. For example, if you have `pages/index.js` you are not able to rewrite `/` to another location unless you rename the `pages/index.js` file. + To use rewrites you can use the `rewrites` key in `next.config.js`: ```js diff --git a/docs/basic-features/built-in-css-support.md b/docs/basic-features/built-in-css-support.md index ae05f12481826..9933ca5378069 100644 --- a/docs/basic-features/built-in-css-support.md +++ b/docs/basic-features/built-in-css-support.md @@ -52,7 +52,7 @@ In production, all CSS files will be automatically concatenated into a single mi ### Import styles from `node_modules` -Importing a CSS file from `node_modules` is permitted in anywhere your application. +Since Next.js **9.5.4**, importing a CSS file from `node_modules` is permitted anywhere in your application. For global stylesheets, like `bootstrap` or `nprogress`, you should import the file inside `pages/_app.js`. For example: diff --git a/docs/basic-features/static-file-serving.md b/docs/basic-features/static-file-serving.md index 25cac8b8aa9e8..f7c52e48fa951 100644 --- a/docs/basic-features/static-file-serving.md +++ b/docs/basic-features/static-file-serving.md @@ -16,7 +16,7 @@ function MyImage() { export default MyImage ``` -This folder is also useful for `robots.txt`, Google Site Verification, and any other static files (including `.html`)! +This folder is also useful for `robots.txt`, `favicon.ico`, Google Site Verification, and any other static files (including `.html`)! > **Note**: Don't name the `public` directory anything else. The name cannot be changed and is the only directory used to serve static assets. diff --git a/docs/basic-features/typescript.md b/docs/basic-features/typescript.md index 0e8cbfa668c9b..ec3b81b156bdb 100644 --- a/docs/basic-features/typescript.md +++ b/docs/basic-features/typescript.md @@ -41,7 +41,7 @@ You're now ready to start converting files from `.js` to `.tsx` and leveraging t > A file named `next-env.d.ts` will be created in the root of your project. This file ensures Next.js types are picked up by the TypeScript compiler. **You cannot remove it**, however, you can edit it (but you don't need to). -> Next.js `strict` mode is turned off by default. When you feel comfortable with TypeScript, it's recommended to turn it on in your `tsconfig.json`. +> TypeScript `strict` mode is turned off by default. When you feel comfortable with TypeScript, it's recommended to turn it on in your `tsconfig.json`. By default, Next.js will do type checking as part of `next build`. We recommend using code editor type checking during development. diff --git a/examples/amp-first/README.md b/examples/amp-first/README.md index 675c1d532b7b9..3c837e93d2edc 100644 --- a/examples/amp-first/README.md +++ b/examples/amp-first/README.md @@ -60,7 +60,7 @@ Things you need to do after installing the boilerplate: ``` - **amp-list & amp-mustache:** mustache templates conflict with JSX and it's template literals need to be escaped. A simple approach is to escape them via back ticks: `` src={`{{imageUrl}}`} ``. -- **amp-script:** you can use [amp-script](https://amp.dev/documentation/components/amp-script/) to add custom JavaScript to your AMP pages. The boilerplate includes a helper [`components/amp/AmpScript.js`](components/amp/AmpScript.js) to simplify using amp-script. The helper also supports embedding inline scripts. Good to know: Next.js uses [AMP Optimizer](https://github.com/ampproject/amp-toolbox/tree/master/packages/optimizer) under the hood, which automatically adds the needed script hashes for [inline amp-scripts](https://amp.dev/documentation/components/amp-script/#load-javascript-from-a-local-element). +- **amp-script:** you can use [amp-script](https://amp.dev/documentation/components/amp-script/) to add custom JavaScript to your AMP pages. The boilerplate includes a helper [`components/amp/AmpScript.js`](components/amp/AmpScript.js) to simplify using `amp-script`. The helper also supports embedding inline scripts. Good to know: Next.js uses [AMP Optimizer](https://github.com/ampproject/amp-toolbox/tree/master/packages/optimizer) under the hood, which automatically adds the needed script hashes for [inline amp-scripts](https://amp.dev/documentation/components/amp-script/#load-javascript-from-a-local-element). ## Deployment diff --git a/examples/api-routes-rest/README.md b/examples/api-routes-rest/README.md index 3f12cd4a67662..4bcb51a25655f 100644 --- a/examples/api-routes-rest/README.md +++ b/examples/api-routes-rest/README.md @@ -1,6 +1,6 @@ # API routes with REST -Next.js ships with [API routes](https://github.com/vercel/next.js#api-routes), which provide an easy solution to build your own `API`. This example shows how it can be used to create your [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) api. +Next.js ships with [API routes](https://github.com/vercel/next.js#api-routes), which provide an easy solution to build your own `API`. This example shows how it can be used to create your [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) `API`. ## Deploy your own diff --git a/examples/blog-starter-typescript/README.md b/examples/blog-starter-typescript/README.md index 95cee4f58b6f2..e8db3fc2498ce 100644 --- a/examples/blog-starter-typescript/README.md +++ b/examples/blog-starter-typescript/README.md @@ -2,11 +2,11 @@ This is the existing [blog-starter](https://github.com/vercel/next.js/tree/canary/examples/blog-starter) plus TypeScript. -This example showcases Next.js's [Static Generation](https://nextjs.org/docs/basic-features/pages) feature using markdown files as the data source. +This example showcases Next.js's [Static Generation](https://nextjs.org/docs/basic-features/pages) feature using Markdown files as the data source. -The blog posts are stored in `/_posts` as markdown files with front matter support. Adding a new markdown file in there will create a new blog post. +The blog posts are stored in `/_posts` as Markdown files with front matter support. Adding a new Markdown file in there will create a new blog post. -To create the blog posts we use [`remark`](https://github.com/remarkjs/remark) and [`remark-html`](https://github.com/remarkjs/remark-html) to convert the markdown files into an HTML string, and then send it down as a prop to the page. The metadata of every post is handled by [`gray-matter`](https://github.com/jonschlinkert/gray-matter) and also sent in props to the page. +To create the blog posts we use [`remark`](https://github.com/remarkjs/remark) and [`remark-html`](https://github.com/remarkjs/remark-html) to convert the Markdown files into an HTML string, and then send it down as a prop to the page. The metadata of every post is handled by [`gray-matter`](https://github.com/jonschlinkert/gray-matter) and also sent in props to the page. ## How to use diff --git a/examples/blog-starter/README.md b/examples/blog-starter/README.md index 7f6cf9b819120..01f09e6791718 100644 --- a/examples/blog-starter/README.md +++ b/examples/blog-starter/README.md @@ -1,10 +1,10 @@ # A statically generated blog example using Next.js and Markdown -This example showcases Next.js's [Static Generation](https://nextjs.org/docs/basic-features/pages) feature using markdown files as the data source. +This example showcases Next.js's [Static Generation](https://nextjs.org/docs/basic-features/pages) feature using Markdown files as the data source. -The blog posts are stored in `/_posts` as markdown files with front matter support. Adding a new markdown file in there will create a new blog post. +The blog posts are stored in `/_posts` as Markdown files with front matter support. Adding a new Markdown file in there will create a new blog post. -To create the blog posts we use [`remark`](https://github.com/remarkjs/remark) and [`remark-html`](https://github.com/remarkjs/remark-html) to convert the markdown files into an HTML string, and then send it down as a prop to the page. The metadata of every post is handled by [`gray-matter`](https://github.com/jonschlinkert/gray-matter) and also sent in props to the page. +To create the blog posts we use [`remark`](https://github.com/remarkjs/remark) and [`remark-html`](https://github.com/remarkjs/remark-html) to convert the Markdown files into an HTML string, and then send it down as a prop to the page. The metadata of every post is handled by [`gray-matter`](https://github.com/jonschlinkert/gray-matter) and also sent in props to the page. ## Demo diff --git a/examples/environment-variables/pages/index.js b/examples/environment-variables/pages/index.js index bda145075e664..848863d6b2b78 100644 --- a/examples/environment-variables/pages/index.js +++ b/examples/environment-variables/pages/index.js @@ -17,7 +17,7 @@ const IndexPage = () => (

In general only .env.local or .env are needed for this, but the table also features the usage of{' '} - .env.develoment and .env.production. + .env.development and .env.production.

@@ -47,7 +47,7 @@ const IndexPage = () => ( @@ -75,7 +75,7 @@ const IndexPage = () => ( npm run dev

- Similarly, variables in .env.develoment won't be available + Similarly, variables in .env.development won't be available if the app is running on production:

diff --git a/examples/with-google-analytics-amp/pages/_document.js b/examples/with-google-analytics-amp/pages/_document.js
index daf9b598655b0..0f8dc4abb0c40 100644
--- a/examples/with-google-analytics-amp/pages/_document.js
+++ b/examples/with-google-analytics-amp/pages/_document.js
@@ -1,4 +1,4 @@
-import Document, { Html, Main, NextScript } from 'next/document'
+import Document, { Html, Head, Main, NextScript } from 'next/document'
 import { useAmp } from 'next/amp'
 
 import { GA_TRACKING_ID } from '../lib/gtag'
@@ -14,6 +14,7 @@ export default class MyDocument extends Document {
   render() {
     return (
       
+        
         
           
diff --git a/examples/with-mux-video/README.md b/examples/with-mux-video/README.md index 8fdf5b0618c83..d70b4f699c9fc 100644 --- a/examples/with-mux-video/README.md +++ b/examples/with-mux-video/README.md @@ -4,7 +4,9 @@ This example uses Mux Video, an API-first platform for video. The example featur ## Demo -### [https://with-mux-video.now.sh/](https://with-mux-video.now.sh/) +### [https://with-mux-video.vercel.app/](https://with-mux-video.vercel.app/) + +### This project was used to create [stream.new](https://stream.new/) ## Deploy your own diff --git a/examples/with-mux-video/components/layout.js b/examples/with-mux-video/components/layout.js index 518437e23e772..76c050a159515 100644 --- a/examples/with-mux-video/components/layout.js +++ b/examples/with-mux-video/components/layout.js @@ -4,9 +4,9 @@ import { MUX_HOME_PAGE_URL } from '../constants' export default function Layout({ title, description, - metaTitle, + metaTitle = 'Mux + Next.js', metaDescription, - image, + image = 'https://with-mux-video.vercel.app/mux-nextjs-og-image.png', children, loadTwitterWidget, }) { diff --git a/examples/with-mux-video/public/mux-nextjs-og-image.png b/examples/with-mux-video/public/mux-nextjs-og-image.png new file mode 100644 index 0000000000000..13075a021eb62 Binary files /dev/null and b/examples/with-mux-video/public/mux-nextjs-og-image.png differ diff --git a/examples/with-tailwindcss/styles/index.css b/examples/with-tailwindcss/styles/index.css index 9dcb43d4b37a9..e668c3b2e8a8a 100644 --- a/examples/with-tailwindcss/styles/index.css +++ b/examples/with-tailwindcss/styles/index.css @@ -6,7 +6,7 @@ @tailwind components; /* Stop purging. */ -/* Write you own custom component styles here */ +/* Write your own custom component styles here */ .btn-blue { @apply bg-blue-500 text-white font-bold py-2 px-4 rounded; } diff --git a/lerna.json b/lerna.json index 297fe0017f10d..19774ebd0fdb0 100644 --- a/lerna.json +++ b/lerna.json @@ -17,5 +17,5 @@ "registry": "https://registry.npmjs.org/" } }, - "version": "9.5.4-canary.22" + "version": "9.5.4-canary.23" } diff --git a/packages/create-next-app/package.json b/packages/create-next-app/package.json index 1ea6f23436a6d..e32bde9c9bdd2 100644 --- a/packages/create-next-app/package.json +++ b/packages/create-next-app/package.json @@ -1,6 +1,6 @@ { "name": "create-next-app", - "version": "9.5.4-canary.22", + "version": "9.5.4-canary.23", "keywords": [ "react", "next", diff --git a/packages/eslint-plugin-next/package.json b/packages/eslint-plugin-next/package.json index 736ebd3ada1af..0bceb3c1941f3 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": "9.5.4-canary.22", + "version": "9.5.4-canary.23", "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 001460a179d78..0a52b90b894e8 100644 --- a/packages/next-bundle-analyzer/package.json +++ b/packages/next-bundle-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "@next/bundle-analyzer", - "version": "9.5.4-canary.22", + "version": "9.5.4-canary.23", "main": "index.js", "license": "MIT", "repository": { diff --git a/packages/next-codemod/package.json b/packages/next-codemod/package.json index 2d347bc098656..83cda8ef0a9ae 100644 --- a/packages/next-codemod/package.json +++ b/packages/next-codemod/package.json @@ -1,6 +1,6 @@ { "name": "@next/codemod", - "version": "9.5.4-canary.22", + "version": "9.5.4-canary.23", "license": "MIT", "dependencies": { "chalk": "4.1.0", diff --git a/packages/next-env/package.json b/packages/next-env/package.json index be690779cce3e..99f68374dab40 100644 --- a/packages/next-env/package.json +++ b/packages/next-env/package.json @@ -1,6 +1,6 @@ { "name": "@next/env", - "version": "9.5.4-canary.22", + "version": "9.5.4-canary.23", "keywords": [ "react", "next", diff --git a/packages/next-mdx/package.json b/packages/next-mdx/package.json index 9cc9c6f06b215..b5ab3ac80d9e7 100644 --- a/packages/next-mdx/package.json +++ b/packages/next-mdx/package.json @@ -1,6 +1,6 @@ { "name": "@next/mdx", - "version": "9.5.4-canary.22", + "version": "9.5.4-canary.23", "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 87b55ebe91185..5c3acdd908707 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": "9.5.4-canary.22", + "version": "9.5.4-canary.23", "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 5c5df860e37af..a98a97bbef955 100644 --- a/packages/next-plugin-sentry/package.json +++ b/packages/next-plugin-sentry/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-sentry", - "version": "9.5.4-canary.22", + "version": "9.5.4-canary.23", "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 7dde74b62f637..4add0a056b175 100644 --- a/packages/next-plugin-storybook/package.json +++ b/packages/next-plugin-storybook/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-storybook", - "version": "9.5.4-canary.22", + "version": "9.5.4-canary.23", "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 805e54acd3895..649169dfbab73 100644 --- a/packages/next-polyfill-module/package.json +++ b/packages/next-polyfill-module/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-module", - "version": "9.5.4-canary.22", + "version": "9.5.4-canary.23", "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 cc8e5a1e9adcc..521810ba67e80 100644 --- a/packages/next-polyfill-nomodule/package.json +++ b/packages/next-polyfill-nomodule/package.json @@ -1,6 +1,6 @@ { "name": "@next/polyfill-nomodule", - "version": "9.5.4-canary.22", + "version": "9.5.4-canary.23", "description": "A polyfill for non-dead, nomodule browsers.", "main": "dist/polyfill-nomodule.js", "license": "MIT", diff --git a/packages/next/build/babel/preset.ts b/packages/next/build/babel/preset.ts index e4a4c660cc758..8e660e7e02660 100644 --- a/packages/next/build/babel/preset.ts +++ b/packages/next/build/babel/preset.ts @@ -79,6 +79,10 @@ module.exports = ( // In production/development this option is set to `false` so that webpack can handle import/export with tree-shaking modules: 'auto', exclude: ['transform-typeof-symbol'], + include: [ + '@babel/plugin-proposal-optional-chaining', + '@babel/plugin-proposal-nullish-coalescing-operator', + ], ...options['preset-env'], } diff --git a/packages/next/client/head-manager.ts b/packages/next/client/head-manager.ts index 9308416cfc97b..46f258e8c12c6 100644 --- a/packages/next/client/head-manager.ts +++ b/packages/next/client/head-manager.ts @@ -25,7 +25,12 @@ function reactElementToDOM({ type, props }: JSX.Element): HTMLElement { if (dangerouslySetInnerHTML) { el.innerHTML = dangerouslySetInnerHTML.__html || '' } else if (children) { - el.textContent = typeof children === 'string' ? children : children.join('') + el.textContent = + typeof children === 'string' + ? children + : Array.isArray(children) + ? children.join('') + : '' } return el } @@ -43,7 +48,12 @@ function updateElements( let title = '' if (tag) { const { children } = tag.props - title = typeof children === 'string' ? children : children.join('') + title = + typeof children === 'string' + ? children + : Array.isArray(children) + ? children.join('') + : '' } if (title !== document.title) document.title = title return diff --git a/packages/next/package.json b/packages/next/package.json index 0c45c06b5558d..46d73cc021d5f 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "next", - "version": "9.5.4-canary.22", + "version": "9.5.4-canary.23", "description": "The React Framework", "main": "./dist/server/next.js", "license": "MIT", @@ -76,10 +76,10 @@ "@babel/preset-typescript": "7.10.4", "@babel/runtime": "7.11.2", "@babel/types": "7.11.5", - "@next/env": "9.5.4-canary.22", - "@next/polyfill-module": "9.5.4-canary.22", - "@next/react-dev-overlay": "9.5.4-canary.22", - "@next/react-refresh-utils": "9.5.4-canary.22", + "@next/env": "9.5.4-canary.23", + "@next/polyfill-module": "9.5.4-canary.23", + "@next/react-dev-overlay": "9.5.4-canary.23", + "@next/react-refresh-utils": "9.5.4-canary.23", "ast-types": "0.13.2", "babel-plugin-transform-define": "2.0.0", "babel-plugin-transform-react-remove-prop-types": "0.4.24", @@ -122,7 +122,7 @@ "react-dom": "^16.6.0" }, "devDependencies": { - "@next/polyfill-nomodule": "9.5.4-canary.22", + "@next/polyfill-nomodule": "9.5.4-canary.23", "@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 202b9b4e20293..9f7819a53bf8b 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": "9.5.4-canary.22", + "version": "9.5.4-canary.23", "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 624fa4784e3b9..b88b16ebf3fd9 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": "9.5.4-canary.22", + "version": "9.5.4-canary.23", "description": "An experimental package providing utilities for React Refresh.", "repository": { "url": "vercel/next.js", diff --git a/release-stats.sh b/release-stats.sh new file mode 100755 index 0000000000000..406d1620f084e --- /dev/null +++ b/release-stats.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +git describe --exact-match + +if [[ ! $? -eq 0 ]];then + echo "Nothing to publish, exiting.." + touch SKIP_NEXT_STATS.txt + exit 0; +fi + +if [[ -z "$NPM_TOKEN" ]];then + echo "No NPM_TOKEN, exiting.." + exit 0; +fi + +echo "Publish occurred, running release stats..." +echo "Waiting 30 seconds to allow publish to finalize" +sleep 30 diff --git a/test/integration/client-navigation/pages/nav/head-1.js b/test/integration/client-navigation/pages/nav/head-1.js index b1b9bbfd83cb1..193784d6b3dc2 100644 --- a/test/integration/client-navigation/pages/nav/head-1.js +++ b/test/integration/client-navigation/pages/nav/head-1.js @@ -11,5 +11,8 @@ export default (props) => ( to head 2 + + to head 3 + ) diff --git a/test/integration/client-navigation/pages/nav/head-3.js b/test/integration/client-navigation/pages/nav/head-3.js new file mode 100644 index 0000000000000..218e5369d75f6 --- /dev/null +++ b/test/integration/client-navigation/pages/nav/head-3.js @@ -0,0 +1,15 @@ +import React from 'react' +import Head from 'next/head' +import Link from 'next/link' + +export default (props) => ( +
+ + + + + + to head 1 + +
+) diff --git a/test/integration/client-navigation/test/index.test.js b/test/integration/client-navigation/test/index.test.js index 053bdb1e4ba51..ec697fa9f4b0d 100644 --- a/test/integration/client-navigation/test/index.test.js +++ b/test/integration/client-navigation/test/index.test.js @@ -1237,6 +1237,27 @@ describe('Client Navigation', () => { .elementByCss('meta[name="description"]') .getAttribute('content') ).toBe('Head One') + + await browser + .elementByCss('#to-head-3') + .click() + .waitForElementByCss('#head-3', 3000) + expect( + await browser + .elementByCss('meta[name="description"]') + .getAttribute('content') + ).toBe('Head Three') + expect(await browser.eval('document.title')).toBe('') + + await browser + .elementByCss('#to-head-1') + .click() + .waitForElementByCss('#head-1', 3000) + expect( + await browser + .elementByCss('meta[name="description"]') + .getAttribute('content') + ).toBe('Head One') } finally { if (browser) { await browser.close()
{process.env.NEXT_PUBLIC_DEVELOPMENT_ENV_VARIABLE} - .env.develoment + .env.development