Skip to content

feat(enhanced): prefix share exclusion #3736

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Conversation

ScriptedAlchemy
Copy link
Member

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 the ConsumeSharedPlugin, ProvideSharedPlugin, and SharePlugin classes.

Enhancements to Sharing Configuration:

  • Added a new filter property to shared configurations, allowing request filtering using regular expressions. This property was integrated into the ConsumeSharedPlugin and ProvideSharedPlugin 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:

  • Updated the schema validation logic in ModuleFederationPlugin.check.ts to include the new filter property. This includes defining the Filter 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:

  • Introduced schema validation in the SharePlugin class to ensure that the new filter 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:

  • Added a new test configuration file, vitest.config.ts, for the bridge-react package, which sets up testing with jsdom 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

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

Copy link

changeset-bot bot commented Apr 29, 2025

⚠️ No Changeset found

Latest commit: c5b7b0b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

netlify bot commented Apr 29, 2025

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit c5b7b0b
🔍 Latest deploy log https://app.netlify.com/sites/module-federation-docs/deploys/681495af3fd1540008215fa6
😎 Deploy Preview https://deploy-preview-3736--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant