Skip to main content

@fluidframework/container-loader Package

Interfaces

InterfaceAlertsModifiersDescription
ContainerAlphaLegacysealedIContainer interface that includes experimental features still under development.
IBaseProtocolHandlerLegacy
ICodeDetailsLoaderDeprecated, Legacy
ICreateAndLoadContainerPropsLegacyProperties necessary for creating and loading a container.
ICreateDetachedContainerPropsLegacyProps used to create a detached container.
IFluidModuleWithDetailsDeprecated, Legacy
ILoaderPropsLegacyServices and properties necessary for creating a loader
ILoaderServicesLegacyServices and properties used by and exposed by the loader
ILoadExistingContainerPropsLegacyProps used to load a container.
ILoadFrozenContainerFromPendingStatePropsLegacyProperties required to load a frozen container from pending state.
IParsedUrlLegacyInterface to represent the parsed parts of IResolvedUrl.url to help in getting info about different parts of the url. May not be compatible or relevant for any Url Resolver
IProtocolHandlerLegacy
IQuorumSnapshotLegacySnapshot format for a Quorum
IRehydrateDetachedContainerPropsLegacyProps used to rehydrate a detached container.
IScribeProtocolStateLegacy
OnDemandSummaryResultsLegacyResults from an on-demand summary request.

Classes

ClassAlertsDescription
LoaderLegacyManages Fluid resource loading
PendingLocalStateStoreLegacyA Map-like store for managing pending local container states from attached containers. Optimizes storage by deduplicating shared resources across stored states.

Enumerations

EnumDescription
ConnectionStateThe state of the Container's connection to the service.

Types

TypeAliasAlertsDescription
ILoadSummarizerContainerPropsLegacyProps used to load summarizer container.
LoadSummarizerSummaryResultLegacyOutcome from loadSummarizerContainerAndMakeSummary(loadSummarizerContainerProps).
ProtocolHandlerBuilderLegacyFunction to be used for creating a protocol handler.
QuorumClientsSnapshotLegacySnapshot format for a QuorumClients
QuorumProposalsSnapshotLegacySnapshot format for a QuorumProposals
SummaryStageLegacy

Stages of summary process.

Stages:

  1. "base" - stopped before the summary tree was even generated, and the result only contains the base data
  1. "generate" - the summary tree was generated, and the result will contain that tree + stats
  1. "upload" - the summary was uploaded to storage, and the result contains the server-provided handle
  1. "submit" - the summarize op was submitted, and the result contains the op client sequence number.

Functions

FunctionAlertsReturn TypeDescription
asLegacyAlpha(base)LegacyContainerAlphaConverts types to their alpha counterparts to expose alpha functionality.
createDetachedContainer(createDetachedContainerProps)LegacyPromise<IContainer>Creates a new container using the specified code details but in an unattached state. While unattached, all updates will only be local until the user explicitly attaches the container to a service provider.
createFrozenDocumentServiceFactory(factory)LegacyIDocumentServiceFactoryCreation of a FrozenDocumentServiceFactory which wraps an existing DocumentServiceFactory to provide a storage-only document service.
loadExistingContainer(loadExistingContainerProps)LegacyPromise<IContainer>Loads a container with an existing snapshot from the service.
loadFrozenContainerFromPendingState(props)LegacyPromise<IContainer>Loads a frozen container from pending local state.
loadSummarizerContainerAndMakeSummary(loadSummarizerContainerProps)LegacyPromise<LoadSummarizerSummaryResult>Loads a summarizer container with the required headers, triggers an on-demand summary, and then closes it. Returns success/failure and an optional error for host-side handling.
rehydrateDetachedContainer(rehydrateDetachedContainerProps)LegacyPromise<IContainer>Creates a new container using the specified snapshot but in an unattached state. While unattached, all updates will only be local until the user explicitly attaches the container to a service provider.
resolveWithLocationRedirectionHandling(api, request, urlResolver, logger)LegacyPromise<T>Handles location redirection while fulfilling the loader request.
tryParseCompatibleResolvedUrl(url)LegacyIParsedUrl | undefinedUtility api to parse the IResolvedUrl.url into specific parts like querystring, path to get deep link info etc. Warning - This function may not be compatible with any Url Resolver's resolved url. It works with urls of type: protocol:///.../..?
waitContainerToCatchUp(container)LegacyPromise<boolean>

Waits until container connects to delta storage and gets up-to-date.

Useful when resolving URIs and hitting 404, due to container being loaded from (stale) snapshot and not being up to date. Host may chose to wait in such case and retry resolving URI.

Warning: Will wait infinitely for connection to establish if there is no connection. May result in deadlock if Container.disconnect() is called and never followed by a call to Container.connect().

Function Details

asLegacyAlpha

Converts types to their alpha counterparts to expose alpha functionality.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/container-loader/legacy.

For more information about our API support guarantees, see here.

Signature

export declare function asLegacyAlpha(base: IContainer): ContainerAlpha;

Parameters

ParameterTypeDescription
baseIContainer

Returns

Return type: ContainerAlpha

createDetachedContainer

Creates a new container using the specified code details but in an unattached state. While unattached, all updates will only be local until the user explicitly attaches the container to a service provider.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/container-loader/legacy.

For more information about our API support guarantees, see here.

Signature

export declare function createDetachedContainer(createDetachedContainerProps: ICreateDetachedContainerProps): Promise<IContainer>;

