Align package configuration api
Clear and concise description of the problem
This is a minor one :) ... My OCD goes a little bit off when I have to do this when configuring all your wonderful packages (typescript setup):
import { ModuleFederationPlugin } from '@module-federation/enhanced';
import { FederatedTypesPlugin } from '@module-federation/typescript';
import { NativeFederationTestsRemote } from '@module-federation/native-federation-tests';
const moduleFederationConfig = {// config here}
new ModuleFederationPlugin(moduleFederationConfig),
new FederatedTypesPlugin({ federationConfig: moduleFederationConfig }),
NativeFederationTestsRemote.webpack({ moduleFederationConfig }),
Suggested solution
I would love to have the interfaces aligned and be able to do:
import { ModuleFederationPlugin } from '@module-federation/enhanced';
import { FederatedTypesPlugin } from '@module-federation/typescript';
import { NativeFederationTestsRemote } from '@module-federation/native-federation-tests/webpack';
const moduleFederationConfig = {// config here}
new ModuleFederationPlugin({ moduleFederationConfig }),
new FederatedTypesPlugin({ moduleFederationConfig }),
new NativeFederationTestsRemote({ moduleFederationConfig }),
This will, in my eyes, make it a bit more streamlined to use for us consumers.
And just to spell it out :) some plugins expect a key like "federationConfig", while others expect "moduleFederationConfig". Some requires instantiation (new Plugin() vs Plugin()). The exact naming is not so important, as log as its aligned.
Alternative
No response
Additional context
No response
Validations
- [X] Read the Contributing Guidelines.
- [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Federated Types can be replaced with just module federation enhanced, since it comes with built in type system already.
If you want to avoid to use NativeFederationTests.webpack, you should import the native-federation-tests/webpack module.
You'll still be unable to use "new" keyword due to the structure of the plugin.
Closing, as my OCD is satisfied with the built in type system :)