Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: try to backport to next 14 #68901

Closed
wants to merge 78 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
a9f8a2f
refactor: move rust crates to the repo root directory (#67780)
ForsakenHarmony Jul 22, 2024
aa8235c
backport turbopack changes
ForsakenHarmony Aug 16, 2024
0d1dbb3
chore: fix references for the new turbopack crates (#68128)
ForsakenHarmony Aug 16, 2024
2c45909
backport turbopack changes (again)
ForsakenHarmony Aug 1, 2024
fc9d7c6
chore: bump turbo to 2.0.7 (#67847)
samcx Jul 17, 2024
0b7dc97
chore: bump turbo to 2.0.9 (#68046)
samcx Jul 28, 2024
60a84e9
chore: update pnpm to 9.4.0 (#64945)
samcx Jun 28, 2024
284ef20
chore: bump pnpm to 9.5.0 (#67555)
samcx Jul 8, 2024
fa19ab8
chore: bump pnpm to 9.6.0 (#68044)
samcx Jul 28, 2024
6b4205e
fix turborepo config
ForsakenHarmony Aug 20, 2024
bc95cf9
remove devlow-bench
ForsakenHarmony Aug 20, 2024
668e0d7
cargo fmt
ForsakenHarmony Aug 20, 2024
575b5c6
fix snapshots
ForsakenHarmony Aug 20, 2024
a20b5a5
add scripts
ForsakenHarmony Aug 20, 2024
3ee6bc8
fix missing pnpm fixture
ForsakenHarmony Aug 20, 2024
03a04b3
prettier fix
ForsakenHarmony Aug 20, 2024
8d97edd
revert after, swcMinify, react compiler, client trace, output file tr…
ForsakenHarmony Aug 20, 2024
5636d37
revert analytics_id
ForsakenHarmony Aug 20, 2024
8cc3957
revert serverComponentsExternalPackages rename
ForsakenHarmony Aug 20, 2024
4c2af4c
revert incremental PPR
ForsakenHarmony Aug 20, 2024
572ae0c
WIP related js updates
ForsakenHarmony Aug 20, 2024
085217a
partially fix type errors
ForsakenHarmony Aug 21, 2024
7bd3f21
Fix mismatch in versions
timneutkens Aug 22, 2024
652a910
Bring back older version of pnpm
timneutkens Aug 22, 2024
d642276
Update package.json
timneutkens Aug 22, 2024
d49f3d3
Update pnpm-lock.yaml
timneutkens Aug 22, 2024
14b754b
Match styled-jsx version
timneutkens Aug 22, 2024
430a8d1
Update pnpm-lock.yaml
timneutkens Aug 22, 2024
d86533a
Try again
timneutkens Aug 22, 2024
579a964
Update swc, preserve `with`
timneutkens Aug 22, 2024
f51ed2a
Bring back /future/, needs separate backport
timneutkens Aug 22, 2024
6e4d1df
Update paths for turbopack runtime
timneutkens Aug 22, 2024
fc295fe
Update tsconfig.base.json
timneutkens Aug 23, 2024
258974a
Upgrade typescript to 5.3 (#64043)
huozhi Apr 17, 2024
6fb9995
chore: upgrade ts to 5.4 (#67171)
devjiwonchoi Jun 25, 2024
8c28b00
Upgrade TypeScript to v5.5.2 (#67113)
devjiwonchoi Jul 4, 2024
c14b9c7
Upgrade TypeScript to 5.5.3 (#67454)
devjiwonchoi Jul 5, 2024
cd69645
Fix ts errors
timneutkens Aug 23, 2024
8dad73a
Fix TS types
timneutkens Aug 23, 2024
7a34884
Revert "Fix TS types"
timneutkens Aug 23, 2024
ef1fd8d
Revert "Fix ts errors"
timneutkens Aug 23, 2024
d1dd72b
Revert "Upgrade TypeScript to 5.5.3 (#67454)"
timneutkens Aug 23, 2024
8108007
Revert "Upgrade TypeScript to v5.5.2 (#67113)"
timneutkens Aug 23, 2024
365fe01
Revert "chore: upgrade ts to 5.4 (#67171)"
timneutkens Aug 23, 2024
4449f1e
Revert "Upgrade typescript to 5.3 (#64043)"
timneutkens Aug 23, 2024
638b521
Revert "Update tsconfig.base.json"
timneutkens Aug 23, 2024
24cb884
Revert "Update swc, preserve `with`"
timneutkens Aug 23, 2024
6b34445
Revert changes
timneutkens Aug 23, 2024
c7d82ff
parse turbopack annotations from magic string again
ForsakenHarmony Aug 23, 2024
2819595
fix ts errors
ForsakenHarmony Aug 23, 2024
ddc3bc3
revert quote change of missing swc update
ForsakenHarmony Aug 23, 2024
ed1e590
fix prettier
ForsakenHarmony Aug 23, 2024
95fbc3c
Copy Turbopack related files
timneutkens Aug 26, 2024
d9886dd
Revert "Copy Turbopack related files"
timneutkens Aug 26, 2024
5b2d821
Reapply "Copy Turbopack related files"
timneutkens Aug 26, 2024
92a7ca0
Fix path
timneutkens Aug 26, 2024
96a12c6
Throw error
timneutkens Aug 26, 2024
a5e7520
Add missing file
timneutkens Aug 26, 2024
be7e127
Bring back automatic font optimization
timneutkens Aug 26, 2024
de188ea
Revert "Throw error"
timneutkens Aug 26, 2024
68f28bf
Update transition key name
timneutkens Aug 26, 2024
275e60e
Bring over additional hot reloader client code
timneutkens Aug 26, 2024
6f39e23
Revert Turbopack changes in f893c1852837122842557d5033f22b0ffa49f97f
timneutkens Aug 27, 2024
07c5047
Revert Turbopack changes in https://github.com/vercel/next.js/commit/…
timneutkens Aug 27, 2024
90fb45b
Merge branch '14-2-1' of https://github.com/vercel/next.js into hrmny…
timneutkens Aug 27, 2024
487aa18
Revert quote change as tests are not up to date
timneutkens Aug 27, 2024
9f86590
Backport 1c8148016849127f41b09898e6e9f80ed51ef430
timneutkens Aug 27, 2024
f2e7c35
Fix types
timneutkens Aug 27, 2024
4a3b050
Backport test change
timneutkens Aug 27, 2024
1b5c17f
Backport next-image test
timneutkens Aug 27, 2024
7504e51
Revert alias change in 2c31c79ac8449c48f01fcc5ec361dc07f7b5888d
timneutkens Aug 27, 2024
27008f9
Try again
timneutkens Aug 27, 2024
8486c8b
Backport test updates
timneutkens Aug 28, 2024
cdf9a45
Backport app-external
timneutkens Aug 28, 2024
832871b
Update next-test-utils.ts
timneutkens Aug 28, 2024
7440f62
Backport next-font tests
timneutkens Aug 28, 2024
42286ac
Revert error message change to match tests
timneutkens Aug 28, 2024
a2d7c49
Revert manifest path change
timneutkens Aug 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
37 changes: 26 additions & 11 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,37 +1,52 @@
[env]
CARGO_WORKSPACE_DIR = { value = "", relative = true }
TURBO_PNPM_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-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
[target.aarch64-pc-windows-msvc]
linker = "rust-lld"

[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
[target.'cfg(target_os = "macos")']
linker = "rust-lld"

[target.'cfg(all(target_os = "linux", target_env = "gnu"))']
rustflags = [
"--cfg",
"tokio_unstable",
"-Zshare-generics=y",
"-Zthreads=8",
"-Zunstable-options",
"-Csymbol-mangling-version=v0",
"-Ctarget-feature=-crt-static",
"-Clink-arg=-lgcc",
"-Clinker-flavor=gnu-lld-cc",
"-Clink-self-contained=+linker",
]

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

[target.'cfg(all())']
[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
rustflags = [
"--cfg",
"tokio_unstable",
"-Zshare-generics=y",
"-Csymbol-mangling-version=v0",
"-Ctarget-feature=-crt-static",
"-Clink-arg=-lgcc",
]

[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"
42 changes: 42 additions & 0 deletions .config/ast-grep/rule-tests/__snapshots__/no-context-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
id: no-context
snapshots:
'fn foo(context: ChunkingContext) -> u32 { 5 };':
labels:
- source: context
style: primary
start: 7
end: 14
- source: 'context: ChunkingContext'
style: secondary
start: 7
end: 31
foo(|context| context):
labels:
- source: context
style: primary
start: 5
end: 12
- source: '|context|'
style: secondary
start: 4
end: 13
let context = ChunkingContext::new();:
labels:
- source: context
style: primary
start: 4
end: 11
- source: let context = ChunkingContext::new();
style: secondary
start: 0
end: 37
'struct Foo { context: Context };':
labels:
- source: context
style: primary
start: 13
end: 20
- source: 'context: Context'
style: secondary
start: 13
end: 29
11 changes: 11 additions & 0 deletions .config/ast-grep/rule-tests/no-context-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
id: no-context
valid:
- 'let chunking_context = ChunkingContext::new();'
- 'struct Foo { chunking_context: Context };'
- 'foo(|chunking_context| context)'
- 'fn foo(chunking_context: ChunkingContext) -> u32 { 5 };'
invalid:
- 'let context = ChunkingContext::new();'
- 'struct Foo { context: Context };'
- 'foo(|context| context)'
- 'fn foo(context: ChunkingContext) -> u32 { 5 };'
35 changes: 35 additions & 0 deletions .config/ast-grep/rules/no-context.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
id: no-context
message: Don't name variables `context`.
note: Use a more specific name, such as chunking_context, asset_context, etc.
severity: error
language: Rust
rule:
regex: \bcontext\b
any:
- all:
- inside:
any:
- kind: closure_parameters
- kind: parameter
- kind: function_item
- kind: let_declaration
- kind: identifier
- all:
- kind: field_identifier
- inside:
kind: field_declaration
ignores:
- './crates/turbopack-css/**'
- './crates/turbopack-dev-server/**'
- './crates/turbopack-browser/**'
- './crates/turbopack-ecmascript-hmr-protocol/**'
- './crates/turbopack-ecmascript-plugins/**'
- './crates/turbopack-ecmascript-runtime/**'
- './crates/turbopack-json/**'
- './crates/turbopack-mdx/**'
- './crates/turbopack-node/**'
- './crates/turbopack-static/**'
- './crates/turbopack-tests/**'
- './crates/turbopack/**'
- './crates/turborepo-cache/**'
- './crates/turborepo-scm/**'
17 changes: 17 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[profile.tp-test-linux.junit]
path = "junit.xml"
report-name = "Turbopack tests (Linux)"
store-success-output = true
store-failure-output = true

[profile.tp-test-mac.junit]
path = "junit.xml"
report-name = "Turbopack tests (Mac)"
store-success-output = true
store-failure-output = true

[profile.tp-test-win.junit]
path = "junit.xml"
report-name = "Turbopack tests (Windows)"
store-success-output = true
store-failure-output = true
6 changes: 5 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test/development/basic/legacy-decorators/**/*
test/production/emit-decorator-metadata/**/*.js
test/e2e/app-dir/rsc-errors/app/swc/use-client/page.js
test-timings.json
packages/next-swc/crates/**
crates/**
bench/nested-deps/**
bench/nested-deps-app-router/**
packages/next-bundle-analyzer/index.d.ts
Expand All @@ -41,3 +41,7 @@ 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

# turbopack crates
turbopack/crates/*/tests/**
turbopack/crates/*/js/src/compiled
9 changes: 7 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"commonjs": true,
"es6": true,
"node": true,
"jest": true
"jest": true,
"es2020": true
},
"parserOptions": {
"requireConfigFile": false,
Expand Down Expand Up @@ -96,7 +97,11 @@
"warn",
{
"args": "none",
"ignoreRestSiblings": true
"ignoreRestSiblings": true,
"argsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"no-use-before-define": "off",
Expand Down
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ packages/next/compiled/** -text linguist-vendored

# Make next/src/build folder indexable for github search
build/** linguist-generated=false

turbopack/crates/turbo-tasks-macros-tests/tests/**/*.stderr linguist-generated=true
turbopack/crates/turbopack-ecmascript/tests/tree-shaker/analyzer/**/output.md linguist-generated=true
turbopack/crates/turbopack-tests/tests/snapshot/**/output/** linguist-generated=true
5 changes: 2 additions & 3 deletions .github/actions/next-integration-stat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
"strip-ansi": "^7.0.1"
},
"engines": {
"node": ">=18.17.0",
"pnpm": "8.15.4"
"node": ">=18.17.0"
},
"packageManager": "pnpm@8.15.4"
"packageManager": "pnpm@9.6.0"
}
5 changes: 2 additions & 3 deletions .github/actions/next-stats-action/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"typescript": "5.1.6"
},
"engines": {
"node": ">=18.17.0",
"pnpm": "8.15.4"
"node": ">=18.17.0"
},
"packageManager": "pnpm@8.15.4"
"packageManager": "pnpm@9.6.0"
}
59 changes: 10 additions & 49 deletions .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,22 @@ 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: 'Install LLD (LLVM Linker) for Linux'
if: runner.os == 'Linux'
shell: bash
run: sudo apt-get -y update && sudo apt-get install -y lld

- name: 'Add cargo problem matchers'
shell: bash
Expand Down
5 changes: 2 additions & 3 deletions .github/actions/upload-turboyet-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"@vercel/ncc": "^0.36.0"
},
"engines": {
"node": ">=18.17.0",
"pnpm": "8.15.4"
"node": ">=18.17.0"
},
"packageManager": "pnpm@8.15.4"
"packageManager": "pnpm@9.6.0"
}
2 changes: 1 addition & 1 deletion .github/labeler.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"area: examples": ["examples/**"],
"area: Font Optimization": ["**/*font*"],
"area: tests": ["test/**", "bench/**"],
"area: Turbopack": ["packages/next-swc/crates/next-*/**"],
"area: Turbopack": ["crates/next-*/**"],
"created-by: Chrome Aurora": [
{ "type": "user", "pattern": "atcastle" },
{ "type": "user", "pattern": "devknoll" },
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

env:
NAPI_CLI_VERSION: 2.16.2
TURBO_VERSION: 1.12.5
TURBO_VERSION: 2.0.9
NODE_LTS_VERSION: 20
CARGO_PROFILE_RELEASE_LTO: 'true'
TURBO_TEAM: 'vercel'
Expand Down Expand Up @@ -381,7 +381,7 @@ jobs:
run: turbo run build-wasm -vvv --remote-cache-timeout 90 --summarize -- --target ${{ matrix.target }}

- name: Add target to folder name
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'
run: '[[ -d "crates/wasm/pkg" ]] && mv crates/wasm/pkg crates/wasm/pkg-${{ matrix.target }} || ls crates/wasm'

- name: Upload turbo summary artifact
uses: actions/upload-artifact@v4
Expand All @@ -393,7 +393,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: wasm-binaries-${{matrix.target}}
path: packages/next-swc/crates/wasm/pkg-*
path: crates/wasm/pkg-*

deployTarball:
if: ${{ needs.build.outputs.isRelease != 'true' }}
Expand Down Expand Up @@ -435,7 +435,7 @@ jobs:
with:
pattern: wasm-binaries-*
merge-multiple: true
path: packages/next-swc/crates/wasm
path: crates/wasm

- run: npm i -g vercel@latest

Expand Down Expand Up @@ -483,7 +483,7 @@ jobs:
with:
pattern: wasm-binaries-*
merge-multiple: true
path: packages/next-swc/crates/wasm
path: crates/wasm

- run: npm i -g npm@10.4.0 # need latest version for provenance (pinning to avoid bugs)
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
Expand Down
Loading
Loading