-
-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Module Federation, part 4, ConsumeSharedPlugin (#4783)
* feat: Module Federation, part 4, ConsumeSharedPlugin * works * fix * fix * enable tests * fix
- Loading branch information
Showing
119 changed files
with
2,230 additions
and
60 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
46 changes: 46 additions & 0 deletions
46
crates/rspack_core/src/mf/sharing/consume_shared_fallback_dependency.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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
use crate::{ | ||
AsContextDependency, AsDependencyTemplate, Dependency, DependencyCategory, DependencyId, | ||
DependencyType, ModuleDependency, | ||
}; | ||
|
||
#[derive(Debug, Clone)] | ||
pub struct ConsumeSharedFallbackDependency { | ||
id: DependencyId, | ||
request: String, | ||
} | ||
|
||
impl ConsumeSharedFallbackDependency { | ||
pub fn new(request: String) -> Self { | ||
Self { | ||
id: DependencyId::new(), | ||
request, | ||
} | ||
} | ||
} | ||
|
||
impl Dependency for ConsumeSharedFallbackDependency { | ||
fn dependency_debug_name(&self) -> &'static str { | ||
"ConsumeSharedFallbackDependency" | ||
} | ||
|
||
fn id(&self) -> &DependencyId { | ||
&self.id | ||
} | ||
|
||
fn dependency_type(&self) -> &DependencyType { | ||
&DependencyType::ProvideModuleForShared | ||
} | ||
|
||
fn category(&self) -> &DependencyCategory { | ||
&DependencyCategory::Esm | ||
} | ||
} | ||
|
||
impl ModuleDependency for ConsumeSharedFallbackDependency { | ||
fn request(&self) -> &str { | ||
&self.request | ||
} | ||
} | ||
|
||
impl AsContextDependency for ConsumeSharedFallbackDependency {} | ||
impl AsDependencyTemplate for ConsumeSharedFallbackDependency {} |
Oops, something went wrong.