or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-9/

Micro App Lifecycle Bridge

Entry module that exposes a child micro-frontend's lifecycle so host containers can mount and unmount it cleanly.

Capabilities

Exposes lifecycle to host

  • Default export is an object with mount and unmount functions that hosts can call to render or tear down the app. @test

Renders into provided container

  • When mount receives a container, the app renders inside it and unmount removes the rendered tree without leaving stray nodes. @test

Passes custom props to the app

  • customProps provided to mount flow into the rendered tree via context so the app can read them. @test

Gracefully runs standalone

  • Running outside a host automatically mounts into a default #ice-container (creating it if absent) and avoids double-mounting on repeated executions. @test

Implementation

@generates

API

export interface RenderOptions {
  container?: Element;
  customProps?: Record<string, unknown>;
}

export interface ChildAppConfig {
  mount(options?: RenderOptions): Promise<void> | void;
  unmount(options?: RenderOptions): Promise<void> | void;
}

declare const config: ChildAppConfig;

export default config;

Dependencies { .dependencies }

@ice/plugin-icestark { .dependency }

Micro-frontend plugin that supplies helpers to expose child lifecycle hooks to host frameworks.