New KOBI documentation is available: https://adeo-ccdp.gitbook.io/kobi/

Fragment processing is done when displaying a Page or a Page Model from Shaper Web. It is a main fonctionnality, agregating result of several micro front-ends into one HTML page.

If the proxy response from an backend contains X-Kobi-Discover-Fragments header with value true,
Gluer will identify components from the response and make parallel calls to micro front-ends and agregate results in on HTML page.

Frament processing step can be done into Application processing step to embed a standalone application in pre-designed Page Model.

Part detection

Gluer will parse the backend response looking for KOBI instructions like

  • <kobi:fragment ... />
  • <kobi:application ... />
  • <kobi:container ... />

A backend response is sliced into several ‘parts’, like ‘Text’ part, ‘Fragment’ part, ‘Application’ part, ‘Head’ part (for headers), …

Part resolution

Gluer will resolve all of those parts in asynchronous process to a list of ‘chunks’. A ‘chunk’ is an element ready to be writen to the client response.

  • Resolving a ‘Fragment’ part consist of invoking the micro front-end owning this component.
  • Resolving a ‘Text’ part consist of doing nothing as a ‘Text’ part is already a ‘chunk’.
  • Resolving an ‘Application’ consist of getting content from previouly called application.

Gluer will continuously deliver all the ‘chunks’ to the client in the same order as it was in the backend response until the last one.

Chunk rewriting

Just before delivering a ‘chunk’, Gluer will rewrite content and resolve URL in asynchronous process just like Rewrite processing.

Kinematic

Primary Fragments

Primary fragments are fragments that are necessary for the page to render, meaning that if the application takes to much time to respond (timeout) or returns an error, Gluer will render an error 500 page. Whereas a non primary fragment will just be ignored in the final rendering.

This imply that Gluer has to wait for all primary fragments before starting to send the response to the client.

An other usage of Primary Fragment is when you want to send cookies to the client from a component, in this case Gluer must wait for fragment resolution before sending headers with cookies to the client.

Component in fragments

A micro front-end can declare a placeholder in Fragment for a new Fragment or a new Container. With KOBI Designer, it is possible to configure those components and Gluer will be able to merge all of the components into one HTML page.

See Layout > component in fragment