Skip to content

Commit

Permalink
Merge branch 'canary' into feat/keep-alive-timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsorban44 authored Jun 20, 2022
2 parents d528bfe + 6a39d51 commit 912fffa
Show file tree
Hide file tree
Showing 171 changed files with 3,874 additions and 1,668 deletions.
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/1.bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ body:
description: A clear and concise description of what you expected to happen.
validations:
required: true
- type: input
attributes:
label: Link to reproduction
description: A link to a https://stackblitz.com/ or git repo with a minimal reproduction. Minimal reproductions should be created from a create-next-app starter and include only relevant changes to cause the issue if possible.
validations:
required: true
- type: textarea
attributes:
label: To Reproduce
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/next-stats-action/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LABEL repository="https://github.com/vercel/next-stats-action"
COPY . /next-stats

# Install node_modules
RUN npm i -g pnpm@7.1.6
RUN npm i -g pnpm@7.2.1
RUN cd /next-stats && pnpm install --production

RUN git config --global user.email 'stats@localhost'
Expand Down
76 changes: 67 additions & 9 deletions .github/workflows/build_test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
NAPI_CLI_VERSION: 2.7.0
TURBO_VERSION: 1.2.14
RUST_TOOLCHAIN: nightly-2022-02-23
PNPM_VERSION: 7.1.6
PNPM_VERSION: 7.2.1

jobs:
check-examples:
Expand Down Expand Up @@ -98,7 +98,6 @@ jobs:
steps:
- name: Setup node
uses: actions/setup-node@v3
if: ${{ steps.docs-change.outputs.docsChange != 'docs only change' }}
with:
node-version: 16
check-latest: true
Expand Down Expand Up @@ -227,6 +226,9 @@ jobs:
name: next-swc-test-binary
path: packages/next-swc/native

- run: npm i -g pnpm@${PNPM_VERSION}
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- run: node run-tests.js --type unit
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

Expand Down Expand Up @@ -268,6 +270,9 @@ jobs:
name: next-swc-test-binary
path: packages/next-swc/native

- run: npm i -g pnpm@${PNPM_VERSION}
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

Expand Down Expand Up @@ -320,6 +325,9 @@ jobs:
name: next-swc-test-binary
path: packages/next-swc/native

- run: npm i -g pnpm@${PNPM_VERSION}
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

Expand All @@ -344,10 +352,12 @@ jobs:
env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
strategy:
fail-fast: false
matrix:
node: [16, 18]
group: [1, 2]
steps:
- name: Setup node
uses: actions/setup-node@v3
Expand Down Expand Up @@ -375,10 +385,13 @@ jobs:
name: next-swc-test-binary
path: packages/next-swc/native

- run: npm i -g pnpm@${PNPM_VERSION}
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- run: NEXT_TEST_MODE=dev node run-tests.js --type e2e
- run: NEXT_TEST_MODE=dev node run-tests.js --type e2e --timings -g ${{ matrix.group }}/2
name: Run test/e2e (dev)
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

Expand All @@ -400,6 +413,11 @@ jobs:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
NEXT_TEST_REACT_VERSION: ^17
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
strategy:
fail-fast: false
matrix:
group: [1, 2]
steps:
- name: Setup node
uses: actions/setup-node@v3
Expand Down Expand Up @@ -427,10 +445,13 @@ jobs:
name: next-swc-test-binary
path: packages/next-swc/native

- run: npm i -g pnpm@${PNPM_VERSION}
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- run: NEXT_TEST_MODE=dev node run-tests.js --type e2e
- run: NEXT_TEST_MODE=dev node run-tests.js --type e2e --timings -g ${{ matrix.group }}/2
name: Run test/e2e (dev)
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

Expand Down Expand Up @@ -482,6 +503,9 @@ jobs:
name: next-swc-test-binary
path: packages/next-swc/native

- run: npm i -g pnpm@${PNPM_VERSION}
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

Expand Down Expand Up @@ -524,6 +548,9 @@ jobs:
name: next-swc-test-binary
path: packages/next-swc/native

- run: npm i -g pnpm@${PNPM_VERSION}
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

Expand All @@ -538,10 +565,12 @@ jobs:
env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
strategy:
fail-fast: false
matrix:
node: [16, 18]
group: [1, 2]
steps:
- name: Setup node
uses: actions/setup-node@v3
Expand Down Expand Up @@ -569,10 +598,13 @@ jobs:
name: next-swc-test-binary
path: packages/next-swc/native

- run: npm i -g pnpm@${PNPM_VERSION}
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- run: NEXT_TEST_MODE=start node run-tests.js --type e2e
- run: NEXT_TEST_MODE=start node run-tests.js --type e2e --timings -g ${{ matrix.group }}/2
name: Run test/e2e (production)
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

Expand All @@ -584,10 +616,11 @@ jobs:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
NEXT_TEST_REACT_VERSION: ^17
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
strategy:
fail-fast: false
matrix:
node: [16, 18]
group: [1, 2]
steps:
- name: Setup node
uses: actions/setup-node@v3
Expand Down Expand Up @@ -615,10 +648,13 @@ jobs:
name: next-swc-test-binary
path: packages/next-swc/native

- run: npm i -g pnpm@${PNPM_VERSION}
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- run: NEXT_TEST_MODE=start node run-tests.js --type e2e
- run: NEXT_TEST_MODE=start node run-tests.js --type e2e --timings -g ${{ matrix.group }}/2
name: Run test/e2e (production)
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

Expand Down Expand Up @@ -661,6 +697,9 @@ jobs:
name: next-swc-test-binary
path: packages/next-swc/native

- run: npm i -g pnpm@${PNPM_VERSION}
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

Expand Down Expand Up @@ -706,7 +745,10 @@ jobs:
name: next-swc-test-binary
path: packages/next-swc/native

