Skip to content

Commit

Permalink
Merge branch 'canary' into lforst-propagate-trace-to-client
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst committed Apr 19, 2024
2 parents 2c463e7 + bef283e commit 1994fd1
Show file tree
Hide file tree
Showing 301 changed files with 7,621 additions and 3,968 deletions.
20 changes: 11 additions & 9 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,25 @@
CARGO_WORKSPACE_DIR = { value = "", relative = true }

[build]

rustflags = [
"--cfg",
"tokio_unstable",
"-Zshare-generics=y", # make the current crate share its generic instantiations
"-Zthreads=8", # parallel frontend https://blog.rust-lang.org/2023/11/09/parallel-rustc.html
"-Csymbol-mangling-version=v0",
]
rustdocflags = []

[target.x86_64-pc-windows-msvc]
linker = "rust-lld"
rustflags = ["-C", "target-feature=+crt-static"]

[target.i686-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]

[target.aarch64-apple-darwin]
linker = "rust-lld"

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"

Expand All @@ -27,11 +37,3 @@ rustflags = [

[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"

[target.'cfg(all())']
rustflags = [
"--cfg",
"tokio_unstable",
"-Zshare-generics=y",
"-Csymbol-mangling-version=v0",
]
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ test/development/basic/hmr/components/parse-error.js
packages/next-swc/docs/assets/**/*
test/lib/amp-validator-wasm.js
test/production/pages-dir/production/fixture/amp-validator-wasm.js
test/e2e/async-modules/amp-validator-wasm.js
47 changes: 24 additions & 23 deletions .github/ISSUE_TEMPLATE/1.bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Bug Report
description: Create a bug report for the Next.js core
labels: ['template: bug']
labels: ['bug']
body:
- type: markdown
attributes:
Expand Down Expand Up @@ -71,29 +71,30 @@ body:
multiple: true
options:
- 'Not sure'
- 'App Router'
- 'CLI (create-next-app)'
- 'Data fetching (gS(S)P, getInitialProps)'
- 'Dynamic imports (next/dynamic)'
- 'ESLint (eslint-config-next)'
- 'Font optimization (next/font)'
- 'Image optimization (next/image, next/legacy/image)'
- 'create-next-app'
- 'Documentation'
- 'Lazy Loading'
- 'Font (next/font)'
- 'Image (next/image)'
- 'Instrumentation'
- 'Internationalization (i18n)'
- 'Jest (next/jest)'
- 'MDX (@next/mdx)'
- 'Metadata (metadata, generateMetadata, next/head)'
- 'Middleware / Edge (API routes, runtime)'
- 'Module resolution (CJS / ESM, module resolving)'
- 'Operating System (Windows, MacOS, Linux)'
- 'Package manager (npm, pnpm, Yarn)'
- 'Routing (next/router, next/navigation, next/link)'
- 'Script optimization (next/script)'
- 'Standalone mode (output: "standalone")'
- 'Static HTML Export (output: "export")'
- 'SWC minifier (swcMinify: true)'
- 'SWC transpilation'
- 'Turbopack (--turbo)'
- 'TypeScript (plugin, built-in types)'
- 'Linting'
- 'Markdown (MDX)'
- 'Metadata'
- 'Middleware'
- 'Output (export/standalone)'
- 'Pages Router'
- 'Parallel & Intercepting Routes'
- 'Partial Prerendering (PPR)'
- 'Performance'
- 'Runtime'
- 'Script (next/script)'
- 'Testing'
- 'Turbopack'
- 'TypeScript'
- 'SWC'
- 'Upstream'

validations:
required: true
- type: dropdown
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/2.example_bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Bug Report for Examples
description: Create a bug report for one of the Next.js examples
labels: ['area: examples']
labels: ['example bug']
body:
- type: markdown
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/4.docs_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'Docs Request for an Update or Improvement'
description: A request to update or improve Next.js documentation
title: 'Docs: '
labels:
- 'template: documentation'
- 'Documentation'
body:
- type: markdown
attributes:
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/next-integration-stat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"engines": {
"node": ">=18.17.0",
"pnpm": "8.15.4"
"pnpm": "8.15.7"
},
"packageManager": "pnpm@8.15.4"
"packageManager": "pnpm@8.15.7"
}
4 changes: 2 additions & 2 deletions .github/actions/next-stats-action/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"engines": {
"node": ">=18.17.0",
"pnpm": "8.15.4"
"pnpm": "8.15.7"
},
"packageManager": "pnpm@8.15.4"
"packageManager": "pnpm@8.15.7"
}
54 changes: 5 additions & 49 deletions .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,17 @@ inputs:
targets:
description: 'Comma-separated list of target triples to install for this toolchain'
required: false
components:
description: 'Comma-separated list of components to be additionally installed'
required: false
skip-install:
description: 'Sets environment variables without installing the rust toolchain'
required: false

