diff --git a/.eslintignore b/.eslintignore
index c0a1165bb2d41..d168d82d7a560 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -26,6 +26,7 @@ packages/next-env/**/*.d.ts
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/**
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 8d45c2a88972c..569ca335626ae 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -12,13 +12,8 @@
# 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
+/**/*image*/** @timneutkens @ijjk @shuding @styfle
+/packages/next/client/use-intersection.tsx @timneutkens @ijjk @shuding @styfle
+/packages/next/server/lib/squoosh/ @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
diff --git a/.github/ISSUE_TEMPLATE/1.bug_report.yml b/.github/ISSUE_TEMPLATE/1.bug_report.yml
index d0aa0b7589ace..dbce6318ee4af 100644
--- a/.github/ISSUE_TEMPLATE/1.bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/1.bug_report.yml
@@ -7,49 +7,28 @@ body:
value: Thanks for taking the time to file a bug report! Please fill out this form as completely as possible.
- 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: markdown
- attributes:
- value: 'Please first verify if your issue exists in the Next.js canary release line: `npm install next@canary`.'
- - 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.'
+ value: If you leave out sections there is a high likelihood it will be moved to the GitHub Discussions ["Help" section](https://github.com/vercel/next.js/discussions/categories/help).
+ - type: checkboxes
+ attributes:
+ label: Verify canary release
+ description: '`next@canary` is the canary version of Next.js that ships daily. It includes all features and fixes that have not been released to the stable version yet. Think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces before opening a new issue.'
+ options:
+ - label: I verified that the issue exists in Next.js canary release
+ required: true
- type: textarea
attributes:
- label: Run `next info` (available from version 12.0.8 and up)
+ label: Provide environment information
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?
- 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
+ label: What browser are you using? (if relevant)
+ description: 'Please specify the exact version. For example: Chrome 100.0.4878.0'
- 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?
+ label: How are you deploying your application? (if relevant)
description: 'For example: next start, next export, Vercel, Other platform'
- validations:
- required: true
- type: textarea
attributes:
label: Describe the Bug
diff --git a/.github/ISSUE_TEMPLATE/2.example_bug_report.yml b/.github/ISSUE_TEMPLATE/2.example_bug_report.yml
index 8535a441bf4a7..04483f5a4518c 100644
--- a/.github/ISSUE_TEMPLATE/2.example_bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/2.example_bug_report.yml
@@ -1,49 +1,40 @@
name: Example Bug Report
-description: Create a bug report for the examples
+description: Create a bug report for one of the Next.js examples
labels: 'type: example,template: bug'
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.
+ value: Thanks for taking the time to file a bug report for [one of the examples](https://github.com/vercel/next.js/tree/canary/examples)! Please fill out this form as completely as possible.
- 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
+ value: If you leave out sections there is a high likelihood it will be moved to the GitHub Discussions ["Help" section](https://github.com/vercel/next.js/discussions/categories/help).
+ - type: checkboxes
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
+ label: Verify canary release
+ description: '`next@canary` is the canary version of Next.js that ships daily. It includes all features and fixes that have not been released to the stable version yet. Think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces before opening a new issue.'
+ options:
+ - label: I verified that the issue exists in Next.js canary release
+ required: true
+ - type: textarea
attributes:
- label: What version of Node.js are you using?
- description: 'For example: 12.0.0'
+ label: Provide environment information
+ 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: true
- type: input
attributes:
- label: What browser are you using?
- description: 'For example: Chrome, Safari'
+ label: Which example does this report relate to?
+ description: "See a complete list in the [examples folder](https://github.com/vercel/next.js/tree/canary/examples). For example: with-styled-components. Note: Examples not in the examples folder might be maintained by the example's library author. Check out their projects before opening the issue on Next.js"
validations:
required: true
- type: input
attributes:
- label: What operating system are you using?
- description: 'For example: macOS, Windows'
- validations:
- required: true
+ label: What browser are you using? (if relevant)
+ description: 'Please specify the exact version. For example: Chrome 100.0.4878.0'
- type: input
attributes:
- label: How are you deploying your application?
+ label: How are you deploying your application? (if relevant)
description: 'For example: next start, next export, Vercel, Other platform'
- validations:
- required: true
- type: textarea
attributes:
label: Describe the Bug
diff --git a/.github/workflows/build_test_deploy.yml b/.github/workflows/build_test_deploy.yml
index 7906496c0d9ad..ff748b463394e 100644
--- a/.github/workflows/build_test_deploy.yml
+++ b/.github/workflows/build_test_deploy.yml
@@ -88,6 +88,46 @@ jobs:
- run: ./scripts/check-manifests.js
- run: yarn lint
+ rust-check:
+ runs-on: ubuntu-latest
+ needs: build
+ steps:
+ - name: Install
+ uses: actions-rs/toolchain@v1
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
+ with:
+ profile: minimal
+ toolchain: nightly-2021-11-15
+ components: rustfmt, clippy
+
+ - name: Cache cargo registry
+ uses: actions/cache@v2
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
+ with:
+ path: ~/.cargo/registry
+ key: stable-ubuntu-clippy-cargo-registry
+
+ - name: Cache cargo index
+ uses: actions/cache@v2
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
+ with:
+ path: ~/.cargo/git
+ key: stable-ubuntu-clippy-cargo-index
+
+ - uses: actions/cache@v2
+ id: restore-build
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
+ with:
+ path: ./*
+ key: ${{ github.sha }}-${{ github.run_number }}-${{ github.run_attempt }}
+
+ - name: Check
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
+ run: |
+ cargo fmt -- --check
+ cargo clippy --all -- -D warnings
+ working-directory: packages/next-swc
+
checkPrecompiled:
name: Check Pre-compiled
runs-on: ubuntu-latest
@@ -97,7 +137,7 @@ jobs:
steps:
- name: Setup node
uses: actions/setup-node@v2
- if: ${{ steps.docs-change.outputs.docsChange != 'docs only change' }}
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
with:
node-version: 14
@@ -141,7 +181,7 @@ jobs:
steps:
- name: Setup node
uses: actions/setup-node@v2
- if: ${{ steps.docs-change.outputs.docsChange != 'docs only change' }}
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
with:
node-version: 14
@@ -171,7 +211,7 @@ jobs:
steps:
- name: Setup node
uses: actions/setup-node@v2
- if: ${{ steps.docs-change.outputs.docsChange != 'docs only change' }}
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
with:
node-version: 14
@@ -201,6 +241,52 @@ jobs:
name: Run test/development
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
+ - name: Upload test trace
+ if: always()
+ uses: actions/upload-artifact@v2
+ with:
+ name: test-trace
+ if-no-files-found: ignore
+ retention-days: 2
+ path: |
+ test/traces
+
+ testDevE2E:
+ name: Test Development (E2E)
+ runs-on: ubuntu-latest
+ needs: [build, build-native-dev]
+ env:
+ NEXT_TELEMETRY_DISABLED: 1
+ NEXT_TEST_JOB: 1
+ steps:
+ - name: Setup node
+ uses: actions/setup-node@v2
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
+ with:
+ node-version: 14
+
+ - run: echo ${{needs.build.outputs.docsChange}}
+
+ # https://github.com/actions/virtual-environments/issues/1187
+ - name: tune linux network
+ run: sudo ethtool -K eth0 tx off rx off
+
+ - uses: actions/cache@v2
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
+ id: restore-build
+ with:
+ path: ./*
+ key: ${{ github.sha }}-${{ github.run_number }}-${{ github.run_attempt }}
+
+ - uses: actions/download-artifact@v2
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
+ with:
+ name: next-swc-dev-binary
+ path: packages/next-swc/native
+
+ - run: npm i -g playwright-chromium@1.14.1 && npx playwright install-deps
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
+
- run: NEXT_TEST_MODE=dev node run-tests.js --type e2e
name: Run test/e2e (dev)
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
@@ -225,7 +311,7 @@ jobs:
steps:
- name: Setup node
uses: actions/setup-node@v2
- if: ${{ steps.docs-change.outputs.docsChange != 'docs only change' }}
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
with:
node-version: 14
@@ -255,6 +341,42 @@ jobs:
name: Run test/production
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
+ testProdE2E:
+ name: Test Production (E2E)
+ runs-on: ubuntu-latest
+ needs: [build, build-native-dev]
+ env:
+ NEXT_TELEMETRY_DISABLED: 1
+ NEXT_TEST_JOB: 1
+ steps:
+ - name: Setup node
+ uses: actions/setup-node@v2
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
+ with:
+ node-version: 14
+
+ - run: echo ${{needs.build.outputs.docsChange}}
+
+ # https://github.com/actions/virtual-environments/issues/1187
+ - name: tune linux network
+ run: sudo ethtool -K eth0 tx off rx off
+
+ - uses: actions/cache@v2
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
+ id: restore-build
+ with:
+ path: ./*
+ key: ${{ github.sha }}-${{ github.run_number }}-${{ github.run_attempt }}
+
+ - uses: actions/download-artifact@v2
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
+ with:
+ name: next-swc-dev-binary
+ path: packages/next-swc/native
+
+ - run: npm i -g playwright-chromium@1.14.1 && npx playwright install-deps
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
+
- run: NEXT_TEST_MODE=start node run-tests.js --type e2e
name: Run test/e2e (production)
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
@@ -270,11 +392,11 @@ jobs:
strategy:
fail-fast: false
matrix:
- group: [1, 2, 3, 4, 5, 6]
+ group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
steps:
- name: Setup node
uses: actions/setup-node@v2
- if: ${{ steps.docs-change.outputs.docsChange != 'docs only change' }}
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
with:
node-version: 14
@@ -291,6 +413,10 @@ jobs:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}-${{ github.run_attempt }}
+ - uses: pnpm/action-setup@v2.2.1
+ with:
+ version: 6.32.2
+
- uses: actions/download-artifact@v2
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
with:
@@ -300,7 +426,7 @@ jobs:
- run: npm i -g playwright-chromium@1.14.1 && npx playwright install-deps
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
- - run: xvfb-run node run-tests.js --timings -g ${{ matrix.group }}/6
+ - run: xvfb-run node run-tests.js --timings -g ${{ matrix.group }}/18
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
- name: Upload test trace
@@ -324,7 +450,7 @@ jobs:
steps:
- name: Setup node
uses: actions/setup-node@v2
- if: ${{ steps.docs-change.outputs.docsChange != 'docs only change' }}
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
with:
node-version: 14
@@ -374,7 +500,7 @@ jobs:
steps:
- name: Setup node
uses: actions/setup-node@v2
- if: ${{ steps.docs-change.outputs.docsChange != 'docs only change' }}
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
with:
node-version: 14
@@ -409,7 +535,7 @@ jobs:
steps:
- name: Setup node
uses: actions/setup-node@v2
- if: ${{ steps.docs-change.outputs.docsChange != 'docs only change' }}
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
with:
node-version: 14
@@ -453,7 +579,7 @@ jobs:
steps:
- name: Setup node
uses: actions/setup-node@v2
- if: ${{ steps.docs-change.outputs.docsChange != 'docs only change' }}
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
with:
node-version: 14
@@ -490,7 +616,7 @@ jobs:
steps:
- name: Setup node
uses: actions/setup-node@v2
- if: ${{ steps.docs-change.outputs.docsChange != 'docs only change' }}
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
with:
node-version: 17
check-latest: true
@@ -518,19 +644,12 @@ jobs:
- build
- build-wasm
- build-native
- - build-windows-i686
- - build-windows-aarch64
- - build-linux-musl
- - build-linux-arm7
- - build-linux-aarch64-gnu
- - build-android-aarch64
- - build-linux-aarch64-musl
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
steps:
- name: Setup node
uses: actions/setup-node@v2
- if: ${{ steps.docs-change.outputs.docsChange != 'docs only change' }}
+ if: ${{needs.build.outputs.docsChange != 'docs only change'}}
with:
node-version: 14
@@ -565,7 +684,6 @@ jobs:
steps:
- name: Setup node
uses: actions/setup-node@v2
- if: ${{ steps.docs-change.outputs.docsChange != 'docs only change' }}
with:
node-version: 14
@@ -606,7 +724,7 @@ jobs:
uses: actions/setup-node@v2
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
with:
- node-version: 14
+ node-version: 16
check-latest: true
- name: Install
@@ -617,18 +735,18 @@ jobs:
toolchain: nightly-2021-11-15
- name: Cache cargo registry
- uses: actions/cache@v1
+ uses: actions/cache@v2
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
with:
path: ~/.cargo/registry
- key: stable-ubuntu-18.04-node@14-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
+ key: stable-ubuntu-18.04-cargo-registry
- name: Cache cargo index
- uses: actions/cache@v1
+ uses: actions/cache@v2
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
with:
path: ~/.cargo/git
- key: stable-ubuntu-18.04-node@14-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
+ key: stable-ubuntu-18.04-cargo-index
# We use week in the turbo cache key to keep the cache from infinitely growing
- id: get-week
@@ -660,9 +778,7 @@ jobs:
# since the repo's dependencies aren't installed we need
# to install napi globally
- - run: npm i -g @napi-rs/cli@1.2.1
- - run: npm i -g turbo@1.0.28
-
+ - run: npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28
- name: Build
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
run: turbo run build-native --cache-dir=".turbo"
@@ -747,95 +863,137 @@ jobs:
# Build binaries for publishing
build-native:
- needs: build
- if: ${{ needs.build.outputs.isRelease == 'true' }}
strategy:
+ fail-fast: false
matrix:
- os: [ubuntu-18.04, macos-latest, windows-latest]
- description: [default]
- include:
- - os: ubuntu-18.04
- target: x86_64-unknown-linux-gnu
- name: linux-x64-gnu
- - os: windows-latest
- target: x86_64-pc-windows-msvc
- name: win32-x64-msvc
- - os: macos-latest
- target: x86_64-apple-darwin
- name: darwin-x64
- - os: macos-latest
- target: aarch64-apple-darwin
- name: darwin-arm64
- description: m1
-
- name: next-swc - ${{ matrix.os }} - ${{ matrix.target }} - node@14
- runs-on: ${{ matrix.os }}
-
+ settings:
+ - host: macos-latest
+ target: 'x86_64-apple-darwin'
+ build: |
+ npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28
+ turbo run build-native --cache-dir=".turbo" -- --release
+ strip -x packages/next-swc/native/next-swc.*.node
+ - host: windows-latest
+ build: |
+ npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28
+ turbo run build-native --cache-dir=".turbo" -- --release
+ target: 'x86_64-pc-windows-msvc'
+ - host: windows-latest
+ build: |
+ npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28
+ turbo run build-native --cache-dir=".turbo" -- --release --target i686-pc-windows-msvc
+ target: 'i686-pc-windows-msvc'
+ - host: ubuntu-latest
+ target: 'x86_64-unknown-linux-gnu'
+ docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine-zig
+ # Node.js in Baidu need to compatible with `GLIBC_2.12`
+ build: >-
+ set -e &&
+ rustup toolchain install nightly-2021-11-15 &&
+ rustup default nightly-2021-11-15 &&
+ rustup target add x86_64-unknown-linux-gnu &&
+ npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28 &&
+ turbo run build-native --cache-dir=".turbo" -- --release --target x86_64-unknown-linux-gnu --zig --zig-abi-suffix 2.12 &&
+ llvm-strip -x packages/next-swc/native/next-swc.*.node
+ - host: ubuntu-latest
+ target: 'x86_64-unknown-linux-musl'
+ docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
+ build: >-
+ set -e &&
+ rustup toolchain install nightly-2021-11-15 &&
+ rustup default nightly-2021-11-15 &&
+ rustup target add x86_64-unknown-linux-musl &&
+ npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28 &&
+ turbo run build-native --cache-dir=".turbo" -- --release --target x86_64-unknown-linux-musl &&
+ strip packages/next-swc/native/next-swc.*.node
+ - host: macos-latest
+ target: 'aarch64-apple-darwin'
+ build: |
+ sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*;
+ export CC=$(xcrun -f clang);
+ export CXX=$(xcrun -f clang++);
+ SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
+ export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
+ npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28
+ turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-apple-darwin
+ strip -x packages/next-swc/native/next-swc.*.node
+ - host: ubuntu-latest
+ target: 'aarch64-unknown-linux-gnu'
+ docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine-zig
+ build: >-
+ set -e &&
+ rustup toolchain install nightly-2021-11-15 &&
+ rustup default nightly-2021-11-15 &&
+ rustup target add aarch64-unknown-linux-gnu &&
+ npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28 &&
+ turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-unknown-linux-gnu --zig --zig-abi-suffix 2.12 &&
+ llvm-strip -x packages/next-swc/native/next-swc.*.node
+ - host: ubuntu-18.04
+ target: 'armv7-unknown-linux-gnueabihf'
+ setup: |
+ sudo apt-get update
+ sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y
+ build: |
+ npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28
+ turbo run build-native --cache-dir=".turbo" -- --release --target armv7-unknown-linux-gnueabihf
+ arm-linux-gnueabihf-strip packages/next-swc/native/next-swc.*.node
+ - host: ubuntu-latest
+ target: aarch64-linux-android
+ build: |
+ export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang"
+ export CC="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang"
+ export CXX="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang++"
+ export PATH="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}"
+ npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28
+ turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-linux-android
+ ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip packages/next-swc/native/next-swc.*.node
+ - host: ubuntu-latest
+ target: armv7-linux-androideabi
+ build: |
+ export CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang"
+ export CC="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang"
+ export CXX="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang++"
+ export PATH="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}"
+ npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28
+ turbo run build-native --cache-dir=".turbo" -- --release --target armv7-linux-androideabi
+ ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip packages/next-swc/native/next-swc.*.node
+ - host: ubuntu-latest
+ target: 'aarch64-unknown-linux-musl'
+ docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
+ build: >-
+ set -e &&
+ npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28 &&
+ rustup toolchain install nightly-2021-11-15 &&
+ rustup default nightly-2021-11-15 &&
+ rustup target add aarch64-unknown-linux-musl &&
+ turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-unknown-linux-musl &&
+ llvm-strip -x packages/next-swc/native/next-swc.*.node
+ - host: windows-latest
+ target: 'aarch64-pc-windows-msvc'
+ build: |
+ npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28
+ turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-pc-windows-msvc
+ if: ${{ needs.build.outputs.isRelease == 'true' }}
+ needs: build
+ name: stable - ${{ matrix.settings.target }} - node@16
+ runs-on: ${{ matrix.settings.host }}
steps:
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- if: ${{ matrix.os == 'ubuntu-18.04' }}
+ if: ${{ matrix.settings.host == 'ubuntu-18.04' }}
+ - name: tune linux network
+ run: sudo ethtool -K eth0 tx off rx off
+ if: ${{ matrix.settings.host == 'ubuntu-latest' }}
- name: tune windows network
run: Disable-NetAdapterChecksumOffload -Name * -TcpIPv4 -UdpIPv4 -TcpIPv6 -UdpIPv6
- if: ${{ matrix.os == 'windows-latest' }}
+ if: ${{ matrix.settings.host == 'windows-latest' }}
- name: tune mac network
run: sudo sysctl -w net.link.generic.system.hwcksum_tx=0 && sudo sysctl -w net.link.generic.system.hwcksum_rx=0
- if: ${{ matrix.os == 'macos-latest' }}
-
- - name: Setup node
- uses: actions/setup-node@v2
- with:
- node-version: 14
- check-latest: true
-
+ if: ${{ matrix.settings.host == 'macos-latest' }}
# we use checkout here instead of the build cache since
# it can fail to restore in different OS'
- uses: actions/checkout@v2
-
- # since the repo's dependencies aren't installed we need
- # to install napi globally
- - run: npm i -g @napi-rs/cli@1.2.1
- - run: npm i -g turbo@1.0.28
-
- - name: Install
- uses: actions-rs/toolchain@v1
- with:
- profile: minimal
- toolchain: nightly-2021-11-15
- target: ${{ matrix.target }}
-
- - name: Cache cargo registry
- uses: actions/cache@v1
- with:
- path: ~/.cargo/registry
- key: stable-${{ matrix.os }}-node@14-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
-
- - name: Cache cargo index
- uses: actions/cache@v1
- with:
- path: ~/.cargo/git
- key: stable-${{ matrix.os }}-node@14-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
-
- - name: Turbo cache
- id: turbo-cache
- uses: actions/cache@v2
- with:
- path: .turbo
- key: turbo-${{ github.job }}-${{ matrix.name }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }}
- restore-keys: |
- turbo-${{ github.job }}-${{ matrix.name }}-
- turbo-${{ github.job }}-${{ matrix.name }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-
- turbo-${{ github.job }}-${{ matrix.name }}-canary-${{ needs.build.outputs.weekNum }}-
-
- - name: Cross build aarch64 setup
- if: ${{ matrix.target == 'aarch64-apple-darwin' }}
- run: |
- sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*;
- export CC=$(xcrun -f clang);
- export CXX=$(xcrun -f clang++);
- SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
- export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
# We use restore-key to pick latest cache.
# We will not get exact match, but doc says
# "If there are multiple partial matches for a restore key, the action returns the most recently created cache."
@@ -844,164 +1002,9 @@ jobs:
uses: actions/cache@v2
with:
path: ./packages/next-swc/target
- key: next-swc-cargo-cache-${{ matrix.os }}--${{ hashFiles('**/Cargo.lock') }}
- restore-keys: |
- next-swc-cargo-cache-${{ matrix.os }}
-
- - name: 'Build'
- shell: bash
- run: turbo run build-native --cache-dir=".turbo" -- --release --target ${{ matrix.target }}
- env:
- MACOSX_DEPLOYMENT_TARGET: '10.13'
-
- - name: Upload artifact
- uses: actions/upload-artifact@v2.2.4
- with:
- name: next-swc-binaries
- path: packages/next-swc/native/next-swc.${{ matrix.name }}.node
-
- - name: Clear the cargo caches
- run: |
- cargo install cargo-cache --no-default-features --features ci-autoclean
- cargo-cache
-
- build-windows-i686:
- needs: build
- if: ${{ needs.build.outputs.isRelease == 'true' }}
- name: next-swc - windows-i686 - node@14
- runs-on: windows-latest
- env:
- CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 32
- CARGO_PROFILE_RELEASE_LTO: 'false'
- steps:
- - name: Install node x86
- run: |
- choco install nodejs-lts --x86 -y --force
- refreshenv
-
- - name: Set 32bit Node.js path
- run: |
- echo "C:\\Program Files (x86)\\nodejs" >> $GITHUB_PATH
- shell: bash
-
- - name: Node.js arch
- run: node -e "console.log(process.arch)"
-
- # we use checkout here instead of the build cache since
- # it can fail to restore in different OS'
- - uses: actions/checkout@v2
-
- # since the repo's dependencies aren't installed we need
- # to install napi globally
- - run: npm i -g @napi-rs/cli@1.2.1
- - run: npm i -g turbo@1.0.28
- - name: Install Rust
- uses: actions-rs/toolchain@v1
- with:
- profile: minimal
- toolchain: nightly-2021-11-15
- override: true
- target: i686-pc-windows-msvc
-
- - name: Turbo Cache
- id: turbo-cache
- uses: actions/cache@v2
- with:
- path: .turbo
- key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }}
- restore-keys: |
- turbo-${{ github.job }}-
- turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-
- turbo-${{ github.job }}-canary-${{ needs.build.outputs.weekNum }}-
-
- - name: Build
- shell: bash
- run: turbo run build-native --cache-dir=".turbo" -- --release --target i686-pc-windows-msvc
-
- - name: Upload artifact
- uses: actions/upload-artifact@v2
- with:
- name: next-swc-binaries
- path: packages/next-swc/native/next-swc.win32-ia32-msvc.node
-
- build-windows-aarch64:
- needs: build
- if: ${{ needs.build.outputs.isRelease == 'true' }}
- name: next-swc - windows-aarch64 - node@14
- runs-on: windows-latest
- steps:
- - name: Setup node
- uses: actions/setup-node@v2
- with:
- node-version: 14
-
- # we use checkout here instead of the build cache since
- # it can fail to restore in different OS'
- - uses: actions/checkout@v2
-
- # since the repo's dependencies aren't installed we need
- # to install napi globally
- - run: npm i -g @napi-rs/cli@1.2.1
- - run: npm i -g turbo@1.0.28
- - name: Install Rust
- uses: actions-rs/toolchain@v1
- with:
- profile: minimal
- toolchain: nightly-2021-11-15
- override: true
- target: aarch64-pc-windows-msvc
-
- - name: Turbo Cache
- id: turbo-cache
- uses: actions/cache@v2
- with:
- path: .turbo
- key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }}
+ key: next-swc-cargo-cache-${{ matrix.settings.target }}--${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
- turbo-${{ github.job }}-
- turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-
- turbo-${{ github.job }}-canary-${{ needs.build.outputs.weekNum }}-
-
- - name: Build
- shell: bash
- run: turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-pc-windows-msvc
-
- - name: Upload artifact
- uses: actions/upload-artifact@v2
- with:
- name: next-swc-binaries
- path: packages/next-swc/native/next-swc.win32-arm64-msvc.node
-
- build-linux-musl:
- needs: build
- if: ${{ needs.build.outputs.isRelease == 'true' }}
- name: next-swc - linux-musl - node@lts
- runs-on: ubuntu-latest
- steps:
- # we use checkout here instead of the build cache since
- # it can fail to restore in different OS'
- - uses: actions/checkout@v2
-
- - name: Login to registry
- run: |
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
- env:
- DOCKER_REGISTRY_URL: ghcr.io
- DOCKER_USERNAME: ${{ github.actor }}
- DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Cache
- uses: actions/cache@v2
- with:
- path: |
- target/
- key: linux-musl-publish-integration
-
- - name: Pull docker image
- run: |
- docker pull ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
- docker tag ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine builder
-
+ next-swc-cargo-cache-${{ matrix.settings.target }}
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v2
@@ -1013,250 +1016,58 @@ jobs:
turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-
turbo-${{ github.job }}-canary-${{ needs.build.outputs.weekNum }}-
- - name: 'Build'
- run: |
- docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/build -w /build builder sh -c "npm i -g @napi-rs/cli@1.2.1 && npm i -g turbo@1.0.28 && turbo run build-native --cache-dir=".turbo" -- --release --target x86_64-unknown-linux-musl"
-
- - name: Upload artifact
- uses: actions/upload-artifact@v2
- with:
- name: next-swc-binaries
- path: packages/next-swc/native/next-swc.linux-x64-musl.node
-
- build-linux-aarch64-gnu:
- needs: build
- if: ${{ needs.build.outputs.isRelease == 'true' }}
- name: next-swc - aarch64-unknown-linux-gnu - node@14
- runs-on: ubuntu-18.04
- steps:
- - run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
-
- - name: Setup node
- uses: actions/setup-node@v2
- with:
- node-version: 14
-
- # we use checkout here instead of the build cache since
- # it can fail to restore in different OS'
- - uses: actions/checkout@v2
-
- # since the repo's dependencies aren't installed we need
- # to install napi globally
- - run: npm i -g @napi-rs/cli@1.2.1
- - run: npm i -g turbo@1.0.28
-
- - name: Install Rust
- uses: actions-rs/toolchain@v1
- with:
- profile: minimal
- toolchain: nightly-2021-11-15
- override: true
- target: aarch64-unknown-linux-gnu
-
- - name: Cache
- uses: actions/cache@v2
- with:
- path: |
- target/
- key: aarch64-linux-gnu-publish-integration
-
- - name: Install cross compile toolchain
- run: |
- sudo apt-get update
- sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y
-
- - name: Turbo Cache
- id: turbo-cache
- uses: actions/cache@v2
- with:
- path: .turbo
- key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }}
- restore-keys: |
- turbo-${{ github.job }}-
- turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-
- turbo-${{ github.job }}-canary-${{ needs.build.outputs.weekNum }}-
-
- - name: Cross build aarch64
- if: ${{ steps.binary-cache.outputs.cache-hit != 'true' }}
- run: turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-unknown-linux-gnu
-
- - name: Upload artifact
- uses: actions/upload-artifact@v2
- with:
- name: next-swc-binaries
- path: packages/next-swc/native/next-swc.linux-arm64-gnu.node
-
- build-linux-aarch64-musl:
- needs: build
- if: ${{ needs.build.outputs.isRelease == 'true' }}
- name: next-swc - aarch64-unknown-linux-musl - node@14
- runs-on: ubuntu-18.04
- steps:
- name: Setup node
uses: actions/setup-node@v2
+ if: ${{ !matrix.settings.docker }}
with:
- node-version: 14
-
- # we use checkout here instead of the build cache since
- # it can fail to restore in different OS'
- - uses: actions/checkout@v2
+ node-version: 16
+ check-latest: true
+ cache: yarn
- # since the repo's dependencies aren't installed we need
- # to install napi globally
- - run: npm i -g @napi-rs/cli@1.2.1
- - run: npm i -g turbo@1.0.28
- - name: Install Rust
+ - name: Install
uses: actions-rs/toolchain@v1
+ if: ${{ !matrix.settings.docker }}
with:
profile: minimal
- toolchain: nightly-2021-11-15
override: true
- target: aarch64-unknown-linux-musl
-
- - name: Cache
- uses: actions/cache@v2
- with:
- path: |
- target/
- key: aarch64-linux-musl-publish-integration
-
- - name: Install cross compile toolchain
- run: |
- sudo apt-get update
- sudo apt-get install gcc-aarch64-linux-gnu -y
-
- - name: Turbo Cache
- id: turbo-cache
- uses: actions/cache@v2
- with:
- path: .turbo
- key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }}
- restore-keys: |
- turbo-${{ github.job }}-
- turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-
- turbo-${{ github.job }}-canary-${{ needs.build.outputs.weekNum }}-
-
- - name: Cross build aarch64
- run: turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-unknown-linux-musl
-
- - name: Upload artifact
- uses: actions/upload-artifact@v2
- with:
- name: next-swc-binaries
- path: packages/next-swc/native/next-swc.linux-arm64-musl.node
-
- build-linux-arm7:
- needs: build
- if: ${{ needs.build.outputs.isRelease == 'true' }}
- name: next-swc - arm7-unknown-linux-gnu - node@14
- runs-on: ubuntu-18.04
- steps:
- - run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
-
- - name: Setup node
- uses: actions/setup-node@v2
- with:
- node-version: 14
-
- # we use checkout here instead of the build cache since
- # it can fail to restore in different OS'
- - uses: actions/checkout@v2
-
- # since the repo's dependencies aren't installed we need
- # to install napi globally
- - run: npm i -g @napi-rs/cli@1.2.1
- - run: npm i -g turbo@1.0.28
-
- - name: Install Rust
- uses: actions-rs/toolchain@v1
- with:
- profile: minimal
toolchain: nightly-2021-11-15
- override: true
- target: armv7-unknown-linux-gnueabihf
+ target: ${{ matrix.settings.target }}
- - name: Cache
+ - name: Cache cargo registry
uses: actions/cache@v2
with:
- path: |
- target/
- key: arm7-linux-gnu-publish-integration
-
- - name: Install cross compile toolchain
- run: |
- sudo apt-get update
- sudo apt-get install gcc-arm-linux-gnueabihf -y
+ path: ~/.cargo/registry
+ key: ${{ matrix.settings.target }}-cargo-registry
- - name: Turbo Cache
- id: turbo-cache
+ - name: Cache cargo index
uses: actions/cache@v2
with:
- path: .turbo
- key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }}
- restore-keys: |
- turbo-${{ github.job }}-
- turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-
- turbo-${{ github.job }}-canary-${{ needs.build.outputs.weekNum }}-
-
- - name: Cross build aarch64
- run: turbo run build-native --cache-dir=".turbo" -- --release --target armv7-unknown-linux-gnueabihf
-
- - name: Upload artifact
- uses: actions/upload-artifact@v2
- with:
- name: next-swc-binaries
- path: packages/next-swc/native/next-swc.linux-arm-gnueabihf.node
-
- build-android-aarch64:
- needs: build
- if: ${{ needs.build.outputs.isRelease == 'true' }}
- name: next-swc - Android - aarch64
- runs-on: macos-latest
- steps:
- - name: Setup node
- uses: actions/setup-node@v2
- with:
- node-version: 14
-
- # we use checkout here instead of the build cache since
- # it can fail to restore in different OS'
- - uses: actions/checkout@v2
-
- # since the repo's dependencies aren't installed we need
- # to install napi globally
- - run: npm i -g @napi-rs/cli@1.2.1
- - run: npm i -g turbo@1.0.28
+ path: ~/.cargo/git
+ key: ${{ matrix.settings.target }}-cargo-index
- - name: Install Rust
- uses: actions-rs/toolchain@v1
- with:
- profile: minimal
- toolchain: nightly-2021-11-15
- override: true
- target: aarch64-linux-android
+ - name: Setup toolchain
+ run: ${{ matrix.settings.setup }}
+ if: ${{ matrix.settings.setup }}
+ shell: bash
- - name: Turbo Cache
- id: turbo-cache
- uses: actions/cache@v2
+ - name: Build in docker
+ uses: addnab/docker-run-action@v3
+ if: ${{ matrix.settings.docker }}
with:
- path: .turbo
- key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }}
- restore-keys: |
- turbo-${{ github.job }}-
- turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-
- turbo-${{ github.job }}-canary-${{ needs.build.outputs.weekNum }}-
+ image: ${{ matrix.settings.docker }}
+ options: -v ${{ env.HOME }}/.cargo/git:/root/.cargo/git -v ${{ env.HOME }}/.cargo/registry:/root/.cargo/registry -v ${{ github.workspace }}:/build -w /build
+ run: ${{ matrix.settings.build }}
- - name: Build
+ - name: 'Build'
+ run: ${{ matrix.settings.build }}
+ if: ${{ !matrix.settings.docker }}
shell: bash
- run: |
- export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android24-clang"
- turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-linux-android
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: next-swc-binaries
- path: packages/next-swc/native/next-swc.android-arm64.node
+ path: packages/next-swc/native/next-swc.*.node
build-wasm:
needs: build
diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml
index c8df2516aa2c9..41b7e8c78beb4 100644
--- a/.github/workflows/lock.yml
+++ b/.github/workflows/lock.yml
@@ -2,8 +2,8 @@ name: 'Lock Threads'
on:
schedule:
- # This runs every hour: https://crontab.guru/every-1-hour
- - cron: '0 * * * *'
+ # This runs twice a day: https://crontab.guru/#0_0,12_*_*_*
+ - cron: '0 0,12 * * *'
workflow_dispatch:
permissions:
@@ -16,10 +16,12 @@ concurrency:
jobs:
action:
runs-on: ubuntu-latest
+ if: github.repository_owner == 'vercel'
steps:
- uses: dessant/lock-threads@v3
with:
- github-token: ${{ secrets.LOCK_TOKEN }}
+ github-token: ${{ secrets.GITHUB_TOKEN }}
issue-inactive-days: 30
- issue-comment: 'This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.'
+ issue-comment: 'This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.'
pr-inactive-days: 30
+ log-output: true
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
index 1cbbfceb7cc5c..cb6abe0bc4885 100644
--- a/.github/workflows/stale.yml
+++ b/.github/workflows/stale.yml
@@ -8,6 +8,7 @@ on:
jobs:
stale:
runs-on: ubuntu-latest
+ if: github.repository_owner == 'vercel'
steps:
- uses: actions/stale@v4
id: stale
@@ -15,10 +16,10 @@ jobs:
with:
repo-token: ${{ secrets.STALE_TOKEN }}
only-labels: 'please add a complete reproduction'
- close-issue-message: 'This issue has been automatically closed after 30 days of inactivity with no reproduction. If you are running into a similar issue, please open a new issue with a reproduction. Thank you.'
+ close-issue-message: 'This issue has been automatically closed because it received no activity for a month and had no reproduction to investigate. If you think this was closed by accident, please leave a comment. If you are running into a similar issue, please open a new issue with a reproduction. Thank you.'
days-before-issue-close: 1
days-before-issue-stale: 30
days-before-pr-close: -1
days-before-pr-stale: -1
exempt-issue-labels: 'blocked,must,should,keep'
- operation-per-run: 300 # 1 operation per 100 issues, the rest is to label/comment/close
+ operations-per-run: 300 # 1 operation per 100 issues, the rest is to label/comment/close
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
index 5b8d1a5be1b2b..6714bc34d2f24 100644
--- a/CODE_OF_CONDUCT.md
+++ b/CODE_OF_CONDUCT.md
@@ -2,64 +2,43 @@
### Our Pledge
-In the interest of fostering an open and welcoming environment, we as
-contributors and maintainers pledge to making participation in our project and
-our community a harassment-free experience for everyone, regardless of age, body
-size, disability, ethnicity, gender identity and expression, level of experience,
-nationality, personal appearance, race, religion, or sexual identity and
-orientation.
+We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
+
+We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
### Our Standards
-Examples of behavior that contributes to creating a positive environment
-include:
+Examples of behavior that contributes to a positive environment for our community include:
-- Using welcoming and inclusive language
-- Being respectful of differing viewpoints and experiences
-- Gracefully accepting constructive criticism
-- Focusing on what is best for the community
-- Showing empathy towards other community members
+- Demonstrating empathy and kindness toward other people
+- Being respectful of differing opinions, viewpoints, and experiences
+- Giving and gracefully accepting constructive feedback
+- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
+- Focusing on what is best not just for us as individuals, but for the overall community
-Examples of unacceptable behavior by participants include:
+Examples of unacceptable behavior include:
-- The use of sexualized language or imagery and unwelcome sexual attention or
- advances
-- Trolling, insulting/derogatory comments, and personal or political attacks
+- The use of sexualized language or imagery, and sexual attention or advances of any kind
+- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
-- Publishing others' private information, such as a physical or electronic
- address, without explicit permission
-- Other conduct which could reasonably be considered inappropriate in a
- professional setting
+- Publishing others’ private information, such as a physical or email address, without their explicit permission
+- Other conduct which could reasonably be considered inappropriate in a professional setting
-### Our Responsibilities
+### Enforcement Responsibilities
-Project maintainers are responsible for clarifying the standards of acceptable
-behavior and are expected to take appropriate and fair corrective action in
-response to any instances of unacceptable behavior.
+Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
-Project maintainers have the right and responsibility to remove, edit, or
-reject comments, commits, code, wiki edits, issues, and other contributions
-that are not aligned to this Code of Conduct, or to ban temporarily or
-permanently any contributor for other behaviors that they deem inappropriate,
-threatening, offensive, or harmful.
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
### Scope
-This Code of Conduct applies both within project spaces and in public spaces
-when an individual is representing the project or its community. Examples of
-representing a project or community include using an official project e-mail
-address, posting via an official social media account, or acting as an appointed
-representative at an online or offline event. Representation of a project may be
-further defined and clarified by project maintainers.
+This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
### Enforcement
-Instances of abusive, harassing, or otherwise unacceptable behavior may be
-reported by contacting the project team at [coc@vercel.com](mailto:coc@vercel.com). All
-complaints will be reviewed and investigated and will result in a response that
-is deemed necessary and appropriate to the circumstances. The project team is
-obligated to maintain confidentiality with regard to the reporter of an incident.
-Further details of specific enforcement policies may be posted separately.
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project team responsible for enforcement at [coc@vercel.com](mailto:coc@vercel.com). All complaints will be reviewed and investigated promptly and fairly.
+
+All project maintainers are obligated to respect the privacy and security of the reporter of any incident.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
@@ -67,8 +46,8 @@ members of the project's leadership.
### Attribution
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
-available at [http://contributor-covenant.org/version/1/4][version]
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1,
+available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct/][version]
[homepage]: http://contributor-covenant.org
-[version]: http://contributor-covenant.org/version/1/4/
+[version]: https://www.contributor-covenant.org/version/2/1
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index da56c8d77fc24..57978a2058b6d 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -69,11 +69,9 @@ stages:
- stage: Test
dependsOn: Build
jobs:
- - job: test_ie11
+ - job: test_integration
pool:
vmImage: 'windows-2019'
- variables:
- BROWSER_NAME: internet explorer
steps:
- checkout: none
- task: NodeTool@0
@@ -89,8 +87,7 @@ stages:
displayName: Cache Build
- script: |
- npm i -g selenium-standalone@6.18.0
- displayName: 'Install selenium node'
+ npx playwright install chromium
- script: |
node run-tests.js -c 1 test/integration/production/test/index.test.js test/integration/css-client-nav/test/index.test.js test/integration/rewrites-has-condition/test/index.test.js
diff --git a/contributing.md b/contributing.md
index 1fd1133aee776..e98980b0f01be 100644
--- a/contributing.md
+++ b/contributing.md
@@ -1,8 +1,12 @@
# Contributing to Next.js
-Read about our [Commitment to Open Source](https://vercel.com/oss). To
-contribute to [our examples](examples), please see **[Adding
-examples](#adding-examples)** below.
+[Watch the 40-minute walkthrough video on how to contribute to Next.js.](https://www.youtube.com/watch?v=cuoNzXFLitc)
+
+---
+
+- Read about our [Commitment to Open Source](https://vercel.com/oss).
+- To contribute to [our examples](examples), please see [Adding examples](#adding-examples) below.
+- Before jumping into a PR be sure to search [existing PRs](https://github.com/vercel/next.js/pulls) or [issues](https://github.com/vercel/next.js/issues) for an open or closed item that relates to your submission.
## Developing
diff --git a/docs/advanced-features/automatic-static-optimization.md b/docs/advanced-features/automatic-static-optimization.md
index abf202aacbd67..8780102d7a671 100644
--- a/docs/advanced-features/automatic-static-optimization.md
+++ b/docs/advanced-features/automatic-static-optimization.md
@@ -20,6 +20,14 @@ If the above is not the case, Next.js will **statically optimize** your page aut
During prerendering, the router's `query` object will be empty since we do not have `query` information to provide during this phase. After hydration, Next.js will trigger an update to your application to provide the route parameters in the `query` object.
+The cases where the query will be updated after hydration triggering another render are:
+
+- The page is a [dynamic-route](/docs/routing/dynamic-routes.md).
+- The page has query values in the URL.
+- [Rewrites](/docs/api-reference/next.config.js/rewrites.md) are configured in your `next.config.js` since these can have parameters that may need to be parsed and provided in the `query`.
+
+To be able to distinguish if the query is fully updated and ready for use, you can leverage the `isReady` field on [`next/router`](/docs/api-reference/next/router.md#router-object).
+
> **Note:** Parameters added with [dynamic routes](/docs/routing/dynamic-routes.md) to a page that's using [`getStaticProps`](/docs/basic-features/data-fetching/get-static-props.md) will always be available inside the `query` object.
`next build` will emit `.html` files for statically optimized pages. For example, the result for the page `pages/about.js` would be:
diff --git a/docs/advanced-features/compiler.md b/docs/advanced-features/compiler.md
index ac07f30fe24c1..439474fa11f33 100644
--- a/docs/advanced-features/compiler.md
+++ b/docs/advanced-features/compiler.md
@@ -7,9 +7,10 @@ description: Learn about the Next.js Compiler, written in Rust, which transforms
Version History
-| Version | Changes |
-| --------- | --------------------------------------------------------------- |
-| `v12.0.0` | Next.js Compiler [introduced](https://nextjs.org/blog/next-12). |
+| Version | Changes |
+| --------- | ---------------------------------------------------------------------------------------------------------------------------------- |
+| `v12.1.0` | Added support for Styled Components, Jest, Relay, Remove React Properties, Legacy Decorators, Remove Console, and jsxImportSource. |
+| `v12.0.0` | Next.js Compiler [introduced](https://nextjs.org/blog/next-12). |
Loading...
- if (!profileData) returnNo profile data
+ if (!data) returnNo profile data
return (Hello world!
-Next.js has been powering https://vercel.com since its inception.
- -We’re ecstatic about both the developer experience and end-user performance, so we decided to share it with the community.
+Yes! Next.js is used by many of the top websites in the world. See the + Showcase for more info.
The client side bundle size should be measured in a per-app basis. A small Next main bundle is around 65kb gzipped.
-Next.js tries its best to remove the overhead of webpack configurations, but for advanced cases where more control is needed, refer to the custom webpack config documentation.
-We track V8. Since V8 has wide support for ES6 and async and await, we compile those. Since V8 doesn’t support class decorators, we don’t compile those.
- -See the documentation about customizing babel config for more information.
+It's up to you. You can use the fetch API or SWR inside your React components for remote data fetching; or use our data fetching methods for initial data population.
+Yes! We have hundreds of examples in our examples directory.
Yes! Here's an example with Apollo.
+Yes! Here's an example with Apollo and an example API Route with GraphQL.
Yes! Here's an example. And there's another example with thunk.
+Yes! Here's an example with Redux and an example with thunk.
+Yes! Here's our Next.js PWA Example.
Yes. You can read more about it here.
+Yes! When you deploy your Next.js application to Vercel, your static assets are automatically detected and served by the Edge Network. If you self-host Next.js, you can learn how to manually configure the asset prefix here.
Since our first release we've had many example contributions. You can check them out in the examples directory.
+In most cases, no manual webpack configuration is necessary since Next.js automatically configures webpack. For advanced cases where more control is needed, refer to the custom webpack config documentation.
Many of the goals we set out to accomplish were the ones listed in The 7 principles of Rich Web Applications by Guillermo Rauch.
The ease-of-use of PHP is a great inspiration. We feel Next.js is a suitable replacement for many scenarios where you would otherwise use PHP to output HTML.
@@ -72,8 +73,3 @@ description: Get to know more about Next.js with the frequently asked questions.As we were researching options for server-rendering React that didn’t involve a large number of steps, we came across react-page (now deprecated), a similar approach to Next.js by the creator of React Jordan Walke.
Yes! Check out our PWA Example to see how it works.
--
+
`, `` and `
` component used here is not the same one from [`next/head`](/docs/api-reference/next/head.md). The `
` component used here should only be used for any `
` code that is common for all pages. For all other cases, such as `
`, `` and `
` component used in `_document` is not the same as [`next/head`](/docs/api-reference/next/head.md). The `
` component used here should only be used for any `
` code that is common for all pages. For all other cases, such as `
+