Packages
The Fluid Framework is a multi-layered system consisting of dozens of individual npm packages. Most developers will only need two or three of these packages for typical Fluid development:
- The fluid-framework package, which contains the public API for the Fluid Framework
- A service-specific client package, such as the @fluidframework/azure-client.
Primary API: fluid-framework
The fluid-framework package consists primarily of two portions: the FluidContainer object and a selection of distributed data structures (DDSes).
FluidContainer
The FluidContainer object is one of the object types returned by calls to createContainer() and getContainer() on the service clients such as AzureClient.
It includes functionality to retrieve the Fluid data contained within itself, as well as to inspect the state of the collaboration session connection.
Distributed Data Structures (DDSes)
You'll use one or more DDSes in your container to model your collaborative data. The fluid-framework package includes a few such data structures that cover a broad range of scenarios:
-
SharedTree: a collaborative tree data structure for building complex, hierarchical data models.
tipThis is the DDS we recommend for most new applications.
-
SharedString: a data structure for collaborative text data.
tipThis DDS can be used when live, collaborative text editing is required.
SharedTreesupports text content, but does not yet support many rich collaborative text editing features.For scenarios where collaborative text editing is required, we recommend using
SharedStringwithSharedTreevia handles. -
SharedMap: a map-like data structure for storing key/value pair data.
warningWe do not recommend this DDS for new applications.
SharedTreeis a more powerful and flexible alternative that can easily model key/value pair data.
Package scopes
Fluid Framework packages are published under one of the following npm scopes:
- @fluidframework
- @fluid-experimental
- @fluid-internal
- @fluid-tools
In addition to the scoped packages, two unscoped packages are published: the fluid-framework package, described earlier, and the tinylicious package, which contains a minimal Fluid server.
For more information, see Tinylicious.
Unless you are contributing to the Fluid Framework, you should only need the unscoped packages and packages from the @fluidframework scope. You can read more about the scopes and their intent in the Fluid Framework wiki.