runs:
using: 'composite'
steps:
- name: 'Get toolchain version from file'
id: file
shell: bash
run: echo "toolchain=$(cat ./rust-toolchain)" >> $GITHUB_OUTPUT

- shell: bash
run: |
: force toolchain version
echo "RUST_TOOLCHAIN=${{ steps.file.outputs.toolchain }}" >> $GITHUB_ENV
- shell: bash
run: |
: disable incremental compilation
if [ -z "${CARGO_INCREMENTAL+set}" ]; then
echo CARGO_INCREMENTAL=0 >> $GITHUB_ENV
fi
- shell: bash
run: |
: enable colors in Cargo output
if [ -z "${CARGO_TERM_COLOR+set}" ]; then
echo CARGO_TERM_COLOR=always >> $GITHUB_ENV
fi
- shell: bash
run: |
: enable rust backtrace
if [ -z "${RUST_BACKTRACE+set}" ]; then
echo RUST_BACKTRACE=short >> $GITHUB_ENV
fi
- shell: bash
run: |
: enable faster cargo sparse registry
if [ -z "${CARGO_REGISTRIES_CRATES_IO_PROTOCOL+set}" ]; then
echo CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse >> $GITHUB_ENV
fi
- name: 'Setup Rust toolchain'
uses: dtolnay/rust-toolchain@master
if: ${{ !inputs.skip-install }}
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ steps.file.outputs.toolchain }}
targets: ${{ inputs.targets }}
components: ${{ inputs.components }}
target: ${{ inputs.targets }}
# needed to not make it override the defaults
rustflags: ''
cache: false

