Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vercel/next.js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 80c9522750a269a78c5636ace777a734b9dcd767
Choose a base ref
...
head repository: vercel/next.js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 99abb8bfd7f662efb942763332b87f4348b8844d
Choose a head ref
Loading
Showing 4,006 changed files with 231,635 additions and 241,848 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 2 additions & 0 deletions .alexignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CODE_OF_CONDUCT.md
examples/
21 changes: 21 additions & 0 deletions .alexrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"allow": [
"attacks",
"color",
"dead",
"execute",
"executed",
"executes",
"execution",
"executions",
"failed",
"failure",
"failures",
"fire",
"fires",
"hook",
"hooks",
"host-hostess",
"invalid"
]
}
15 changes: 13 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -2,8 +2,15 @@ node_modules
**/.next/**
**/_next/**
**/dist/**
e2e-tests/**
examples/with-eslint/**
examples/with-typescript-eslint-jest/**
examples/with-kea/**
examples/with-custom-babel-config/**
examples/with-flow/**
examples/with-jest/**
examples/with-mobx-state-tree/**
examples/with-mobx/**
packages/next/bundles/webpack/packages/*.runtime.js
packages/next/compiled/**/*
packages/react-refresh-utils/**/*.js
@@ -15,5 +22,9 @@ packages/next-codemod/transforms/__tests__/**/*
packages/next-codemod/**/*.js
packages/next-codemod/**/*.d.ts
packages/next-env/**/*.d.ts
test/integration/async-modules/**
test-timings.json
packages/create-next-app/templates/**
test/integration/eslint/**
test-timings.json
packages/next/build/swc/tests/**
bench/nested-deps/pages/**
bench/nested-deps/components/**
16 changes: 13 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"root": true,
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"plugins": ["react", "react-hooks", "jest", "import"],
"env": {
"browser": true,
@@ -9,10 +9,17 @@
"node": true
},
"parserOptions": {
"ecmaVersion": 2018,
"requireConfigFile": false,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
},
"babelOptions": {
"presets": ["@babel/preset-env", "@babel/preset-react"],
"caller": {
// Eslint supports top level await when a parser for it is included. We enable the parser by default for Babel.
"supportsTopLevelAwait": true
}
}
},
"settings": {
@@ -27,7 +34,10 @@
"extends": ["plugin:jest/recommended"],
"rules": {
"jest/expect-expect": "off",
"jest/no-disabled-tests": "off"
"jest/no-disabled-tests": "off",
"jest/no-conditional-expect": "off",
"jest/valid-title": "off",
"jest/no-interpolation-in-snapshots": "off"
}
},
{ "files": ["**/__tests__/**"], "env": { "jest": true } },
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages/next/bundles/** -text
packages/next/compiled/** -text
6 changes: 3 additions & 3 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Learn how to add code owners here:
# https://help.github.com/en/articles/about-code-owners

* @timneutkens @Timer @ijjk @lfades
/docs/ @timneutkens @Timer @ijjk @lfades @chibicode
/examples/ @timneutkens @Timer @ijjk @lfades @chibicode
* @timneutkens @ijjk @shuding @styfle @huozhi @padmaia
/docs/ @timneutkens @ijjk @shuding @styfle @huozhi @padmaia @leerob @lfades @molebox
/examples/ @timneutkens @ijjk @shuding @leerob @lfades
28 changes: 17 additions & 11 deletions .github/ISSUE_TEMPLATE/1.bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,73 @@
name: Bug Report
about: Create a bug report for the Next.js core
title: ''
description: Create a bug report for the Next.js core
labels: 'template: bug'
issue_body: true
inputs:
- type: description
body:
- type: markdown
attributes:
value: Thanks for taking the time to file a bug report! Please fill out this form as completely as possible.
- type: description
- type: markdown
attributes:
value: If you leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Help" section.
- type: description
- type: markdown
attributes:
value: 'Please first verify if your issue exists in the Next.js canary release line: `npm install next@canary`.'
- type: description
- type: markdown
attributes:
value: 'next@canary is the beta version of Next.js. It includes all features and fixes that are pending to land on the stable release line.'
- type: input
attributes:
label: What version of Next.js are you using?
description: 'For example: 10.0.1'
validations:
required: true
- type: input
attributes:
label: What version of Node.js are you using?
description: 'For example: 12.0.0'
validations:
required: true
- type: input
attributes:
label: What browser are you using?
description: 'For example: Chrome, Safari'
validations:
required: true
- type: input
attributes:
label: What operating system are you using?
description: 'For example: macOS, Windows'
validations:
required: true
- type: input
attributes:
label: How are you deploying your application?
description: 'For example: next start, next export, Vercel, Other platform'
validations:
required: true
- type: textarea
attributes:
label: Describe the Bug
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: A clear and concise description of what you expected to happen.
validations:
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.
validations:
required: true
- type: description
- type: markdown
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
- type: markdown
attributes:
value: Contributors should be able to follow the steps provided in order to reproduce the bug.
- type: description
- type: markdown
attributes:
value: These steps are used to add integration tests to ensure the same issue does not happen again. Thanks in advance!
25 changes: 16 additions & 9 deletions .github/ISSUE_TEMPLATE/2.example_bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,73 @@
name: Example Bug Report
about: Create a bug report for the examples
title: ''
description: Create a bug report for the examples
labels: 'type: example,template: bug'
issue_body: true
inputs:
- type: description
body:
- type: markdown
attributes:
value: Thanks for taking the time to file a examples bug report! Please fill out this form as completely as possible.
- type: description
- type: markdown
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'
validations:
required: true
- type: input
attributes:
label: What version of Next.js are you using?
description: 'For example: 10.0.1'
validations:
required: true
- type: input
attributes:
label: What version of Node.js are you using?
description: 'For example: 12.0.0'
validations:
required: true
- type: input
attributes:
label: What browser are you using?
description: 'For example: Chrome, Safari'
validations:
required: true
- type: input
attributes:
label: What operating system are you using?
description: 'For example: macOS, Windows'
validations:
required: true
- type: input
attributes:
label: How are you deploying your application?
description: 'For example: next start, next export, Vercel, Other platform'
validations:
required: true
- type: textarea
attributes:
label: Describe the Bug
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: A clear and concise description of what you expected to happen.
validations:
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.
validations:
required: true
- type: description
- type: markdown
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
- type: markdown
attributes:
value: Contributors should be able to follow the steps provided in order to reproduce the bug.
- type: description
- type: markdown
attributes:
value: Thanks in advance!
13 changes: 7 additions & 6 deletions .github/ISSUE_TEMPLATE/3.feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
name: Feature Request
about: Create a feature request for the Next.js core
title: ''
description: Create a feature request for the Next.js core
labels: 'template: story'
issue_body: true
inputs:
- type: description
body:
- type: markdown
attributes:
value: Thanks for taking the time to file a feature request! Please fill out this form as completely as possible.
- type: description
- type: markdown
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.
validations:
required: true
- type: textarea
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
validations:
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.
validations:
required: true
4 changes: 2 additions & 2 deletions .github/actions/next-stats-action/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM node:10-buster
FROM node:14-buster

LABEL com.github.actions.name="Next.js PR Stats"
LABEL com.github.actions.description="Compares stats of a PR with the main branch"
LABEL repository="https://github.com/zeit/next-stats-action"
LABEL repository="https://github.com/vercel/next-stats-action"

COPY . /next-stats

2 changes: 1 addition & 1 deletion .github/actions/next-stats-action/src/add-comment.js
Original file line number Diff line number Diff line change
@@ -83,7 +83,7 @@ module.exports = async function addComment(
else if (!isGzipItem && !groupKey.match(gzipIgnoreRegex)) return

if (
itemKey !== 'buildDuration' ||
!itemKey.startsWith('buildDuration') ||
(isBenchmark && itemKey.match(/req\/sec/))
) {
if (typeof mainItemVal === 'number') mainRepoTotal += mainItemVal
16 changes: 14 additions & 2 deletions .github/actions/next-stats-action/src/index.js
Original file line number Diff line number Diff line change
@@ -45,6 +45,10 @@ if (!allowedActions.has(actionInfo.actionName) && !actionInfo.isRelease) {
await checkoutRef(actionInfo.prRef, diffRepoDir)
}

if (actionInfo.isRelease) {
process.env.STATS_IS_RELEASE = 'true'
}

// load stats config from allowed locations
const { statsConfig, relativeStatsAppDir } = loadStatsConfig()

@@ -102,14 +106,22 @@ if (!allowedActions.has(actionInfo.actionName) && !actionInfo.isRelease) {
logger(`Running initial build for ${dir}`)
if (!actionInfo.skipClone) {
let buildCommand = `cd ${dir}${
!statsConfig.skipInitialInstall ? ' && yarn install' : ''
!statsConfig.skipInitialInstall
? ' && yarn install --network-timeout 1000000'
: ''
}`

if (statsConfig.initialBuildCommand) {
buildCommand += ` && ${statsConfig.initialBuildCommand}`
}
await exec(buildCommand)
// allow 5 minutes node_modules install + building all packages
// in case of noisy environment slowing down initial repo build
await exec(buildCommand, false, { timeout: 5 * 60 * 1000 })
}
await fs.copy(
path.join(__dirname, '../native'),
path.join(dir, 'packages/next/native')
)

logger(`Linking packages in ${dir}`)
const pkgPaths = await linkPackages(dir)
14 changes: 13 additions & 1 deletion .github/actions/next-stats-action/src/prepare/repo-setup.js
Original file line number Diff line number Diff line change
@@ -73,6 +73,10 @@ module.exports = (actionInfo) => {
const packedPkgPath = path.join(pkgPath, `${pkg}-packed.tgz`)

const pkgDataPath = path.join(pkgPath, 'package.json')
if (!fs.existsSync(pkgDataPath)) {
console.log(`Skipping ${pkgDataPath}`)
continue
}
const pkgData = require(pkgDataPath)
const { name } = pkgData
pkgDatas.set(name, {
@@ -93,6 +97,14 @@ module.exports = (actionInfo) => {
if (!pkgData.dependencies || !pkgData.dependencies[pkg]) continue
pkgData.dependencies[pkg] = packedPkgPath
}
// make sure native binaries are included in local linking
if (pkg === 'next') {
pkgData.files.push('native')
console.log(
'using swc binaries: ',
await exec(`ls ${path.join(path.dirname(pkgDataPath), 'native')}`)
)
}
await fs.writeFile(
pkgDataPath,
JSON.stringify(pkgData, null, 2),
@@ -104,7 +116,7 @@ module.exports = (actionInfo) => {
// to the correct versions
for (const pkgName of pkgDatas.keys()) {
const { pkg, pkgPath } = pkgDatas.get(pkgName)
await exec(`cd ${pkgPath} && yarn pack -f ${pkg}-packed.tgz`)
await exec(`cd ${pkgPath} && yarn pack -f ${pkg}-packed.tgz`, true)
}
return pkgPaths
},
Loading