microsoft / microsoft/FluidFramework

Removal of `Loader` class

Open
#24,450 2 comments 0 reactions 1 assignee View on GitHub

@MarioJGMsoft is already working on this.

Since Apr 24, 2025.

breaking change
Dominant language
TypeScript
Stars
4.9k
Forks
586
Avg merge
1d 15h
Merged PRs (30d)
146

Description

The Loader class from the @fluidframework/container-loader package is deprecated and for internal use only.

Context

The Loader class doesn't do much and can easily be replaced with several free functions. This would be more maintainable than managing a class as classes bring additional maintenance burden.

Approach

The current functions that are available through the Loader class are:

  • createDetachedContainer
  • rehydrateDetachedContainerFromSnapshot
  • resolve

These 3 functions have been added as free-form functions in the @fluidframework/container-loaderpackage. Following are the new equivalent functions for each of the current ones:

Loader Class Function Free-form Function
loader.createDetachedContainer(
codeDetails: IFluidCodeDetails,
createDetachedProps?: { canReconnect?: boolean;
clientDetailsOverride?: IClientDetails; }): Promise<IContainer>
createDetachedContainer(
createDetachedContainerProps: ICreateDetachedContainerProps) : Promise<IContainer>
loader.rehydrateDetachedContainerFromSnapshot(
snapshot: string,
createDetachedProps?: {
canReconnect?: boolean;
clientDetailsOverride?: IClientDetails; }): Promise<IContainer>
rehydrateDetachedContainer(
rehydrateDetachedContainerProps: IRehydrateDetachedContainerProps): Promise<IContainer>
loader.resolve(
request: IRequest,
pendingLocalState?: string): Promise<IContainer>
loadExistingContainer(
loadExistingContainerProps: ILoadExistingContainerProps): Promise<IContainer>

It's important to note that the variables used when a Loader object is initialized are now going to be sent through the ...Props interfaces of the functions (See more about each interface: ICreateAndLoadContainerProps, ICreateDetachedContainerProps, IRehydrateDetachedContainerProps, ILoadExistingContainerProps).

Packages

@fluidframework/container-loader

Expected Timeline

To be removed in version 2.60 or later.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.