Creating a composition layout
As already mentioned, server-side composition always uses a gateway service to merge the different micro frontends. Even though this will be a reverse proxy in most cases, usually this does a bit more than just proxying the response. Actually, the reverse proxy part is just one aspect of it. The more important one is the layout.
In the following sections, we'll look at its responsibilities and some techniques to include fragments including SSI, ESI, and JS template strings. We'll start with its responsibilities.
Understanding layout responsibilities
A layout is responsible for structuring a page. It determines where all the individual fragments from the different micro frontends should be placed. There are two kinds of layouts:
- Generic layouts
- Specific layouts
A generic layout is determined by the gateway service. This could either be hardcoded or resolved by some logic, for example, from another service or database...