1.0.0 • Published 8 months ago

@nerolang/prometheus v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
8 months ago

@nerolang/prometheus

MicroFrontend

Install

pnpm add @nerolang/prometheus

How to use?

import { useAppShell } from '@nerolang/prometheus';

const appShell = useAppShell();
appShell.register({
    name: 'home',
    url: 'http://example.com',
    container: document.getElementById("container"),
    activeRule: '/home',
});

AppShell

type AppShell = {
    register: (app: MicroApp) => void;
    loadApp: (name: string) => void;
    use: (installer: (appShell: AppShell) => void) => void;
    push: (to: string) => void;
    back: () => void;
}

MicroApp

type MicroApp = {
    name: string;
    url: string;
    container: HTMLElement;
    activeRule: string;
    mode?: "default" | "shadow" | "strict";
}

CustomElement

<micro-app
    name="home"
    url="http://example.com"
    active-rule="/home"
></micro-app>
1.0.0

8 months ago