- name: 'Add cargo problem matchers'
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/upload-turboyet-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"engines": {
"node": ">=18.17.0",
"pnpm": "8.15.4"
"pnpm": "8.15.7"
},
"packageManager": "pnpm@8.15.4"
"packageManager": "pnpm@8.15.7"
}
15 changes: 7 additions & 8 deletions .github/labeler.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"labels": {
"area: create-next-app": ["packages/create-next-app/**"],
"area: documentation": ["docs/**", "errors/**"],
"area: examples": ["examples/**"],
"area: Font Optimization": ["**/*font*"],
"area: tests": ["test/**", "bench/**"],
"area: Turbopack": ["packages/next-swc/crates/next-*/**"],
"create-next-app": ["packages/create-next-app/**"],
"documentation": ["docs/**", "errors/**"],
"examples": ["examples/**"],
"Font (next/font)": ["**/*font*"],
"tests": ["test/**", "bench/**"],
"Turbopack": ["packages/next-swc/crates/next-*/**"],
"created-by: Chrome Aurora": [
{ "type": "user", "pattern": "atcastle" },
{ "type": "user", "pattern": "devknoll" },
Expand Down Expand Up @@ -46,7 +46,7 @@
{ "type": "user", "pattern": "timeyoutakeit" },
{ "type": "user", "pattern": "manovotny" }
],
"created-by: turbopack team": [
"created-by: Turbopack team": [
{ "type": "user", "pattern": "bgw" },
{ "type": "user", "pattern": "ForsakenHarmony" },
{ "type": "user", "pattern": "kdy1" },
Expand All @@ -65,7 +65,6 @@
"packages/next-mdx/**",
"packages/next-swc/**",
"packages/next/**",
"packages/react-dev-overlay/**",
"packages/react-refresh-utils/**"
]
}
Expand Down
21 changes: 10 additions & 11 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ jobs:
set -e &&
apt update &&
apt install -y pkg-config xz-utils dav1d libdav1d-dev &&
rustup toolchain install "${RUST_TOOLCHAIN}" &&
rustup default "${RUST_TOOLCHAIN}" &&
rustup show &&
rustup target add x86_64-unknown-linux-gnu &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" &&
unset CC_x86_64_unknown_linux_gnu && unset CC &&
Expand All @@ -177,8 +176,7 @@ jobs:
set -e &&
apk update &&
apk add --no-cache libc6-compat pkgconfig dav1d libdav1d dav1d-dev &&
rustup toolchain install "${RUST_TOOLCHAIN}" &&
rustup default "${RUST_TOOLCHAIN}" &&
rustup show &&
rustup target add x86_64-unknown-linux-musl &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" &&
cd packages/next-swc && npm run build-native-release -- --target x86_64-unknown-linux-musl &&
Expand All @@ -197,8 +195,7 @@ jobs:
apt update &&
apt install -y pkg-config xz-utils dav1d libdav1d-dev &&
export JEMALLOC_SYS_WITH_LG_PAGE=16 &&
rustup toolchain install "${RUST_TOOLCHAIN}" &&
rustup default "${RUST_TOOLCHAIN}" &&
rustup show &&
rustup target add aarch64-unknown-linux-gnu &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" &&
export CC_aarch64_unknown_linux_gnu=/usr/aarch64-unknown-linux-gnu/bin/aarch64-unknown-linux-gnu-gcc &&
Expand All @@ -220,8 +217,7 @@ jobs:
apk add --no-cache libc6-compat pkgconfig dav1d libdav1d dav1d-dev &&
export JEMALLOC_SYS_WITH_LG_PAGE=16 &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" &&
rustup toolchain install "${RUST_TOOLCHAIN}" &&
rustup default "${RUST_TOOLCHAIN}" &&
rustup show &&
rustup target add aarch64-unknown-linux-musl &&
cd packages/next-swc && npm run build-native-release -- --target aarch64-unknown-linux-musl &&
llvm-strip -x native/next-swc.*.node
Expand Down Expand Up @@ -255,11 +251,11 @@ jobs:
check-latest: true
- run: corepack enable

# we always want to run this to set environment variables
- name: Install Rust
uses: ./.github/actions/setup-rust
with:
targets: ${{ matrix.settings.target }}
skip-install: ${{ matrix.settings.docker }}

- name: normalize versions
run: node scripts/normalize-version-bump.js
Expand All @@ -269,12 +265,15 @@ jobs:
if: ${{ matrix.settings.setup }}

- name: Cache on ${{ github.ref_name }}
uses: ijjk/rust-cache@turbo-cache-v1.0.7
uses: ijjk/rust-cache@turbo-cache-v1.0.8
with:
save-if: 'true'
cache-provider: 'turbo'
shared-key: build-${{ matrix.settings.target }}-${{ hashFiles('.cargo/config.toml') }}

- name: Clear native build
run: rm -rf packages/next-swc/native

# we only need custom caching for docker builds
# as they are on an older Node.js version and have
# issues with turbo caching
Expand All @@ -289,7 +288,7 @@ jobs:

- name: Build in docker
if: ${{ matrix.settings.docker && steps.build-exists.outputs.BUILD_EXISTS == 'no' }}
run: docker run -v "/var/run/docker.sock":"/var/run/docker.sock" -e RUST_TOOLCHAIN -e RUST_BACKTRACE -e NAPI_CLI_VERSION -e CARGO_TERM_COLOR -e CARGO_INCREMENTAL -e CARGO_PROFILE_RELEASE_LTO -e CARGO_REGISTRIES_CRATES_IO_PROTOCOL -e TURBO_API -e TURBO_TEAM -e TURBO_TOKEN -e TURBO_VERSION -e TURBO_REMOTE_ONLY -v ${{ env.HOME }}/.cargo/git:/root/.cargo/git -v ${{ env.HOME }}/.cargo/registry:/root/.cargo/registry -v ${{ github.workspace }}:/build -w /build --entrypoint=bash ${{ matrix.settings.docker }} -c "${{ matrix.settings.build }}"
run: docker run -v "/var/run/docker.sock":"/var/run/docker.sock" -e RUST_BACKTRACE -e NAPI_CLI_VERSION -e CARGO_TERM_COLOR -e CARGO_INCREMENTAL -e CARGO_PROFILE_RELEASE_LTO -e CARGO_REGISTRIES_CRATES_IO_PROTOCOL -e TURBO_API -e TURBO_TEAM -e TURBO_TOKEN -e TURBO_VERSION -e TURBO_REMOTE_ONLY -v ${{ env.HOME }}/.cargo/git:/root/.cargo/git -v ${{ env.HOME }}/.cargo/registry:/root/.cargo/registry -v ${{ github.workspace }}:/build -w /build --entrypoint=bash ${{ matrix.settings.docker }} -c "${{ matrix.settings.build }}"

- name: cache build
if: ${{ matrix.settings.docker && steps.build-exists.outputs.BUILD_EXISTS == 'no' }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,8 @@ jobs:
'test-turbopack-integration',
'test-new-tests-dev',
'test-new-tests-start',
'test-turbopack-production',
'test-turbopack-production-integration',
]

if: always()
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/build_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ jobs:
- name: Install Rust
uses: ./.github/actions/setup-rust
if: ${{ inputs.skipNativeBuild != 'yes' || inputs.needsNextest == 'yes' || inputs.needsRust == 'yes' }}
with:
components: rustfmt, clippy

- name: 'Install mold linker'
if: ${{ inputs.mold == 'yes' }}
Expand All @@ -125,7 +123,7 @@ jobs:
- run: corepack prepare --activate yarn@1.22.19 && npm i -g "turbo@${TURBO_VERSION}" "@napi-rs/cli@${NAPI_CLI_VERSION}"

- name: Cache on ${{ github.ref_name }}
uses: ijjk/rust-cache@turbo-cache-v1.0.7
uses: ijjk/rust-cache@turbo-cache-v1.0.8
if: ${{ inputs.rustCacheKey }}
with:
cache-provider: 'turbo'
Expand Down
Loading

0 comments on commit 1994fd1

Please sign in to comment.