remove import bootstrap from apps that can support it #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here a few updates what happened on the dev-1 branch:
Overridables (shared) to no longer require wrapping in import(). So no unneccessary import("./bootstrap") in your app code because of container-related plugins. (Note: remote modules still require import(), that won't change.)
Persistent caching with container-related plugins is now possible.
Container-related plugins are now exposed under require("webpack").container.XXXPlugin and have typings
ModuleFederationPlugin doesn't create a container when no exposes are specified
Improved schema validation
after testing this out, it's important to note that if you consume
exposes
inside a remote app, you will need to use a dynamic import somewhere, perhaps not on the root of the app @sokra ?with
and a webapck config that has this.
Will require you to either use
import(bootstrap.js)
in the REMOTE's entrypoint in order for it to work.OR
you can dynamically import the file itself. Either way, you need a dynamic import on the remote in the execution chain - a promise must exist somewhere to hoist imports up.
import(bootstrap.js)
will allow you to do thisimport LocalButton from "./Button";
Otherwise, if you don't want to have a dynamic import in entrypoint, you can use it like this
const LocalButton = React.lazy(()=>import('./Button'));