Is your feature request related to a problem?
No response
Describe the solution you'd like
In Module Federation, the negotiation behavior can be configured per shared dependency.
For example, it is possible to have:
- shared dependencies that throw an error if version negotiation fails (
singleton: true + strictVersion: true);
- shared dependencies that fall back to loading another compatible version when negotiation fails.
In Native Federation v4, this behavior appears to be controlled globally by the strictExternalCompatibility option passed to initFederation(). As a result, it is not possible to configure the negotiation strategy for individual shared dependencies. We would like to configure some shared dependencies as strict while allowing others to fall back to their own implementation when version negotiation fails.
Additionally, is there a way to let a remote resolve its own shared dependency even if the host already provides the same package? At the moment, Native Federation v4 seems to always prioritize the host's shared dependency.
Example:
This results in:
[NF][3]: [front-office][lodash-es@4.18.1] Is not compatible with requiredRange '^4.17.23' from remote '__NF-HOST__'.
In this scenario, we would expect loading a single version lodash-es@4.18.1 into the global scope instead of failing, similarly to how Module Federation behaves.
- Is there currently a configuration that allows negotiation behavior to be configured per shared dependency instead of globally?
- Is it possible to let loading shared dependency from a remote even when the host provides the same package?
Describe alternatives you've considered
No response
Is your feature request related to a problem?
No response
Describe the solution you'd like
In Module Federation, the negotiation behavior can be configured per shared dependency.
For example, it is possible to have:
singleton: true+strictVersion: true);In Native Federation v4, this behavior appears to be controlled globally by the
strictExternalCompatibilityoption passed toinitFederation(). As a result, it is not possible to configure the negotiation strategy for individual shared dependencies. We would like to configure some shared dependencies as strict while allowing others to fall back to their own implementation when version negotiation fails.Additionally, is there a way to let a remote resolve its own shared dependency even if the host already provides the same package? At the moment, Native Federation v4 seems to always prioritize the host's shared dependency.
Example:
Host provides:
lodash-es@4.17.23requiredVersion: ^4.17.23Remote (
front-office) provides:lodash-es@4.18.1requiredVersion: ^4.18.0This results in:
[NF][3]: [front-office][lodash-es@4.18.1] Is not compatible with requiredRange '^4.17.23' from remote '__NF-HOST__'.In this scenario, we would expect loading a single version
lodash-es@4.18.1into the global scope instead of failing, similarly to how Module Federation behaves.Describe alternatives you've considered
No response