Skip to content

Commit 62267ec

Browse files
authored
remove legacy handling for suspense option of next/dynamic (#57900)
This part was removed before but added in back during the merging of turbopack and legacy `next-swc` changes. Remove them again
1 parent 337f33b commit 62267ec

File tree

1 file changed

+1
-18
lines changed
  • packages/next-swc/crates/next-transform-dynamic/src

1 file changed

+1
-18
lines changed

packages/next-swc/crates/next-transform-dynamic/src/lib.rs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,6 @@ impl Fold for NextDynamicPatcher {
326326
})))];
327327

328328
let mut has_ssr_false = false;
329-
let mut has_suspense = false;
330329

331330
if expr.args.len() == 2 {
332331
if let Expr::Object(ObjectLit {
@@ -359,33 +358,17 @@ impl Fold for NextDynamicPatcher {
359358
has_ssr_false = true
360359
}
361360
}
362-
if sym == "suspense" {
363-
if let Some(Lit::Bool(Bool {
364-
value: true,
365-
span: _,
366-
})) = value.as_lit()
367-
{
368-
has_suspense = true
369-
}
370-
}
371361
}
372362
}
373363
}
374364
props.extend(options_props.iter().cloned());
375365
}
376366
}
377367

378-
// Don't strip the `loader` argument if suspense is true
379-
// See https://github.com/vercel/next.js/issues/36636 for background.
380-
381368
// Also don't strip the `loader` argument for server components (both
382369
// server/client layers), since they're aliased to a
383370
// React.lazy implementation.
384-
if has_ssr_false
385-
&& !has_suspense
386-
&& self.is_server_compiler
387-
&& !self.is_react_server_layer
388-
{
371+
if has_ssr_false && self.is_server_compiler && !self.is_react_server_layer {
389372
expr.args[0] = Lit::Null(Null { span: DUMMY_SP }).as_arg();
390373
}
391374

0 commit comments

Comments
 (0)