FynMesh API
    Preparing search index...

    Interface FynMeshKernel

    FynMesh client side library types

    interface FynMeshKernel {
        events: FynAppEventTarget;
        shareScopeName: string;
        version: string;
        bootstrapFynApp(fynApp: FynApp): Promise<void>;
        emitAsync(event: CustomEvent): Promise<boolean>;
        getFynAppState(name: string): FynAppState | undefined;
        initRunTime(data: FynMeshRuntimeData): FynMeshRuntimeData;
        listFynAppStates(): FynAppState[];
        loadFynApp(baseUrl: string, loadId?: string): Promise<FynApp | null>;
        loadFynAppBasics(fynAppEntry: FynAppEntry): Promise<FynApp>;
        loadFynAppsByName(
            requests: { name: string; range?: string }[],
            options?: LoadFynAppsOptions,
        ): Promise<void>;
        resumeFynApp(name: string): Promise<boolean>;
        setRegistryResolver(resolver: RegistryResolver): void;
        shutdownFynApp(name: string): Promise<boolean>;
        suspendFynApp(name: string): Promise<boolean>;
        use(addon: KernelAddon): void;
    }
    Index

    emitter of kernel events

    shareScopeName: string

    federation module share scope name

    version: string

    kernel version

    • Bootstrap a fynapp

      Parameters

      • fynApp: FynApp

        fynapp to bootstrap

      Returns Promise<void>

    • Send an event to the kernel

      Parameters

      • event: CustomEvent

        event to send

      Returns Promise<boolean>

    • Get the current lifecycle state of a FynApp (mount tracking).

      Parameters

      • name: string

        "name" or "name@version"; a bare name resolves to the most recently updated version when several are tracked

      Returns FynAppState | undefined

      the lifecycle state, or undefined if the FynApp is not tracked

    • List the lifecycle state of every tracked FynApp (bootstrapping, mounted, suspended, or failed).

      Returns FynAppState[]

    • Load and bootstrap a single remote FynApp.

      Error contract (error isolation):

      • Resolves to the loaded FynApp on success.
      • Resolves to null when the per-app load/bootstrap fails (the remote entry fails to import, loadFynAppBasics rejects, or bootstrap throws). Failures are isolated so one bad FynApp does not abort callers loading others; the failure is logged and captured via tel (fynapp.load_failed). Note bootstrapFynApp additionally isolates its own errors internally (emitting FYNAPP_BOOTSTRAP_FAILED).
      • Rejects (throws) only for environment/precondition errors that make loading impossible regardless of the FynApp — e.g. the browser kernel throws when the Federation.js runtime is absent. The Node kernel has no such precondition and never throws from this method.

      Parameters

      • baseUrl: string

        base URL to the fynapp assets

      • OptionalloadId: string

        id for the load task

      Returns Promise<FynApp | null>

      the loaded FynApp, or null if the per-app load failed

    • Load the basics of a fynapp federation entry into a FynApp object

      • This only does loading, no execution of anything occurs here Basics are:
      • Initialize the entry
      • Load config
      • Load main module
        • Load middlewares from main module

      Parameters

      Returns Promise<FynApp>

      fynapp object

    • Load one or more FynApps by name/range using manifests and a dependency graph.

      Error contract:

      • Rejects (throws) on structural/configuration errors that prevent the batch from being planned — e.g. no registry resolver configured, or a dependency graph that cannot be built/resolved.
      • Isolates per-app failures: each FynApp is loaded via loadFynApp, whose null result (a failed individual load) does not abort the batch. The call resolves once every reachable FynApp has been attempted.

      Progress events, so a host can show what a load is waiting on:

      • FYNAPP_LOADING once per FynApp the batch will load, as soon as the dependency graph is known. Apps already loaded get no events.
      • FYNAPP_LOADED when that FynApp's load attempt ends. ok is false if it failed. Both carry a FynAppLoadEventDetail. requestedBy names this call's requests, so a host can tell its own load apart from a concurrent one.

      Parameters

      • requests: { name: string; range?: string }[]

        FynApps to load, by name and optional semver range

      • Optionaloptions: LoadFynAppsOptions

        batch options (concurrency, preload strategy)

      Returns Promise<void>

    • Resume a suspended FynApp: calls resume() on each of its FynUnits, marks it mounted, and emits FYNAPP_RESUMED. Only a suspended app can be resumed.

      Parameters

      • name: string

        "name" or "name@version"

      Returns Promise<boolean>

      true if the app was resumed, false if not found or not suspended

    • Set a resolver that maps {name, range} to a concrete manifest URL (and optional dist base)

      Parameters

      Returns void

    • Shutdown a FynApp - calls shutdown() on its FynUnits and removes from registry

      Parameters

      • name: string

        name of the FynApp to shutdown

      Returns Promise<boolean>

      true if FynApp was found and shutdown, false otherwise

    • Suspend a mounted FynApp: calls suspend() on each of its FynUnits, marks it suspended, and emits FYNAPP_SUSPENDED. Only a mounted app can be suspended. The kernel does not touch the DOM — each FynUnit decides what to pause.

      Parameters

      • name: string

        "name" or "name@version"

      Returns Promise<boolean>

      true if the app was suspended, false if not found or not mounted

    • Install an add-on. Installing a name that is already installed is a no-op.

      Parameters

      Returns void