- run: cd test/integration/with-electron/app && yarn
- run: npm i -g pnpm@${PNPM_VERSION}
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- run: cd test/integration/with-electron/app && yarn install
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- run: xvfb-run node run-tests.js test/integration/with-electron/test/index.test.js
Expand Down Expand Up @@ -761,6 +803,7 @@ jobs:
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
# test rsc hydration on firefox due to limited support of TransformStream api
- run: npm i -g pnpm@${PNPM_VERSION}
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
- run: xvfb-run pnpm testheadless test/integration/react-streaming-and-server-components/test/index.test.js -t "should handle streaming server components correctly"
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

Expand Down Expand Up @@ -801,6 +844,9 @@ jobs:
name: next-swc-test-binary
path: packages/next-swc/native

- run: npm i -g pnpm@${PNPM_VERSION}
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

# TODO: use macos runner so that we can use playwright to test against
# PRs instead of only running on canary?
- run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || npm i -g browserstack-local@1.4.0'
Expand Down Expand Up @@ -846,6 +892,9 @@ jobs:
name: next-swc-test-binary
path: packages/next-swc/native

- run: npm i -g pnpm@${PNPM_VERSION}
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- 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'}}

Expand Down Expand Up @@ -877,6 +926,8 @@ jobs:
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: npm i -g pnpm@${PNPM_VERSION}
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
- run: npx playwright install-deps && npx playwright install firefox
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
- run: node run-tests.js test/integration/production/test/index.test.js
Expand Down Expand Up @@ -955,6 +1006,9 @@ jobs:
name: next-swc-test-binary
path: packages/next-swc/native

- run: npm i -g pnpm@${PNPM_VERSION}
name: Install pnpm

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps
name: Install playwright dependencies

Expand Down Expand Up @@ -1156,6 +1210,9 @@ jobs:
- run: node ./scripts/setup-wasm.mjs
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- run: npm i -g pnpm@${PNPM_VERSION}
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

- run: TEST_WASM=true xvfb-run node run-tests.js test/integration/production/test/index.test.js
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

Expand Down Expand Up @@ -1519,7 +1576,8 @@ jobs:
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v3
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
if: ${{needs.build.outputs.docsChange != 'docs only change'}}

with:
path: .turbo
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ steps.get-week.outputs.WEEK }}-${{ github.sha }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request_stats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:
NAPI_CLI_VERSION: 2.7.0
TURBO_VERSION: 1.2.14
RUST_TOOLCHAIN: nightly-2022-02-23
PNPM_VERSION: 7.1.6
PNPM_VERSION: 7.2.1

jobs:
build-native-dev:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test_react_experimental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
path: ./*
key: ${{ github.sha }}-react-experimental

- run: npm i -g pnpm@latest

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps

- run: node run-tests.js --timings -g ${{ matrix.group }}/6
2 changes: 2 additions & 0 deletions .github/workflows/test_react_next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
path: ./*
key: ${{ github.sha }}-react-next

- run: npm i -g pnpm@latest

- run: npm i -g playwright-chromium@1.22.2 && npx playwright install-deps

- run: node run-tests.js --timings -g ${{ matrix.group }}/6
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pr:

variables:
PNPM_CACHE_FOLDER: $(Pipeline.Workspace)/.pnpm-store
PNPM_VERSION: 7.1.6
PNPM_VERSION: 7.2.1
NEXT_TELEMETRY_DISABLED: '1'
node_version: ^14.19.0

Expand Down
2 changes: 1 addition & 1 deletion docs/advanced-features/compiler.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ First, update to the latest version of Next.js: `npm install next@latest`. Then,
const nextJest = require('next/jest')

// Providing the path to your Next.js app which will enable loading next.config.js and .env files
const createJestConfig = nextJest({ dir })
const createJestConfig = nextJest({ dir: './' })

// Any custom config you want to pass to Jest
const customJestConfig = {
Expand Down
6 changes: 4 additions & 2 deletions docs/advanced-features/custom-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,12 @@ export default MyDocument
You can use the built-in `DocumentContext` type and change the file name to `./pages/_document.tsx` like so:

```tsx
import Document, { DocumentContext } from 'next/document'
import Document, { DocumentContext, DocumentInitialProps } from 'next/document'

class MyDocument extends Document {
static async getInitialProps(ctx: DocumentContext) {
static async getInitialProps(
ctx: DocumentContext
): Promise<DocumentInitialProps> {
const initialProps = await Document.getInitialProps(ctx)

return initialProps
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced-features/dynamic-import.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Next.js supports lazy loading external libraries with `import()` and React compo

## Example

By using `next/dynamic`, the header component will not be included in page's the initial JavaScript bundle. The page will render the Suspense `fallback` first, followed by the `Header` component when the `Suspense` boundary is resolved.
By using `next/dynamic`, the header component will not be included in the page's initial JavaScript bundle. The page will render the Suspense `fallback` first, followed by the `Header` component when the `Suspense` boundary is resolved.

```jsx
import dynamic from 'next/dynamic'
Expand Down
6 changes: 4 additions & 2 deletions docs/advanced-features/middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ import type { NextRequest, NextResponse } from 'next/server'
import { areCredentialsValid } from '../lib'

export function middleware(req: NextRequest) {
if (areCredentialsValid(req.headers.get('authorization')) {
if (areCredentialsValid(req.headers.get('authorization'))) {
return NextResponse.next()
}
return NextResponse.redirect(new URL(`/login?from=${req.nextUrl.pathname}`, req.url))
return NextResponse.redirect(
new URL(`/login?from=${req.nextUrl.pathname}`, req.url)
)
}
```

Expand Down
Loading

0 comments on commit 912fffa

Please sign in to comment.