microsoft / microsoft/FluidFramework
Removal of `Loader` class
@MarioJGMsoft is already working on this.
Since Apr 24, 2025.
- 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:
createDetachedContainerrehydrateDetachedContainerFromSnapshotresolve
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.