
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@coderebus/microapp-loader
Advanced tools
A npm package that helps load micro-frontends dynamically within a host/container app at runtime
Micro Front-end Loader (or MFE Loader) is a powerful utility that simplifies the process of loading remote apps or modules dynamically within a host/container app at runtime using Webpack 5's Module Federation. It also provides a lot of control and flexibility to the developers with its configurable options.
0 dependencies.remoteUrl.lazy and Suspense components. A static SkeletonLoader component is used as a fallback while the module is being loaded. You can also provide your own custom fallback component.NOTE:
- No need to wrap the components in an asynchronous boundary (like creating a bootstrap.js file) to load remote modules as MFE Loader will handle that for you.
- If you want to import remotes statically (not recommended), then you might need an asynchronous boundary.
- No need to configure the remotes in the Webpack configuration file of your host/container app (i.e. no need to define
remotesin host module federation config).
Install the package using npm install @coderebus/microapp-loader or yarn add @coderebus/microapp-loader.
Import FederatedComponent and RemoteModuleProps from the package where you want to load any exposed module.
import {
FederatedComponent,
RemoteModuleProps,
} from "@coderebus/microapp-loader";
Create an object that will contain the information of the remote module to be loaded and then, provide it to the FederatedComponent as a prop.
const config: RemoteModuleProps = {
scope: "remote_app1",
module: "Header",
url: `http://localhost:3000/remoteEntry.js`, // manually add the url of the remoteEntry.js file
};
<FederatedComponent {...config} />
| Prop | Required | Type | Description |
|---|---|---|---|
| scope | Y | string | The scope of the remote app. |
| module | Y | string | The name of the module to be loaded. |
| url | Y | string | The URL of the remoteEntry.js file of the remote app. |
| suspenseFallback | N | () => JSX.Element or ReactNode | The fallback component to be rendered while the module is being loaded. |
| errorFallback | N | () =>JSX.Element or ReactNode | The fallback component to be rendered if there is an error while rendering the module. |
| ErrorBoundary | N | ComponentType<any> | A custom Error Boundary component to be used instead of the default one. |
import React, { useState } from "react";
import {
FederatedComponent,
RemoteModuleProps,
} from "@coderebus/microapp-loader";
import { Button, Loader } from "my-ui-lib"; // change the import accordingly
const ErrorFallback = <div>Something went wrong!</div>;
const config: RemoteModuleProps = {
scope: "remote_app1",
module: "Header",
url: `http://localhost:3000/remoteEntry.js`,
suspenseFallback: Loader, // optional but recommended
errorFallback: ErrorFallback, // optional
};
const App = () => {
const [load, setLoad] = useState(false);
return (
<div>
<Button onClick={() => setLoad(true)}>Load Component</Button>
{load && <FederatedComponent {...config} />}
</div>
);
};
FEW POINTS TO NOTE:
- If you want to create and use your own custom Error Boundary component, then make sure to include
ErrorBoundaryin the config object.- You do not have to provide
errorFallbackif you are using your own custom Error Boundary component.- I would recommend using the react-error-boundary package to create your own custom Error Boundary component. Also, use this amazing blog by Kent C. Dodds as a reference.
FAQs
A npm package that helps load micro-frontends dynamically within a host/container app at runtime
We found that @coderebus/microapp-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.