-
-
Notifications
You must be signed in to change notification settings - Fork 543
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: phases level switcher for incremental options (#7954)
- Loading branch information
Showing
21 changed files
with
398 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 35 additions & 12 deletions
47
crates/rspack_binding_options/src/options/raw_experiments.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,48 @@ | ||
use napi_derive::napi; | ||
use rspack_core::RspackFuture; | ||
|
||
#[allow(clippy::empty_structs_with_brackets)] | ||
#[derive(Debug, Default)] | ||
#[napi(object)] | ||
pub struct RawRspackFuture { | ||
pub new_incremental: bool, | ||
} | ||
use rspack_core::{Incremental, RspackFuture}; | ||
|
||
#[derive(Debug, Default)] | ||
#[napi(object)] | ||
pub struct RawExperiments { | ||
pub layers: bool, | ||
pub top_level_await: bool, | ||
pub incremental: Option<RawIncremental>, | ||
pub rspack_future: RawRspackFuture, | ||
} | ||
|
||
impl From<RawRspackFuture> for RspackFuture { | ||
fn from(value: RawRspackFuture) -> Self { | ||
Self { | ||
new_incremental: value.new_incremental, | ||
#[derive(Debug, Default)] | ||
#[napi(object)] | ||
pub struct RawIncremental { | ||
pub make: bool, | ||
pub emit_assets: bool, | ||
pub infer_async_modules: bool, | ||
pub provided_exports: bool, | ||
pub module_hashes: bool, | ||
pub module_codegen: bool, | ||
pub module_runtime_requirements: bool, | ||
} | ||
|
||
impl From<RawIncremental> for Incremental { | ||
fn from(value: RawIncremental) -> Self { | ||
Self::Enabled { | ||
make: value.make, | ||
emit_assets: value.emit_assets, | ||
infer_async_modules: value.infer_async_modules, | ||
provided_exports: value.provided_exports, | ||
module_hashes: value.module_hashes, | ||
module_codegen: value.module_codegen, | ||
module_runtime_requirements: value.module_runtime_requirements, | ||
} | ||
} | ||
} | ||
|
||
#[allow(clippy::empty_structs_with_brackets)] | ||
#[derive(Debug, Default)] | ||
#[napi(object)] | ||
pub struct RawRspackFuture {} | ||
|
||
impl From<RawRspackFuture> for RspackFuture { | ||
fn from(_value: RawRspackFuture) -> Self { | ||
Self {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
e833f20
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Benchmark detail: Open
e833f20
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Ran ecosystem CI: Open