Skip to content

Commit

Permalink
refactor(turbopack): consolidate jsx fast refresh (#4927)
Browse files Browse the repository at this point in the history
### Description

WEB-940

Minor refactoring to consolidate react related options.

Next.js still uses old `enable_react_refresh`, will migrate once this
changes land.
  • Loading branch information
kwonoj committed May 15, 2023
1 parent 8b1764d commit 4560f34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/turbopack/src/module_options/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl ModuleOptionsVc {
let jsx = enable_jsx.await?;

transforms.push(EcmascriptInputTransform::React {
refresh: enable_react_refresh,
refresh: enable_react_refresh || jsx.react_refresh,
import_source: OptionStringVc::cell(jsx.import_source.clone()),
runtime: OptionStringVc::cell(jsx.runtime.clone()),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ impl WebpackLoadersOptions {
}
}

// [TODO]: should enabled_react_refresh belong to this options?
#[turbo_tasks::value(shared)]
#[derive(Default, Clone, Debug)]
pub struct JsxTransformOptions {
pub react_refresh: bool,
pub import_source: Option<String>,
pub runtime: Option<String>,
}
Expand Down

0 comments on commit 4560f34

Please sign in to comment.