Parameters

ParameterTypeDescription
createDetachedContainerPropsICreateDetachedContainerPropsServices and properties necessary for creating detached container.

Returns

Return type: Promise<IContainer>

createFrozenDocumentServiceFactory

Creation of a FrozenDocumentServiceFactory which wraps an existing DocumentServiceFactory to provide a storage-only document service.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/container-loader/legacy.

For more information about our API support guarantees, see here.

Signature

export declare function createFrozenDocumentServiceFactory(factory?: IDocumentServiceFactory | Promise<IDocumentServiceFactory>): IDocumentServiceFactory;

Parameters

ParameterModifiersTypeDescription
factoryoptionalIDocumentServiceFactory | Promise<IDocumentServiceFactory>

Returns

A FrozenDocumentServiceFactory

Return type: IDocumentServiceFactory

loadExistingContainer

Loads a container with an existing snapshot from the service.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/container-loader/legacy.

For more information about our API support guarantees, see here.

Signature

export declare function loadExistingContainer(loadExistingContainerProps: ILoadExistingContainerProps): Promise<IContainer>;

Parameters

ParameterTypeDescription
loadExistingContainerPropsILoadExistingContainerPropsServices and properties necessary for loading an existing container.

Returns

Return type: Promise<IContainer>

loadFrozenContainerFromPendingState

Loads a frozen container from pending local state.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/container-loader/legacy.

For more information about our API support guarantees, see here.

Signature

export declare function loadFrozenContainerFromPendingState(props: ILoadFrozenContainerFromPendingStateProps): Promise<IContainer>;

Parameters

ParameterTypeDescription
propsILoadFrozenContainerFromPendingStatePropsProperties required to load a frozen container from pending state.

Returns

Return type: Promise<IContainer>

loadSummarizerContainerAndMakeSummary

Loads a summarizer container with the required headers, triggers an on-demand summary, and then closes it. Returns success/failure and an optional error for host-side handling.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/container-loader/legacy.

For more information about our API support guarantees, see here.

Signature

export declare function loadSummarizerContainerAndMakeSummary(loadSummarizerContainerProps: ILoadSummarizerContainerProps): Promise<LoadSummarizerSummaryResult>;

Parameters

ParameterTypeDescription
loadSummarizerContainerPropsILoadSummarizerContainerProps

Returns

Return type: Promise<LoadSummarizerSummaryResult>

rehydrateDetachedContainer

Creates a new container using the specified snapshot but in an unattached state. While unattached, all updates will only be local until the user explicitly attaches the container to a service provider.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/container-loader/legacy.

For more information about our API support guarantees, see here.

Signature

export declare function rehydrateDetachedContainer(rehydrateDetachedContainerProps: IRehydrateDetachedContainerProps): Promise<IContainer>;

Parameters

ParameterTypeDescription
rehydrateDetachedContainerPropsIRehydrateDetachedContainerPropsServices and properties necessary for rehydrating detached container from a previously serialized container's state.

Returns

Return type: Promise<IContainer>

resolveWithLocationRedirectionHandling

Handles location redirection while fulfilling the loader request.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/container-loader/legacy.

For more information about our API support guarantees, see here.

Signature

export declare function resolveWithLocationRedirectionHandling<T>(api: (request: IRequest) => Promise<T>, request: IRequest, urlResolver: IUrlResolver, logger?: ITelemetryBaseLogger): Promise<T>;
Type Parameters
ParameterDescription
T

Parameters

ParameterModifiersTypeDescription
api(request: IRequest) => Promise<T>Callback in which user can wrap the loader.resolve or loader.request call.
requestIRequestrequest to be resolved.
urlResolverIUrlResolverresolver used to resolve the url.
loggeroptionalITelemetryBaseLoggerlogger to send events.

Returns

Response from the API call.

Return type: Promise<T>

tryParseCompatibleResolvedUrl

Utility api to parse the IResolvedUrl.url into specific parts like querystring, path to get deep link info etc. Warning - This function may not be compatible with any Url Resolver's resolved url. It works with urls of type: protocol:///.../..?

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/container-loader/legacy.

For more information about our API support guarantees, see here.

Signature

export declare function tryParseCompatibleResolvedUrl(url: string): IParsedUrl | undefined;

Parameters

ParameterTypeDescription
urlstringThis is the IResolvedUrl.url part of the resolved url.

Returns

The IParsedUrl representing the input URL, or undefined if the format was not supported

Return type: IParsedUrl | undefined

waitContainerToCatchUp

Waits until container connects to delta storage and gets up-to-date.

Useful when resolving URIs and hitting 404, due to container being loaded from (stale) snapshot and not being up to date. Host may chose to wait in such case and retry resolving URI.

Warning: Will wait infinitely for connection to establish if there is no connection. May result in deadlock if Container.disconnect() is called and never followed by a call to Container.connect().

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/container-loader/legacy.

For more information about our API support guarantees, see here.

Signature

export declare function waitContainerToCatchUp(container: IContainer): Promise<boolean>;

Parameters

ParameterTypeDescription
containerIContainer

Returns

true: container is up to date, it processed all the ops that were know at the time of first connection.

false: storage does not provide indication of how far the client is. Container processed all the ops known to it, but it maybe still behind.

Return type: Promise<boolean>

Error Handling

an error beginning with "Container closed" if the container is closed before it catches up.