Skip to content

Commit

Permalink
Merge branch 'canary' into perf/drop-nossr-dynamic-import-on-server
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Jan 10, 2022
2 parents edc631e + 320986a commit ce27a78
Show file tree
Hide file tree
Showing 720 changed files with 17,534 additions and 15,330 deletions.
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/1.bug_report.yml
Expand Up @@ -14,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
100 changes: 54 additions & 46 deletions .github/workflows/build_test_deploy.yml
Expand Up @@ -432,6 +432,7 @@ jobs:
BROWSERSTACK: true
BROWSER_NAME: 'safari'
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_MODE: 'start'
SKIP_LOCAL_SELENIUM_SERVER: true
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
Expand Down Expand Up @@ -464,7 +465,7 @@ jobs:
- run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || npm i -g browserstack-local@1.4.0'
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || node run-tests.js -c 1 test/integration/production/test/index.test.js'
- run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || node run-tests.js -c 1 test/integration/production/test/index.test.js test/e2e/basepath.test.ts'
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

testSafariOld:
Expand Down Expand Up @@ -551,7 +552,7 @@ jobs:
- build-windows-aarch64
- build-linux-musl
- build-linux-arm7
- build-linux-aarch64
- build-linux-aarch64-gnu
- build-android-aarch64
- build-linux-aarch64-musl
env:
Expand Down Expand Up @@ -671,6 +672,7 @@ jobs:
path: .turbo
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ steps.get-week.outputs.WEEK }}-${{ github.sha }}
restore-keys: |
turbo-${{ github.job }}-
turbo-${{ github.job }}-${{ github.ref_name }}-${{ steps.get-week.outputs.WEEK }}-
turbo-${{ github.job }}-canary-${{ steps.get-week.outputs.WEEK }}-
Expand All @@ -682,23 +684,20 @@ jobs:
uses: actions/cache@v2
with:
path: ./packages/next-swc/target
key: next-swc-cargo-cache-ubuntu-18.04--${{ hashFiles('**/Cargo.lock') }}
key: next-swc-cargo-cache-dev-ubuntu-18.04-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
next-swc-cargo-cache-ubuntu-18.04
next-swc-cargo-cache-dev-ubuntu-18.04
# 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.14
- run: npm i -g turbo@1.0.24

- name: Build
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
run: turbo run build-native --cache-dir=".turbo"
env:
MACOSX_DEPLOYMENT_TARGET: '10.13'
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: nextjs
TURBO_PROJECT: nextjs

- name: Upload artifact
uses: actions/upload-artifact@v2.2.4
Expand Down Expand Up @@ -827,6 +826,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.24

- name: Install
uses: actions-rs/toolchain@v1
Expand Down Expand Up @@ -854,6 +854,7 @@ jobs:
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 }}-
Expand All @@ -878,12 +879,10 @@ jobs:
next-swc-cargo-cache-${{ matrix.os }}
- name: 'Build'
run: turbo run build-native --cache-dir=".turbo" -- --release --target ${{ matrix.target }}
shell: bash
run: turbo run build-native --cache-dir=".turbo" -- --release --target ${{ matrix.target }}
env:
MACOSX_DEPLOYMENT_TARGET: '10.13'
TURBO_TOKEN: ${{secrets.TURBO_TOKEN}}
TURBO_TEAM: nextjs
TURBO_PROJECT: nextjs

- name: Upload artifact
uses: actions/upload-artifact@v2.2.4
Expand Down Expand Up @@ -925,7 +924,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.14
- run: npm i -g turbo@1.0.24
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
Expand All @@ -941,6 +940,7 @@ jobs:
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 }}-
Expand Down Expand Up @@ -972,7 +972,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.14
- run: npm i -g turbo@1.0.24
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
Expand All @@ -988,6 +988,7 @@ jobs:
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 }}-
Expand Down Expand Up @@ -1038,20 +1039,21 @@ jobs:
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'
run: |
docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd)/packages/next-swc:/build -w /build builder sh -c "npm i -g @napi-rs/cli@1.2.1 && npm i -g turbo@1.0.14 && turbo run build-native --cache-dir=".turbo" -- --release --target x86_64-unknown-linux-musl"
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.24 && 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:
build-linux-aarch64-gnu:
needs: build
if: ${{ needs.build.outputs.isRelease == 'true' }}
name: next-swc - aarch64-unknown-linux-gnu - node@14
Expand All @@ -1071,7 +1073,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.14
- run: npm i -g turbo@1.0.24

