Skip to content

Commit

Permalink
fix(turbopack): Remove wrong check for __turbopack_refresh__ (#70696)
Browse files Browse the repository at this point in the history
### What?

Remove a wrong check for turbopack tree shaking

### Why?

It's not necessary anymore

### How?
  • Loading branch information
kdy1 authored Oct 4, 2024
1 parent 5975ae0 commit 0391175
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
4 changes: 2 additions & 2 deletions test/integration/telemetry/pages/warning.skip
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
function a(v) {
return v
}
;['index.js'].forEach(f => {
require(a('./dynamic-file-imports/' + f))
;['index.js'].forEach(async f => {
await import(a('./dynamic-file-imports/' + f))
})

export default () => 'Warn'
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ import { retry } from 'next-test-utils'
rsc: process.env.TURBOPACK ? 1 : 3,
},
'app/named-reexport/client/page': {
'action-browser': 3,
// Turbopack supports tree-shaking these re-exports
'action-browser': process.env.TURBOPACK ? 1 : 3,
},
})
})
Expand Down
7 changes: 0 additions & 7 deletions turbopack/crates/turbopack-ecmascript/src/tree_shake/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,13 +519,6 @@ impl Visit for ShouldSkip {
return;
}

// This is needed to pass some tests even if we enable tree shaking only for production
// builds.
if n.is_ident_ref_to("__turbopack_refresh__") {
self.skip = true;
return;
}

n.visit_children_with(self);
}

Expand Down

0 comments on commit 0391175

Please sign in to comment.