SubAppDef: SubAppOptions & {
    _features?: Record<string, SubAppFeature>;
    _frameworkFactory?: (() => unknown);
    _getExport?: (<T>() => SubApp<T>);
    _getModule: (() => Promise<any>);
    _id: number;
    _module: any;
    _pipelineFactory?: ((params) => SubAppRenderPipeline);
    _renderPipelines?: SubAppRenderPipeline[];
    _ssr: boolean;
    _mount?(info): void;
    _reload?(subAppName, modName?): Promise<any>;
    _start?(params, reload?): Promise<any>;
    _unmount?(info): void;
}

definition of a subapp from declareSubApp

To see example of implement and declare a subapp, see a framework specific SubApp implementation type, such as ReactSubApp.

Type declaration

  • Optional _features?: Record<string, SubAppFeature>

    Features this subapp wants

  • Optional _frameworkFactory?: (() => unknown)

    factory to return a framework object for the running env. it's unknown because we don't know what the env or the framework could be.

      • (): unknown
      • Returns unknown

  • Optional _getExport?: (<T>() => SubApp<T>)

    Get the export subapp object from the module

  • _getModule: (() => Promise<any>)

    handle loading the subapp's module

      • (): Promise<any>
      • Returns Promise<any>

  • _id: number

    Unique definition ID, if a subapp with same name is re-declared then it will have a diff _id

  • _module: any

    The module that implements the subapp

  • Optional _pipelineFactory?: ((params) => SubAppRenderPipeline)

    Create a render pipeline

    The respective env/framework specific implementation should set this accordingly

  • Optional _renderPipelines?: SubAppRenderPipeline[]

    Holds rendering pipeline instances for this subapp.

    This is only used on client side. On server side, there are multiple page rendering for multiple requests. We need to maintain and manage the pipelines for each request. So they are stored in their owning request object.

  • _ssr: boolean

    Indicate if this subapp involves being used in any server side rendering TODO: this is not the right place for this? Since different routes could be using the same subapp def but not for SSR.

  • _mount?:function
  • _reload?:function
    • Handles HMR on client side

      Parameters

      • subAppName: string
      • Optional modName: string

      Returns Promise<any>

  • _start?:function
    • SubApp's start method that declareSubApp will create, with versions for browser or node.js.

      • Browser: the browser subapp shell will call this from start.
      • Node.js: load-v2.ts in node dir will call this during SSR.

      Parameters

      Returns Promise<any>

  • _unmount?:function
    • For UI component instance to let the subapp know it's unmounting from the subapp

      Parameters

      Returns void