Skip to content

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.

PropertyDescription
[key]Name of the micro frontend
[value]The micro frontend definition
def.urlLink to the remote entry manifest
def.extras.idThe global name of the remote
def.extras.metaDataThe metaData section of the remote entry manifest
def.extras.exposesThe exposes section of the remote entry manifest
def.extras.remotesThe remotes section of the remote entry manifest
def.extras.sharedThe shared section of the remote entry manifest
def.extras.runtimeThe MF runtime version (e.g., 1.0 or 2.0)
def.extras.typeThe 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.

PropertyDescription
[key]Name of the micro frontend
[value]The micro frontend definition
def.urlLink to the remote entry JSON
def.extras.exposesThe exposes section of the remote entry JSON
def.extras.dependenciesThe 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.

PropertyDescription
[key]Name of the micro frontend
[value]The micro frontend definition
def.urlLink to the entry module
def.extras.dependenciesThe dependencies section of pilet
def.extras.configThe config section of the pilet
def.extras.pilet.specThe spec section of the pilet
def.versionThe version of the pilet
def.integrityThe 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!

Released under the MIT License.