Skip to content

Commit

Permalink
Merge branch 'canary' into patch-1
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/next/pages/_document.tsx
  • Loading branch information
ijjk committed Feb 7, 2022
2 parents 4ecefb7 + 938eb0e commit 1138a3b
Show file tree
Hide file tree
Showing 5,047 changed files with 279,331 additions and 300,275 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
@@ -0,0 +1,2 @@
CODE_OF_CONDUCT.md
examples/
21 changes: 21 additions & 0 deletions .alexrc
@@ -0,0 +1,21 @@
{
"allow": [
"attacks",
"color",
"dead",
"execute",
"executed",
"executes",
"execution",
"executions",
"failed",
"failure",
"failures",
"fire",
"fires",
"hook",
"hooks",
"host-hostess",
"invalid"
]
}
18 changes: 16 additions & 2 deletions .eslintignore
Expand Up @@ -2,9 +2,17 @@ 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/bundles/webpack/packages/lazy-compilation-*.js
packages/next/compiled/**/*
packages/react-refresh-utils/**/*.js
packages/react-dev-overlay/lib/**
Expand All @@ -15,5 +23,11 @@ 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/development/basic/legacy-decorators/**/*
test/production/emit-decorator-metadata/**/*.js
test-timings.json
packages/next-swc/crates/**
bench/nested-deps/pages/**
bench/nested-deps/components/**
19 changes: 15 additions & 4 deletions .eslintrc.json
@@ -1,6 +1,6 @@
{
"root": true,
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"plugins": ["react", "react-hooks", "jest", "import"],
"env": {
"browser": true,
Expand All @@ -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": {
Expand All @@ -23,11 +30,15 @@
},
"overrides": [
{
"files": ["test/**/*.test.js"],
"files": ["test/**/*.js", "test/**/*.ts", "**/*.test.ts"],
"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",
"jest/no-export": "off"
}
},
{ "files": ["**/__tests__/**"], "env": { "jest": true } },
Expand Down
2 changes: 2 additions & 0 deletions .gitattributes
@@ -0,0 +1,2 @@
packages/next/bundles/** -text
packages/next/compiled/** -text
1 change: 1 addition & 0 deletions .github/.kodiak.toml
Expand Up @@ -13,6 +13,7 @@ notify_on_conflict = false
[merge.message]
title = "pull_request_title"
body = "pull_request_body"
include_coauthors= true
include_pr_number = true
body_type = "markdown"
strip_html_comments = true
24 changes: 21 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
@@ -1,6 +1,24 @@
# Learn how to add code owners here:
# https://help.github.com/en/articles/about-code-owners

* @timneutkens @ijjk @lfades @divmain @shuding
/docs/ @timneutkens @ijjk @lfades @divmain @shuding @leerob
/examples/ @timneutkens @ijjk @lfades @divmain @shuding @leerob
* @timneutkens @ijjk @shuding @huozhi
/.github/ @timneutkens @ijjk @shuding @styfle @huozhi @padmaia
/docs/ @timneutkens @ijjk @shuding @styfle @huozhi @padmaia @leerob @lfades @molebox
/examples/ @timneutkens @ijjk @shuding @leerob @lfades @steven-tey

# SWC Build (@padmaia)

/packages/next/build/ @timneutkens @ijjk @shuding @padmaia @huozhi

# Image Component (@styfle)

/examples/image-component/ @timneutkens @ijjk @shuding @styfle
/packages/next/build/webpack/loaders/next-image-loader.js @timneutkens @ijjk @shuding @styfle
/packages/next/client/image.tsx @timneutkens @ijjk @shuding @styfle
/packages/next/image-types/ @timneutkens @ijjk @shuding @styfle
/packages/next/server/image-config.ts @timneutkens @ijjk @shuding @styfle
/packages/next/server/image-optimizer.ts @timneutkens @ijjk @shuding @styfle
/packages/next/server/serve-static.ts @timneutkens @ijjk @shuding @styfle
/packages/next/server/config.ts @timneutkens @ijjk @shuding @styfle
/test/integration/image-optimizer/ @timneutkens @ijjk @shuding @styfle
/test/integration/image-component/ @timneutkens @ijjk @shuding @styfle
10 changes: 7 additions & 3 deletions .github/ISSUE_TEMPLATE/1.bug_report.yml
@@ -1,8 +1,6 @@
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
body:
- type: markdown
attributes:
Expand All @@ -16,6 +14,12 @@ body:
- 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: textarea
attributes:
label: Run `next info` (available from version 12.0.8 and up)
description: Please run `next info` in the root directory of your project and paste the results. You might need to use `npx --no-install next info` if next is not in the current PATH.
validations:
required: false
- type: input
attributes:
label: What version of Next.js are you using?
Expand Down
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/2.example_bug_report.yml
@@ -1,8 +1,6 @@
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
body:
- type: markdown
attributes:
Expand Down
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/3.feature_request.yml
@@ -1,8 +1,6 @@
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
body:
- type: markdown
attributes:
Expand Down
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/4.docs_request.yml
@@ -0,0 +1,24 @@
name: 'Docs Request for an Update or Improvement'
description: A request to update or improve Next.js documentation
title: 'Docs: '
labels:
- 'template: documentation'
body:
- type: textarea
attributes:
label: What is the improvement or update you wish to see?
description: 'Example: I would like to see more examples of how to use the `<Link>` component. Or, the `<Link>` component docs are missing information.'
validations:
required: true
- type: textarea
attributes:
label: Is there any context that might help us understand?
description: A clear description of any added context that might help us understand.
validations:
required: true
- type: input
attributes:
label: Does the docs page already exist? Please link to it.
description: 'Example: https://nextjs.org/docs/api-reference/next/link'
validations:
required: false
4 changes: 2 additions & 2 deletions .github/actions/next-stats-action/Dockerfile
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion .github/actions/next-stats-action/src/add-comment.js
Expand Up @@ -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
Expand Down
21 changes: 19 additions & 2 deletions .github/actions/next-stats-action/src/index.js
Expand Up @@ -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()

Expand Down Expand Up @@ -102,14 +106,27 @@ 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-swc/native')
)
// TODO: remove after next stable release (current v12.0.4)
await fs.copy(
path.join(__dirname, '../native'),
path.join(dir, 'packages/next/native')
)

logger(`Linking packages in ${dir}`)
const pkgPaths = await linkPackages(dir)
Expand Down
25 changes: 24 additions & 1 deletion .github/actions/next-stats-action/src/prepare/repo-setup.js
Expand Up @@ -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, {
Expand All @@ -93,6 +97,25 @@ 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/swc') {
if (!pkgData.files) {
pkgData.files = []
}
pkgData.files.push('native')
console.log(
'using swc binaries: ',
await exec(`ls ${path.join(path.dirname(pkgDataPath), 'native')}`)
)
}
if (pkg === 'next') {
if (pkgDatas.get('@next/swc')) {
pkgData.dependencies['@next/swc'] =
pkgDatas.get('@next/swc').packedPkgPath
} else {
pkgData.files.push('native')
}
}
await fs.writeFile(
pkgDataPath,
JSON.stringify(pkgData, null, 2),
Expand All @@ -104,7 +127,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
},
Expand Down

0 comments on commit 1138a3b

Please sign in to comment.