Understanding Native Federation
A common misconception is that Native Federation is compatible with Module Federation. Unfortunately, these technologies are incompatible with each other and would require an orchestrator library such as Picard to work together. Nevertheless, what remains the same is the mental model. Just like in Module Federation, the host-remote philosophy is also present in Native Federation.
The Native Federation package only contains lower-level functions. This allows framework authors to use these building blocks for actually constructing useful abstractions on top of it. One example is the way to actually load a shared module. Since there is no direct bundler integration, no direct imports are possible. Through the loadRemoteModule
function, we can retrieve the module using the same notation as Module Federation, that is, by referring to the name of a remote and the path to the requested exposed module.
Let’s look at an example code for loading and...