Integrating SPA micro frontends
As we’ve seen in the case of single-spa
, a so-called root config is used to centrally declare the micro frontends – at least their name, activation function, and loader function. In other approaches, we follow a similar concept, usually keeping some information about the different micro frontends in a central location – which is usually in the SPA shell – while being able to use independent deployment pipelines for the micro frontends in general.
This still leaves us with two problems: how do we declare the lifecycle, and how do we now use these cross-framework components? Let’s explore both, starting with lifecycle declaration.
Declaring the lifecycle
We’ve already touched on the lifecycle of the components exported by a SPA micro frontend briefly. In single-spa
, this boils down to four different functions:
- The
bootstrap
function is used to set the environment up and load the application itself...