Skip to content

Commit

Permalink
fix(plugins): make rust plugin stage compatible with webpack
Browse files Browse the repository at this point in the history
Closes #7862
  • Loading branch information
pawel-twardziak committed Sep 24, 2024
1 parent 7688797 commit d55e2a9
Showing 1 changed file with 44 additions and 44 deletions.
88 changes: 44 additions & 44 deletions crates/node_binding/src/plugins/interceptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ use rspack_plugin_javascript::{JavascriptModulesChunkHash, JavascriptModulesChun
#[napi(object)]
pub struct JsTap {
pub function: JsFunction,
pub stage: i32,
pub stage: f64,
}

pub struct ThreadsafeJsTap<T: 'static, R> {
pub function: ThreadsafeFunction<T, R>,
pub stage: i32,
pub stage: f64,
}

impl<T: 'static, R> Clone for ThreadsafeJsTap<T, R> {
Expand Down Expand Up @@ -242,7 +242,7 @@ macro_rules! define_register {
#[derive(Clone)]
struct $tap_name {
function: ThreadsafeFunction<$arg, $ret>,
stage: i32,
stage: f64,
}

impl $tap_name {
Expand Down Expand Up @@ -908,7 +908,7 @@ impl CompilerThisCompilation for CompilerThisCompilationTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -924,7 +924,7 @@ impl CompilerCompilation for CompilerCompilationTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -936,7 +936,7 @@ impl CompilerMake for CompilerMakeTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -948,7 +948,7 @@ impl CompilerFinishMake for CompilerFinishMakeTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -960,7 +960,7 @@ impl CompilerShouldEmit for CompilerShouldEmitTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -971,7 +971,7 @@ impl CompilerEmit for CompilerEmitTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -982,7 +982,7 @@ impl CompilerAfterEmit for CompilerAfterEmitTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1005,7 +1005,7 @@ impl CompilerAssetEmitted for CompilerAssetEmittedTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1019,7 +1019,7 @@ impl CompilationBuildModule for CompilationBuildModuleTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1033,7 +1033,7 @@ impl CompilationStillValidModule for CompilationStillValidModuleTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1047,7 +1047,7 @@ impl CompilationSucceedModule for CompilationSucceedModuleTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1069,7 +1069,7 @@ impl CompilationExecuteModule for CompilationExecuteModuleTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1081,7 +1081,7 @@ impl CompilationFinishModules for CompilationFinishModulesTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1092,7 +1092,7 @@ impl CompilationOptimizeModules for CompilationOptimizeModulesTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1103,7 +1103,7 @@ impl CompilationAfterOptimizeModules for CompilationAfterOptimizeModulesTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1114,7 +1114,7 @@ impl CompilationOptimizeTree for CompilationOptimizeTreeTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1125,7 +1125,7 @@ impl CompilationOptimizeChunkModules for CompilationOptimizeChunkModulesTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1152,7 +1152,7 @@ impl CompilationAdditionalTreeRuntimeRequirements
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand Down Expand Up @@ -1183,7 +1183,7 @@ impl CompilationRuntimeRequirementInTree for CompilationRuntimeRequirementInTree
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand Down Expand Up @@ -1230,7 +1230,7 @@ impl CompilationRuntimeModule for CompilationRuntimeModuleTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1249,7 +1249,7 @@ impl CompilationChunkHash for CompilationChunkHashTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1266,7 +1266,7 @@ impl CompilationChunkAsset for CompilationChunkAssetTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1278,7 +1278,7 @@ impl CompilationProcessAssets for CompilationProcessAssetsTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1290,7 +1290,7 @@ impl CompilationAfterProcessAssets for CompilationAfterProcessAssetsTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1301,7 +1301,7 @@ impl CompilationSeal for CompilationSealTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1312,7 +1312,7 @@ impl CompilationAfterSeal for CompilationAfterSealTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand Down Expand Up @@ -1345,7 +1345,7 @@ impl NormalModuleFactoryBeforeResolve for NormalModuleFactoryBeforeResolveTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand Down Expand Up @@ -1382,7 +1382,7 @@ impl NormalModuleFactoryFactorize for NormalModuleFactoryFactorizeTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand Down Expand Up @@ -1419,7 +1419,7 @@ impl NormalModuleFactoryResolve for NormalModuleFactoryResolveTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1446,7 +1446,7 @@ impl NormalModuleFactoryResolveForScheme for NormalModuleFactoryResolveForScheme
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand Down Expand Up @@ -1521,7 +1521,7 @@ impl NormalModuleFactoryAfterResolve for NormalModuleFactoryAfterResolveTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1546,7 +1546,7 @@ impl NormalModuleFactoryCreateModule for NormalModuleFactoryCreateModuleTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1569,7 +1569,7 @@ impl ContextModuleFactoryBeforeResolve for ContextModuleFactoryBeforeResolveTap
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1589,7 +1589,7 @@ impl ContextModuleFactoryAfterResolve for ContextModuleFactoryAfterResolveTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1608,7 +1608,7 @@ impl JavascriptModulesChunkHash for JavascriptModulesChunkHashTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1626,7 +1626,7 @@ impl HtmlPluginBeforeAssetTagGeneration for HtmlPluginBeforeAssetTagGenerationTa
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1641,7 +1641,7 @@ impl HtmlPluginAlterAssetTags for HtmlPluginAlterAssetTagsTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1659,7 +1659,7 @@ impl HtmlPluginAlterAssetTagGroups for HtmlPluginAlterAssetTagGroupsTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1677,7 +1677,7 @@ impl HtmlPluginAfterTemplateExecution for HtmlPluginAfterTemplateExecutionTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1692,7 +1692,7 @@ impl HtmlPluginBeforeEmit for HtmlPluginBeforeEmitTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

Expand All @@ -1707,6 +1707,6 @@ impl HtmlPluginAfterEmit for HtmlPluginAfterEmitTap {
}

fn stage(&self) -> i32 {
self.stage
self.stage as i32
}
}

0 comments on commit d55e2a9

Please sign in to comment.