diff --git a/.github/ISSUE_TEMPLATE/1.Bug_report.md b/.github/ISSUE_TEMPLATE/1.Bug_report.md index 6c10e9edc66b..ba86015e91e3 100644 --- a/.github/ISSUE_TEMPLATE/1.Bug_report.md +++ b/.github/ISSUE_TEMPLATE/1.Bug_report.md @@ -1,6 +1,6 @@ --- name: Bug report -about: Create a bug report for the Next.js core +about: Create a bug report for the Next.js core / examples --- # Bug report diff --git a/.github/ISSUE_TEMPLATE/3.Example_Bug_report.md b/.github/ISSUE_TEMPLATE/3.Example_Bug_report.md deleted file mode 100644 index a1640aee8e59..000000000000 --- a/.github/ISSUE_TEMPLATE/3.Example_Bug_report.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -name: Bug report for examples -about: Create a bug report for one of the Next.js examples ---- - -# Examples bug report - -## Example name - -Provide the example name - -## 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. 6.0.2] - -## Additional context - -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/8.Question_about_next.md b/.github/ISSUE_TEMPLATE/8.Question_about_next.md deleted file mode 100644 index fdfd0c1e9ee1..000000000000 --- a/.github/ISSUE_TEMPLATE/8.Question_about_next.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: Question about Next.js -about: If you have a question related to Next.js or the examples. Reach out to the community on GitHub discussions ---- - -# Question about Next.js - -GitHub Issues are reserved for Bug reports and Feature requests. - -The best place to get your question answered is to post it on GitHub Discussions: https://github.com/zeit/next.js/discussions/new. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000000..3ea766fd6d3a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Ask a question + url: https://github.com/zeit/next.js/discussions + about: Ask questions and discuss with other community members diff --git a/errors/reserved-page-prop.md b/errors/reserved-page-prop.md new file mode 100644 index 000000000000..ae83aaababfe --- /dev/null +++ b/errors/reserved-page-prop.md @@ -0,0 +1,9 @@ +# Reserved Page Prop + +#### Why This Error Occurred + +In a page's `getInitialProps` a reserved prop was returned. Currently the only reserved page prop is `url` for legacy reasons. + +#### Possible Ways to Fix It + +Change the name of the prop returned from `getInitialProps` to any other name. diff --git a/examples/with-apollo/lib/apollo.js b/examples/with-apollo/lib/apollo.js index e13a68f240ab..17a40a6d309c 100644 --- a/examples/with-apollo/lib/apollo.js +++ b/examples/with-apollo/lib/apollo.js @@ -1,5 +1,6 @@ import React from 'react' import App from 'next/app' +import Head from 'next/head' import { ApolloProvider } from '@apollo/react-hooks' import createApolloClient from '../apolloClient' @@ -153,6 +154,10 @@ export const withApollo = ({ ssr = false } = {}) => PageComponent => { // https://www.apollographql.com/docs/react/api/react-apollo.html#graphql-query-data-error console.error('Error while running `getDataFromTree`', error) } + + // getDataFromTree does not call componentWillUnmount + // head side effect therefore need to be cleared manually + Head.rewind() } } diff --git a/lerna.json b/lerna.json index 16f7b566a72b..d7ce38857e23 100644 --- a/lerna.json +++ b/lerna.json @@ -12,5 +12,5 @@ "registry": "https://registry.npmjs.org/" } }, - "version": "9.2.3-canary.12" + "version": "9.2.3-canary.13" } diff --git a/packages/create-next-app/package.json b/packages/create-next-app/package.json index 964c2db771de..6036cbedc0d7 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.2.3-canary.12", + "version": "9.2.3-canary.13", "keywords": [ "react", "next", diff --git a/packages/next-bundle-analyzer/package.json b/packages/next-bundle-analyzer/package.json index 1fbd0f861d5d..9dc52445a1f5 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.2.3-canary.12", + "version": "9.2.3-canary.13", "main": "index.js", "license": "MIT", "repository": { diff --git a/packages/next-mdx/package.json b/packages/next-mdx/package.json index 7e738971e6e1..63b50800e02c 100644 --- a/packages/next-mdx/package.json +++ b/packages/next-mdx/package.json @@ -1,6 +1,6 @@ { "name": "@next/mdx", - "version": "9.2.3-canary.12", + "version": "9.2.3-canary.13", "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 be4a9963fb26..27c703f307cb 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.2.3-canary.12", + "version": "9.2.3-canary.13", "nextjs": { "name": "Google Analytics", "required-env": [ diff --git a/packages/next-plugin-material-ui/package.json b/packages/next-plugin-material-ui/package.json index e6c68f5361de..64968e3e1954 100644 --- a/packages/next-plugin-material-ui/package.json +++ b/packages/next-plugin-material-ui/package.json @@ -1,6 +1,6 @@ { "name": "@next/plugin-material-ui", - "version": "9.2.3-canary.12", + "version": "9.2.3-canary.13", "nextjs": { "name": "Material UI", "required-env": [] diff --git a/packages/next-plugin-sentry/package.json b/packages/next-plugin-sentry/package.json index 8856bcab3352..4f01cec1aede 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.2.3-canary.12", + "version": "9.2.3-canary.13", "nextjs": { "name": "Sentry", "required-env": [ diff --git a/packages/next-polyfill-nomodule/package.json b/packages/next-polyfill-nomodule/package.json index 84df2a082b10..5c15bfa50511 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.2.3-canary.12", + "version": "9.2.3-canary.13", "description": "A polyfill for non-dead, nomodule browsers.", "main": "dist/polyfill-nomodule.js", "license": "MIT", diff --git a/packages/next/README.md b/packages/next/README.md index eb677e47512d..1696181cd3d1 100644 --- a/packages/next/README.md +++ b/packages/next/README.md @@ -10,7 +10,7 @@ - +
diff --git a/packages/next/build/babel/plugins/next-ssg-transform.ts b/packages/next/build/babel/plugins/next-ssg-transform.ts index b4039bbe7616..2a7cea08e6b7 100644 --- a/packages/next/build/babel/plugins/next-ssg-transform.ts +++ b/packages/next/build/babel/plugins/next-ssg-transform.ts @@ -1,10 +1,12 @@ import { NodePath, PluginObj } from '@babel/core' import * as BabelTypes from '@babel/types' import { SERVER_PROPS_SSG_CONFLICT } from '../../../lib/constants' +import { + STATIC_PROPS_ID, + SERVER_PROPS_ID, +} from '../../../next-server/lib/constants' const pageComponentVar = '__NEXT_COMP' -const prerenderId = '__N_SSG' -const serverPropsId = '__N_SSP' export const EXPORT_NAME_GET_STATIC_PROPS = 'unstable_getStaticProps' export const EXPORT_NAME_GET_STATIC_PATHS = 'unstable_getStaticPaths' @@ -53,7 +55,7 @@ function decorateSsgExport( '=', t.memberExpression( t.identifier(pageComponentVar), - t.identifier(state.isPrerender ? prerenderId : serverPropsId) + t.identifier(state.isPrerender ? STATIC_PROPS_ID : SERVER_PROPS_ID) ), t.booleanLiteral(true) ), @@ -80,7 +82,7 @@ function decorateSsgExport( '=', t.memberExpression( t.identifier((defaultSpecifier as any).local.name), - t.identifier(state.isPrerender ? prerenderId : serverPropsId) + t.identifier(state.isPrerender ? STATIC_PROPS_ID : SERVER_PROPS_ID) ), t.booleanLiteral(true) ), diff --git a/packages/next/build/index.ts b/packages/next/build/index.ts index 841f5472178b..849dff8b950b 100644 --- a/packages/next/build/index.ts +++ b/packages/next/build/index.ts @@ -569,12 +569,13 @@ export default async function build(dir: string, conf = null): Promise extends React.Component<
render() {
const { router, Component, pageProps } = this.props as AppProps url: {url} url: {url}