Skip to content

docs(website-new): add docs on __FEDERATION__ (#3624) #3625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions apps/website-new/docs/en/guide/start/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,49 @@ const App = () => {
export default App;
```

## Inspect and Debug your Configuration in the Browser

### \_\_FEDERATION\_\_
Module Federation initialization provides a global variable `window.__FEDERATION__`. This is useful to get an overview of available meta information about all detected Module Federation modules.
Besides helping out with debugging your system, this data is also useful for the creation of custom browser extensions or runtime analysis tools for your environment.

#### \_\_GLOBAL_PLUGIN\_\_
__Type:__ Array

__Description:__ List of all active RuntimePlugins.

#### \_\_INSTANCES\_\_
__Type:__ Array

__Description:__ List of information about all running runtimes. Index "0" is always the Host runtime.

#### \_\_MANIFEST_LOADING\_\_
__Type:__ Object

__Description:__ Object showing all loading manifest meta information about modules.

#### \_\_PRELOADED_MAP\_\_
__Type:__ Map

__Description:__ Map currently only instantiated, not used by any implementation.

#### \_\_SHARE_SCOPE_LOADING\_\_
__Type:__ Object

__Description:__ Object not used by any implementation.

#### \_\_SHARE\_\_
__Type:__ Object

__Description:__ Object collecting all shared dependencies running in the share-scope.

#### moduleInfo
__Type:__ Object

__Description:__ Object showing all manifest meta information about active modules.



## Summary

Through the above process, you have completed the export of a component from a 'provider' for use by a 'consumer' based on Module Federation. Along the way, you have preliminarily used and understood the configurations of remotes, exposes, and shared in the Module Federation plugin.
Expand Down