Discovery Schema
Discovery service responses following the MFWG schema specification are directly supported.
TIP
Follow the JSON schema defined in the linked GitHub repository for making your own discovery service compatible with Picard.
Schema Description
The returned response has either to be an object with a property named microFrontends
, which is an object again - consisting of a mapping of names of micro frontends to their different definitions (i.e., one or more definitions per version).
Mapping of Properties
Module Federation
To be recognized as a micro frontend using Module Federation the entry needs to have a section modulefederation
placed on extras
of the definition. Alternatively, if the URL ends with .js
and no other type has been recognized Picard.js will fall back to Module Federation.
Property | Description |
---|---|
[key] | Name of the micro frontend |
[value] | The micro frontend definition |
def.url | Link to the remote entry manifest |
def.extras.id | The global name of the remote |
def.extras.metaData | The metaData section of the remote entry manifest |
def.extras.exposes | The exposes section of the remote entry manifest |
def.extras.remotes | The remotes section of the remote entry manifest |
def.extras.shared | The shared section of the remote entry manifest |
def.extras.runtime | The MF runtime version (e.g., 1.0 or 2.0 ) |
def.extras.type | The type (esm / module or var / global ) |
WARNING
It is crucial that the right runtime version of Module Federation is transported. While a missing runtime
value could still be inferred correctly, an incorrect one will almost certainly lead to a wrong interpretation of the micro frontend.
Native Federation
To be recognized as a micro frontend using Native Federation the entry needs to have a section nativefederation
placed on extras
of the definition.
Property | Description |
---|---|
[key] | Name of the micro frontend |
[value] | The micro frontend definition |
def.url | Link to the remote entry JSON |
def.extras.exposes | The exposes section of the remote entry JSON |
def.extras.dependencies | The dependencies section of the remote entry JSON |
Pilets
To be recognized as a micro frontend using Piral (i.e., a pilet) the entry needs to have a section pilet
placed on extras
of the definition.
Property | Description |
---|---|
[key] | Name of the micro frontend |
[value] | The micro frontend definition |
def.url | Link to the entry module |
def.extras.dependencies | The dependencies section of pilet |
def.extras.config | The config section of the pilet |
def.extras.pilet.spec | The spec section of the pilet |
def.version | The version of the pilet |
def.integrity | The integrity section of the pilet |
Anything Else
This is not supported (right now).
All values in the discovery schema are interepreted as one of the previously three mentioned formats. If you know another format that can be / is transported commonly then let us know!