- name: Install Rust
uses: actions-rs/toolchain@v1
Expand Down Expand Up @@ -1100,6 +1102,7 @@ jobs:
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 }}-
Expand Down Expand Up @@ -1131,7 +1134,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.14
- run: npm i -g turbo@1.0.24
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
Expand Down Expand Up @@ -1159,6 +1162,7 @@ jobs:
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 }}-
Expand Down Expand Up @@ -1191,7 +1195,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.14
- run: npm i -g turbo@1.0.24

- name: Install Rust
uses: actions-rs/toolchain@v1
Expand Down Expand Up @@ -1220,6 +1224,7 @@ jobs:
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 }}-
Expand Down Expand Up @@ -1250,7 +1255,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.14
- run: npm i -g turbo@1.0.24

- name: Install Rust
uses: actions-rs/toolchain@v1
Expand All @@ -1267,6 +1272,7 @@ jobs:
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 }}-
Expand Down Expand Up @@ -1309,22 +1315,27 @@ jobs:
override: true
target: wasm32-unknown-unknown

- name: Cache
- run: npm i -g turbo@1.0.24

- name: Turbo cache
id: turbo-cache
uses: actions/cache@v2
with:
path: |
~/.cargo/
**/target/
key: ${{ runner.os }}-publish-integration
path: .turbo
key: turbo-${{ github.job }}-${{ matrix.target }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }}
restore-keys: |
turbo-${{ github.job }}-${{ matrix.target }}-
turbo-${{ github.job }}-${{ matrix.target }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-
turbo-${{ github.job }}-${{ matrix.target }}-canary-${{ needs.build.outputs.weekNum }}-
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Build
run: (wasm-pack build packages/next-swc/crates/wasm --release --scope=next --target ${{ matrix.target }})
run: turbo run build-wasm --cache-dir=".turbo" -- --target ${{ matrix.target }}

- name: Add target to folder name
run: mv packages/next-swc/crates/wasm/pkg packages/next-swc/crates/wasm/pkg-${{ matrix.target }}
run: '[[ -d "packages/next-swc/crates/wasm/pkg" ]] && mv packages/next-swc/crates/wasm/pkg packages/next-swc/crates/wasm/pkg-${{ matrix.target }} || ls packages/next-swc/crates/wasm'

- name: Upload artifact
uses: actions/upload-artifact@v2
Expand All @@ -1349,6 +1360,8 @@ jobs:
with:
node-version: 14

- run: npm i -g turbo@1.0.24

- name: Install Rust
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
uses: actions-rs/toolchain@v1
Expand All @@ -1358,34 +1371,29 @@ jobs:
override: true
target: wasm32-unknown-unknown

- name: Cache
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
uses: actions/cache@v2
with:
path: |
~/.cargo/
**/target/
key: ${{ runner.os }}-publish-integration

- name: Cache wasm binary
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
id: binary-cache
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v2
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
with:
path: packages/next-swc/crates/wasm/pkg-nodejs
key: dev-wasm-next-swc-nightly-2021-11-15-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next-swc/**') }}
path: .turbo
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ steps.get-week.outputs.WEEK }}-${{ github.sha }}
restore-keys: |
turbo-${{ github.job }}-
turbo-${{ github.job }}-${{ github.ref_name }}-${{ steps.get-week.outputs.WEEK }}-
turbo-${{ github.job }}-canary-${{ steps.get-week.outputs.WEEK }}-
- name: Install wasm-pack
if: ${{needs.build.outputs.docsChange != 'docs only change' && steps.binary-cache.outputs.cache-hit != 'true'}}
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Build
if: ${{needs.build.outputs.docsChange != 'docs only change' && steps.binary-cache.outputs.cache-hit != 'true'}}
run: (wasm-pack build packages/next-swc/crates/wasm --dev --scope=next --target nodejs)
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
run: turbo run build-wasm --cache-dir=".turbo" -- --target nodejs --dev

- name: Add target to folder name
if: ${{needs.build.outputs.docsChange != 'docs only change' && steps.binary-cache.outputs.cache-hit != 'true'}}
run: mv packages/next-swc/crates/wasm/pkg packages/next-swc/crates/wasm/pkg-nodejs
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
run: '[[ -d "packages/next-swc/crates/wasm/pkg" ]] && mv packages/next-swc/crates/wasm/pkg packages/next-swc/crates/wasm/pkg-nodejs || ls packages/next-swc/crates/wasm'

- name: Upload artifact
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/stale.yml
Expand Up @@ -14,7 +14,8 @@ jobs:
with:
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.'
days-before-issue-close: 30
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'
11 changes: 2 additions & 9 deletions contributing.md
Expand Up @@ -203,15 +203,8 @@ In general, all warnings and errors added should have these links attached.

Below are the steps to add a new link:

1. Create a new markdown file under the `errors` directory based on
`errors/template.md`:

```shell
cp errors/template.md errors/<error-file-name>.md
```

2. Add the newly added file to `errors/manifest.json`
3. Add the following url to your warning/error:
1. Run `yarn new-error` which will create the error document and update the manifest automatically.
2. Add the following url to your warning/error:
`https://nextjs.org/docs/messages/<file-path-without-dotmd>`.

For example, to link to `errors/api-routes-static-export.md` you use the url:
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced-features/measuring-performance.md
Expand Up @@ -164,7 +164,7 @@ export function reportWebVitals(metric) {
> ```js
> export function reportWebVitals({ id, name, label, value }) {
> // Use `window.gtag` if you initialized Google Analytics as this example:
> // https://github.com/vercel/next.js/blob/canary/examples/with-google-analytics/pages/_document.js
> // https://github.com/vercel/next.js/blob/canary/examples/with-google-analytics/pages/_app.js
> window.gtag('event', name, {
> event_category:
> label === 'web-vital' ? 'Web Vitals' : 'Next.js custom metric',
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced-features/output-file-tracing.md
Expand Up @@ -34,7 +34,7 @@ module.exports = {

This will create a folder at `.next/standalone` which can then be deployed on it's own without installing `node_modules`.

Additionally, a minimal `server.js` file is also output which can be used instead of `next start`. This minimal server does not handle serving the `static` directory as this should be handled by a CDN instead.
Additionally, a minimal `server.js` file is also output which can be used instead of `next start`. This minimal server does not copy the `.next/static` directory by default as this should ideally be handled by a CDN instead, although it can be copied to the `standalone` folder manually and the `server.js` file will serve it automatically.

## Caveats

Expand Down
2 changes: 2 additions & 0 deletions docs/advanced-features/react-18.md
Expand Up @@ -12,6 +12,8 @@ Ensure you have the `rc` npm tag of React installed:
npm install next@latest react@rc react-dom@rc
```

That's all! You can now start using React 18's new APIs like `startTransition` and `Suspense` in Next.js.

### Enable SSR Streaming (Alpha)

Concurrent features in React 18 include built-in support for server-side Suspense and SSR streaming support, allowing you to server-render pages using HTTP streaming.
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced-features/using-mdx.md
Expand Up @@ -118,7 +118,7 @@ Checkout my React component:

<MyComponent/>

export default = ({ children }) => <MyLayoutComponent meta={meta}>{children}</MyLayoutComponent>
export default ({ children }) => <MyLayoutComponent meta={meta}>{children}</MyLayoutComponent>
```

### Custom Elements
Expand Down

0 comments on commit ce27a78

Please sign in to comment.