feat(enhanced): prefix share exclusion #3736
Draft
+1,408
−877
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces several changes to enhance the sharing behavior in the Module Federation Plugin by adding support for request filtering, improving schema validation, and updating related plugins. Key changes include the addition of a
filter
property to shared configurations, updates to schema validation logic, and integration of these updates into theConsumeSharedPlugin
,ProvideSharedPlugin
, andSharePlugin
classes.Enhancements to Sharing Configuration:
filter
property to shared configurations, allowing request filtering using regular expressions. This property was integrated into theConsumeSharedPlugin
andProvideSharedPlugin
classes to skip certain requests during module sharing. ([[1]](https://github.com/module-federation/core/pull/3736/files#diff-c97c2d9884d2a584a0dd77bf52955badffbbdbb18eda2eb243a76a1ed0f95d7dR139)
,[[2]](https://github.com/module-federation/core/pull/3736/files#diff-c97c2d9884d2a584a0dd77bf52955badffbbdbb18eda2eb243a76a1ed0f95d7dR337-R344)
,[[3]](https://github.com/module-federation/core/pull/3736/files#diff-c7bf95f42a5abd6e44a1670123e4f64605c1d7c4826f1d019f2474beb72971cbR96)
,[[4]](https://github.com/module-federation/core/pull/3736/files#diff-c7bf95f42a5abd6e44a1670123e4f64605c1d7c4826f1d019f2474beb72971cbR112)
,[[5]](https://github.com/module-federation/core/pull/3736/files#diff-c7bf95f42a5abd6e44a1670123e4f64605c1d7c4826f1d019f2474beb72971cbR236-R242)
,[[6]](https://github.com/module-federation/core/pull/3736/files#diff-981a75bcd0aa5f3fbd0fbfa80a3a67300604c5ab3990bc692f2f65f1480aa1b4R69)
,[[7]](https://github.com/module-federation/core/pull/3736/files#diff-981a75bcd0aa5f3fbd0fbfa80a3a67300604c5ab3990bc692f2f65f1480aa1b4R87)
)Schema Validation Improvements:
ModuleFederationPlugin.check.ts
to include the newfilter
property. This includes defining theFilter
schema, validating its structure, and ensuring compatibility with existing configurations. ([[1]](https://github.com/module-federation/core/pull/3736/files#diff-4c59fef2280dfcc41884349a0ef4a05bc0ad4ea79f94d9507ed5807ac9cfb7a2R239)
,[[2]](https://github.com/module-federation/core/pull/3736/files#diff-4c59fef2280dfcc41884349a0ef4a05bc0ad4ea79f94d9507ed5807ac9cfb7a2R271-R275)
,[[3]](https://github.com/module-federation/core/pull/3736/files#diff-4c59fef2280dfcc41884349a0ef4a05bc0ad4ea79f94d9507ed5807ac9cfb7a2R1447)
,[[4]](https://github.com/module-federation/core/pull/3736/files#diff-4c59fef2280dfcc41884349a0ef4a05bc0ad4ea79f94d9507ed5807ac9cfb7a2R1492-R1515)
,[[5]](https://github.com/module-federation/core/pull/3736/files#diff-4c59fef2280dfcc41884349a0ef4a05bc0ad4ea79f94d9507ed5807ac9cfb7a2L1551-R1586)
,[[6]](https://github.com/module-federation/core/pull/3736/files#diff-4c59fef2280dfcc41884349a0ef4a05bc0ad4ea79f94d9507ed5807ac9cfb7a2L1615-R1650)
,[[7]](https://github.com/module-federation/core/pull/3736/files#diff-4c59fef2280dfcc41884349a0ef4a05bc0ad4ea79f94d9507ed5807ac9cfb7a2L1652-R1693)
,[[8]](https://github.com/module-federation/core/pull/3736/files#diff-4c59fef2280dfcc41884349a0ef4a05bc0ad4ea79f94d9507ed5807ac9cfb7a2L1684-R1724)
,[[9]](https://github.com/module-federation/core/pull/3736/files#diff-4c59fef2280dfcc41884349a0ef4a05bc0ad4ea79f94d9507ed5807ac9cfb7a2R1793)
,[[10]](https://github.com/module-federation/core/pull/3736/files#diff-4c59fef2280dfcc41884349a0ef4a05bc0ad4ea79f94d9507ed5807ac9cfb7a2L1886-R1927)
,[[11]](https://github.com/module-federation/core/pull/3736/files#diff-4c59fef2280dfcc41884349a0ef4a05bc0ad4ea79f94d9507ed5807ac9cfb7a2L1899-R1950)
,[[12]](https://github.com/module-federation/core/pull/3736/files#diff-4c59fef2280dfcc41884349a0ef4a05bc0ad4ea79f94d9507ed5807ac9cfb7a2L1931-R1975)
,[[13]](https://github.com/module-federation/core/pull/3736/files#diff-4c59fef2280dfcc41884349a0ef4a05bc0ad4ea79f94d9507ed5807ac9cfb7a2L1957-R1999)
,[[14]](https://github.com/module-federation/core/pull/3736/files#diff-4c59fef2280dfcc41884349a0ef4a05bc0ad4ea79f94d9507ed5807ac9cfb7a2L2002-R2043)
,[[15]](https://github.com/module-federation/core/pull/3736/files#diff-4c59fef2280dfcc41884349a0ef4a05bc0ad4ea79f94d9507ed5807ac9cfb7a2L2056-R2097)
,[[16]](https://github.com/module-federation/core/pull/3736/files#diff-4c59fef2280dfcc41884349a0ef4a05bc0ad4ea79f94d9507ed5807ac9cfb7a2L2113-R2154)
)Integration with SharePlugin:
SharePlugin
class to ensure that the newfilter
property and other configurations conform to the updated schema. ([packages/enhanced/src/lib/sharing/SharePlugin.tsR19-R37](https://github.com/module-federation/core/pull/3736/files#diff-981a75bcd0aa5f3fbd0fbfa80a3a67300604c5ab3990bc692f2f65f1480aa1b4R19-R37)
)Miscellaneous:
vitest.config.ts
, for thebridge-react
package, which sets up testing withjsdom
and includes relevant test files. ([packages/bridge/bridge-react/vitest.config.ts.timestamp-1745940718757-9bccf2220159f.mjsR1-R27](https://github.com/module-federation/core/pull/3736/files#diff-399c19623c6e719af318602656c016a09ec0a47a025d36ce86e2226a5fe85f14R1-R27)
)Related Issue
Types of changes
Checklist