@fluidframework/container-loader Package

Packages > @fluidframework/container-loader

Interfaces

Interface Alerts Description
IBaseProtocolHandler Legacy, Alpha
ICodeDetailsLoader Deprecated, Legacy, Alpha
IFluidModuleWithDetails Deprecated, Legacy, Alpha
ILoaderOptions Deprecated, Legacy, Alpha
ILoaderProps Legacy, Alpha Services and properties necessary for creating a loader
ILoaderServices Legacy, Alpha Services and properties used by and exposed by the loader
IParsedUrl Legacy, Alpha 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, Alpha
IQuorumSnapshot Legacy, Alpha Snapshot format for a Quorum
IScribeProtocolState Legacy, Alpha

Classes

Class Alerts Description
Loader Legacy, Alpha 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, Alpha Subset of IDocumentStorageService which only supports createBlob() and readBlob(). This is used to support blobs in detached containers.
ProtocolHandlerBuilder Legacy, Alpha Function to be used for creating a protocol handler.
QuorumClientsSnapshot Legacy, Alpha Snapshot format for a QuorumClients
QuorumProposalsSnapshot Legacy, Alpha Snapshot format for a QuorumProposals

Functions

Function Alerts Return Type Description
resolveWithLocationRedirectionHandling(api, request, urlResolver, logger) Legacy, Alpha Promise<T> Handles location redirection while fulfilling the loader request.
tryParseCompatibleResolvedUrl(url) Legacy, Alpha 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, Alpha 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

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.