Sep 5, 2024
We're excited to announce a new experimental feature: experiments.asyncStartup = true
.
This release introduces asynchronous startup, enabling automatic async initialization for Module Federation entrypoints.
With async startup enabled, dynamic imports (import()
) at the top of your app are no longer required. All entrypoints will now initialize asynchronously by default. This means:
This only affects entry point initialization. You can still use dynamic imports normally throughout your application, including for importing remote modules. This feature doesn't change or limit how dynamic imports work in your code.
Note: Asynchronous entrypoints will always export a promise. This is particularly relevant if you're manually requiring a bundled entrypoint or exposing something like a UMD library to the global scope.
See how the new async behavior simplifies entrypoints. Click on the "Before" and "After" tabs to see the difference.
When using async startup:
This feature simplifies Module Federation setup by removing the need for manual async handling while ensuring proper initialization of federated modules.