Skip to main content

Module federation_runtime

Module federation_runtime 

Source
Expand description

Module Federation runtime calls: registerRemotes, loadRemote, init and createInstance.

The Federation runtime can register a remote container and load a module from it at run time, with no static config to read. This pass reads a call only when its argument is a static literal, the same rule the config readers use. A call with any other argument is recorded with no remote, so the analysis can say that part of the file was not read. init and createInstance declare remotes under the remotes key of their options, in the same form as the registerRemotes argument. The loadRemote and registerRemotes methods of the instance they return are read too.

A call counts only when the file imports the function from a Federation runtime package, by name or through a namespace import. A same-named local function registers nothing. In a Vue or Svelte file, the <script> blocks are read together, so an import in one block covers a call in another.

Functionsยง

extract_federation_runtime_facts
Read the Federation runtime calls of a JavaScript, TypeScript, Vue or Svelte file.