-
-
Notifications
You must be signed in to change notification settings - Fork 358
feat(react-bridge): Introduce enableBridgeRouter Configuration for Enhanced Bridge Router Control #4129
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
Conversation
🦋 Changeset detectedLatest commit: 29e6991 The changes in this PR will be included in the next version bump. This PR includes changesets to release 36 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
options?.bridge?.disableAlias === true | ||
) { | ||
if (options?.bridge?.disableAlias === true) { | ||
console.warn( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to replace with logger.warn :D
Description
This PR introduces a new
enableBridgeRouter
configuration option to provide more explicit and granular control over the React bridge router functionality in Module Federation, while also optimizing bridge component basename passing and plugin application logic.What Changed
Implemented a three-tier priority system for ReactBridgePlugin activation:
When user explicitly enables bridge router
Provides backward compatibility with existing disableAlias option
Clear override mechanism for disabling functionality
Falls back to auto-detection when no explicit configuration is provided
Maintains existing behavior for users who haven't configured the option
Enhanced basename passing: Introduced BridgeWrapper component to reliably pass basename through both Context API and component props
Dual-channel approach: Ensures basename reaches target components via multiple paths for maximum compatibility
Better error handling: Maintains existing ErrorBoundary functionality while improving prop flow
Migration Guide
For users wanting to adopt the new explicit configuration:
Related Issue
Types of changes
Checklist