• Public
  • Public/Protected
  • All

The Async SSR Manager enables the integrator to render a given composition of React Feature Apps in multiple render passes until all Feature Apps and Feature Services have finished their asynchronous operations.

The integrator should provide the Async SSR Manager only on the server.

Feature Apps and Feature Services should declare the Async SSR Manager as an optional dependency. Its presence can be used to determine whether they are currently rendered on the server or on the client.


  • AsyncSsrManagerV1




  • renderUntilCompleted(render: () => string): Promise<string>
  • This method is intended for the integrator. It calls the given render function at least once. With scheduleRerender further render passes can be triggered. It resolves with the result of the last render call.


    Throws an error when the configured timeout is reached (see [[AsyncSsrManagerConfig.timeout]]).


    • render: () => string

      A render function that is called for each render pass.

        • (): string
        • Returns string

    Returns Promise<string>


  • scheduleRerender(asyncOperation?: Promise<unknown>): void
  • This method is intended for consumers, i.e. Feature Apps and Feature Services. It schedules a rerender with an optional promise representing an asynchronous operation. The method must be called synchronously during a render pass, or while already scheduled asynchronous operations are running.

    If no asynchronous operation is running, the method must be called synchronously during a render pass. This means that the following will not work:

    const data = await fetch('example.com').then(res => res.json());
    // the rerender scheduled in the next line is not taken into account

    Instead, the rerender should be scheduled before awaiting the asynchronous operation:

    const dataPromise = fetch('example.com').then(res => res.json());
    const data = await dataPromise;

    Calling it while already scheduled asynchronous operations are running, does not lead to multiple render passes, but instead the already scheduled rerender is deferred until every registered asynchronous operation has finished.


    • Optional asyncOperation: Promise<unknown>

      A promise representing an asynchronous operation that shall defer the scheduled rerender at least until after its completion.

    Returns void


  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Type alias with type parameter
  • Interface
  • Interface with type parameter
  • Method
  • Class
  • Class with type parameter

Generated using TypeDoc