Skip to content

Commit

Permalink
feat: add runtime module
Browse files Browse the repository at this point in the history
  • Loading branch information
LingyuCoder committed Sep 20, 2024
1 parent 0e0faeb commit 5ac50d2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,5 @@
"tokio",
"ukey",
"Ukey"
],
"rust-analyzer.checkOnSave": true
]
}
28 changes: 0 additions & 28 deletions crates/rspack_binding_values/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,31 +172,3 @@ impl JsRuntimeRequirementInTreeResult {
runtime_requirements
}
}

#[napi(object)]
pub struct JsRuntimeRequirementInTreeArg {
pub chunk: JsChunk,
pub runtime_requirements: JsRuntimeGlobals,
}

#[derive(Debug)]
#[napi(object)]
pub struct JsRuntimeRequirementInTreeResult {
pub runtime_requirements: JsRuntimeGlobals,
}

impl JsRuntimeRequirementInTreeResult {
pub fn as_runtime_globals(&self) -> RuntimeGlobals {
let mut runtime_requirements = RuntimeGlobals::default();

for item in self.runtime_requirements.value.iter() {
let name = item.to_snake_case().to_uppercase();

if let Some(item) = RUNTIME_GLOBAL_MAP.1.get(&name) {
runtime_requirements.extend(*item);
}
}

runtime_requirements
}
}

0 comments on commit 5ac50d2

Please sign in to comment.