Skip to content

Commit

Permalink
Merge branch 'canary' into ajiang/fix-x-deployment-id-prefetch
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity authored Dec 17, 2024
2 parents aaa77da + ff0ef9c commit a7f05e1
Show file tree
Hide file tree
Showing 4,643 changed files with 222,514 additions and 132,335 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
9 changes: 8 additions & 1 deletion .alexrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
"invalid",
"remains",
"special",
"white"
"white",
"deno",
"digitalocean",
"flightcontrol",
"fly.io",
"github",
"railway",
"sst"
]
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .config/ast-grep/rule-tests/resolved-vc-in-return-type-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
id: resolved-vc-in-return-type
valid:
- |
pub async fn ignore_this(x: ResolvedVc<MyType>) -> Result<ResolvedVc<MyType>> {}
- |
pub trait OtherTrait() {
fn ignore_this() -> ResolvedVc<MyType>;
}
invalid:
- |
#[turbo_tasks::function]
pub async fn flag_this(x: ResolvedVc<MyType>) -> ResolvedVc<MyType> {}
- |
#[turbo_tasks::function]
pub async fn flag_this_too(x: ResolvedVc<MyType>) -> Result<ResolvedVc<MyType>> {}
- |
#[turbo_tasks::value_trait]
pub trait ValueTrait() {
fn flag_this() -> ResolvedVc<MyType>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
id: resolved-vc-in-trait-arguments
valid:
- |
#[turbo_tasks::value_trait]
pub trait Example {
fn write_to_disk(self: Vc<Self>);
fn write_to_disk(self: ResolvedVc<Self>) {}
}
invalid:
- |
#[turbo_tasks::value_trait]
pub trait Example {
fn write_to_disk(self: ResolvedVc<Self>);
}
52 changes: 52 additions & 0 deletions .config/ast-grep/rules/resolved-vc-in-return-type.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/ast-grep/ast-grep/main/schemas/rule.json

id: resolved-vc-in-return-type
message: Returning a `ResolvedVc` in a turbo task is not recommended. Consider replacing `$TYPE` in `$FN_NAME` with `$RESOLVED_VC` instead.
severity: warning # error, warning, info, hint
language: Rust
rule:
any:
# turbo tasks function
- all:
- pattern:
context: 'let x: ResolvedVc<$A> = 1;'
selector: generic_type
- pattern: $TYPE
inside:
kind: function_item
field: return_type
stopBy: end
follows:
pattern: '#[turbo_tasks::function]'
has:
kind: identifier
pattern: $FN_NAME
# turbo tasks value trait
- all:
- pattern:
context: 'let x: ResolvedVc<$A> = 1;'
selector: generic_type
- pattern: $TYPE
inside:
kind: function_signature_item
field: return_type
stopBy: end
inside:
inside:
kind: trait_item
follows:
pattern: '#[turbo_tasks::value_trait]'
has:
kind: identifier
pattern: $FN_NAME
rewriters:
- id: rewrite-vc
rule:
pattern: $TYPE
fix: Vc<$A>
transform:
RESOLVED_VC:
rewrite:
rewriters: [rewrite-vc]
source: $TYPE
fix: $RESOLVED_VC
20 changes: 20 additions & 0 deletions .config/ast-grep/rules/resolved-vc-in-trait.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/ast-grep/ast-grep/main/schemas/rule.json

id: resolved-vc-in-trait-arguments
message: Using `ResolvedVc` in a turbo tasks trait is unsound. Consider making `$FN_NAME` take `Vc` instead.
severity: warning # error, warning, info, hint
language: Rust
rule:
pattern:
context: 'let x: ResolvedVc<$A> = 1;'
selector: generic_type
inside:
kind: function_signature_item
stopBy: end
pattern: fn $FN_NAME($_ARGS)
inside:
inside:
kind: trait_item
follows:
pattern: '#[turbo_tasks::value_trait]'
fix: Vc<$A>
42 changes: 42 additions & 0 deletions .config/ast-grep/rules/resolved-vc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/ast-grep/ast-grep/main/schemas/rule.json

id: no-vc-struct
message: Don't use a Vc directly in a struct
note: 'Prefer using ResolvedVc, or add a `// no-resolved-vc(<AUTHOR>): <REASON>` comment'
severity: warning
language: rust

rule:
pattern:
context: 'let x: Vc<$A> = 1;'
selector: generic_type
inside:
stopBy: end
not:
follows:
kind: line_comment
regex: \s*//\s*no-resolved-vc\((.+)\):.+
inside:
inside:
any:
- kind: struct_item
follows:
stopBy:
not:
kind: attribute_item
kind: attribute_item
has:
kind: attribute
regex: '^turbo_tasks::value(\(.*\))?$'
- inside:
kind: enum_variant_list
inside:
follows:
stopBy:
not:
kind: attribute_item
kind: attribute_item
has:
kind: attribute
regex: '^turbo_tasks::value(\(.*\))?$'
fix: ResolvedVc<$A>
30 changes: 30 additions & 0 deletions .config/ast-grep/rules/to-resolved-in-loop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/ast-grep/ast-grep/main/schemas/rule.json

id: to-resolved-in-loop
message: 'Calling `$EXPR` in a loop could be a doing a lot of work sequentially. Consider producing an iterator of futures and using `try_join`.'
severity: info # error, warning, info, hint
language: Rust
rule:
kind: for_expression
pattern: for $VAR in $ITER {$$$_ARGS}
has:
kind: try_expression
stopBy: end
all:
- pattern: $ARG.to_resolved().await?
- pattern: $EXPR
# ignore sequential application
- not:
inside:
kind: assignment_expression
pattern: '*$VAR = $_EXPR'
# ignore conditionals via match
- not:
inside:
kind: match_arm
stopBy: end
# ignore conditionals via if
- not:
inside:
kind: if_expression
stopBy: end
2 changes: 2 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# syntax=docker.io/docker/dockerfile:1

# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
ARG VARIANT=20-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
Expand Down
2 changes: 2 additions & 0 deletions .devcontainer/base.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# syntax=docker.io/docker/dockerfile:1

# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
ARG VARIANT=20-bullseye
FROM node:${VARIANT}
Expand Down
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ packages/react-dev-overlay/lib/**
.github/actions/next-stats-action/.work
packages/next-codemod/transforms/__testfixtures__/**/*
packages/next-codemod/transforms/__tests__/**/*
packages/next-codemod/bin/__testfixtures__/**/*
packages/next-codemod/**/*.js
packages/next-codemod/**/*.d.ts
packages/next-env/**/*.d.ts
Expand All @@ -44,7 +45,10 @@ 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/app-dir/server-source-maps/fixtures/default/internal-pkg/sourcemapped.js
test/e2e/app-dir/server-source-maps/fixtures/default/external-pkg/sourcemapped.js
test/e2e/async-modules/amp-validator-wasm.js
test/development/next-lint-eslint-formatter-compact/**/*.js

# turbopack crates
turbopack/crates/*/tests/**
Expand Down
Loading

0 comments on commit a7f05e1

Please sign in to comment.