Skip to main content

@fluidframework/container-loader Package

Interfaces

Interface Alerts Description
IBaseProtocolHandler Legacy
ICodeDetailsLoader Deprecated, Legacy
ICreateAndLoadContainerProps Legacy Properties necessary for creating and loading a container.
ICreateDetachedContainerProps Legacy Props used to create a detached container.
IFluidModuleWithDetails Deprecated, Legacy
ILoaderOptions Deprecated, Legacy
ILoaderProps Legacy Services and properties necessary for creating a loader
ILoaderServices Legacy Services and properties used by and exposed by the loader
ILoadExistingContainerProps Legacy Props used to load a container.
IParsedUrl Legacy Interface 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
IProtocolHandler Legacy
IQuorumSnapshot Legacy Snapshot format for a Quorum
IRehydrateDetachedContainerProps Legacy Props used to rehydrate a detached container.
IScribeProtocolState Legacy

Classes

Class Alerts Description
Loader Legacy Manages Fluid resource loading

Enumerations

Enum Description
ConnectionState The state of the Container's connection to the service.

Types

TypeAlias Alerts Description
IDetachedBlobStorage Deprecated, Legacy Subset of IDocumentStorageService which only supports createBlob() and readBlob(). This is used to support blobs in detached containers.
ProtocolHandlerBuilder Legacy Function to be used for creating a protocol handler.
QuorumClientsSnapshot Legacy Snapshot format for a QuorumClients
QuorumProposalsSnapshot Legacy Snapshot format for a QuorumProposals

Functions

Function Alerts Return Type Description
createDetachedContainer(createDetachedContainerProps) Legacy Promise<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.
loadExistingContainer(loadExistingContainerProps) Legacy Promise<IContainer> Loads a container with an existing snapshot from the service.
rehydrateDetachedContainer(rehydrateDetachedContainerProps) Legacy Promise<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) Legacy Promise<T> Handles location redirection while fulfilling the loader request.
tryParseCompatibleResolvedUrl(url) Legacy IParsedUrl | undefined 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:///.../..?
waitContainerToCatchUp(container) Legacy Promise<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

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

Parameter Type Description
createDetachedContainerProps ICreateDetachedContainerProps Services and properties necessary for creating detached container.

Returns

Return type: Promise<IContainer>

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

Parameter Type Description
loadExistingContainerProps ILoadExistingContainerProps Services and properties necessary for loading an existing container.

Returns

Return type: Promise<IContainer>

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

Parameter Type Description
rehydrateDetachedContainerProps IRehydrateDetachedContainerProps Services 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
Parameter Description
T

Parameters

Parameter Modifiers Type Description
api (request: IRequest) => Promise<T> Callback in which user can wrap the loader.resolve or loader.request call.
request IRequest request to be resolved.
urlResolver IUrlResolver resolver used to resolve the url.
logger optional ITelemetryBaseLogger logger 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

Parameter Type Description
url string This 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

Parameter Type Description
container IContainer

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.