one-spa-inferno
one-spa-inferno is a helper library that helps implement one-spa registered application lifecycle functions (bootstrap, mount and unmount) for for use with Inferno. Check out the one-spa-inferno github.
Quickstart
First, in the application, run npm install --save one-spa-inferno. Then, add the following to your application's entry file.
import Inferno from "inferno";
import rootComponent from "./path-to-root-component.js";
import oneSpaInferno from "one-spa-inferno";
const infernoLifecycles = oneSpaInferno({
Inferno,
createElement,
rootComponent,
domElementGetter: () => document.getElementById("main-content"),
});
export const bootstrap = infernoLifecyles.bootstrap;
export const mount = infernoLifecyles.mount;
export const unmount = infernoLifecyles.unmount;
Options
All options are passed to one-spa-inferno via the opts parameter when calling oneSpaInferno(opts). The following options are available:
inferno: (required) The main Inferno object, which is generally either exposed onto the window or is available viarequire('inferno')orimport Inferno from 'inferno'.createElement: (required) The default export from Inferno'sinferno-create-elementpackage.rootComponent: (required) The top level Inferno component which will be rendered.domElementGetter: (required) A function that takes in no arguments and returns a DOMElement. This dom element is where the Inferno application will be bootstrapped, mounted, and unmounted.