Unverified Commit 8ddc1cdb authored by Niklas Mischkulnig's avatar Niklas Mischkulnig Committed by GitHub
parent a0376cfe
...@@ -23,6 +23,10 @@ env: ...@@ -23,6 +23,10 @@ env:
TURBO_TEAM: 'vercel' TURBO_TEAM: 'vercel'
TURBO_CACHE: 'remote:rw' TURBO_CACHE: 'remote:rw'
permissions:
contents: read
id-token: write
jobs: jobs:
benchmark-small-apps: benchmark-small-apps:
name: Benchmark Rust Crates (small apps) name: Benchmark Rust Crates (small apps)
...@@ -58,7 +62,6 @@ jobs: ...@@ -58,7 +62,6 @@ jobs:
with: with:
mode: instrumentation mode: instrumentation
run: cargo codspeed run -p turbopack-cli small_apps run: cargo codspeed run -p turbopack-cli small_apps
token: ${{ secrets.CODSPEED_TOKEN }}
benchmark-analyzer: benchmark-analyzer:
name: Benchmark Rust Crates (analyzer) name: Benchmark Rust Crates (analyzer)
...@@ -94,7 +97,6 @@ jobs: ...@@ -94,7 +97,6 @@ jobs:
with: with:
mode: instrumentation mode: instrumentation
run: cargo codspeed run -p turbopack-ecmascript references run: cargo codspeed run -p turbopack-ecmascript references
token: ${{ secrets.CODSPEED_TOKEN }}
benchmark-large: benchmark-large:
name: Benchmark Rust Crates (large) name: Benchmark Rust Crates (large)
...@@ -124,4 +126,3 @@ jobs: ...@@ -124,4 +126,3 @@ jobs:
with: with:
mode: instrumentation mode: instrumentation
run: cargo codspeed run run: cargo codspeed run
token: ${{ secrets.CODSPEED_TOKEN }}
...@@ -42,13 +42,13 @@ fn effect_has_side_effect_deps(call: &CallExpr) -> bool { ...@@ -42,13 +42,13 @@ fn effect_has_side_effect_deps(call: &CallExpr) -> bool {
// We can't optimize if the effect has a function call as a dependency: // We can't optimize if the effect has a function call as a dependency:
// useEffect(() => {}, x()) // useEffect(() => {}, x())
if let box Expr::Call(_) = &call.args[1].expr { if let Expr::Call(_) = &*call.args[1].expr {
return true; return true;
} }
// As well as: // As well as:
// useEffect(() => {}, [x()]) // useEffect(() => {}, [x()])
if let box Expr::Array(arr) = &call.args[1].expr { if let Expr::Array(arr) = &*call.args[1].expr {
for elem in arr.elems.iter().flatten() { for elem in arr.elems.iter().flatten() {
if let ExprOrSpread { if let ExprOrSpread {
expr: box Expr::Call(_), expr: box Expr::Call(_),
...@@ -155,7 +155,7 @@ impl Fold for OptimizeServerReact { ...@@ -155,7 +155,7 @@ impl Fold for OptimizeServerReact {
} }
} else if let Some(react_ident) = &self.react_ident } else if let Some(react_ident) = &self.react_ident
&& let Callee::Expr(box Expr::Member(member)) = &call.callee && let Callee::Expr(box Expr::Member(member)) = &call.callee
&& let box Expr::Ident(f) = &member.obj && let Expr::Ident(f) = &*member.obj
&& &f.to_id() == react_ident && &f.to_id() == react_ident
&& let MemberProp::Ident(i) = &member.prop && let MemberProp::Ident(i) = &member.prop
{ {
...@@ -190,8 +190,8 @@ impl Fold for OptimizeServerReact { ...@@ -190,8 +190,8 @@ impl Fold for OptimizeServerReact {
// be sure is not a function (e.g. {} or [] lit). // be sure is not a function (e.g. {} or [] lit).
// This is because useState allows a function as the // This is because useState allows a function as the
// initialiser. // initialiser.
match &call.args[0].expr { match &*call.args[0].expr {
box Expr::Lit(_) | box Expr::Object(_) | box Expr::Array(_) => { Expr::Lit(_) | Expr::Object(_) | Expr::Array(_) => {
// const [state, setState] = [x, () => {}]; // const [state, setState] = [x, () => {}];
return VarDeclarator { return VarDeclarator {
definite: false, definite: false,
......
...@@ -2870,8 +2870,8 @@ impl<C: Comments> VisitMut for ServerActions<C> { ...@@ -2870,8 +2870,8 @@ impl<C: Comments> VisitMut for ServerActions<C> {
if let ( if let (
AssignTarget::Simple(SimpleAssignTarget::Ident(ident)), AssignTarget::Simple(SimpleAssignTarget::Ident(ident)),
box Expr::Arrow(_) | box Expr::Fn(_), Expr::Arrow(_) | Expr::Fn(_),
) = (&assign_expr.left, &assign_expr.right) ) = (&assign_expr.left, &*assign_expr.right)
{ {
self.arrow_or_fn_expr_ident = Some(ident.id.clone()); self.arrow_or_fn_expr_ident = Some(ident.id.clone());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment