@fluidframework/aqueduct Package
Packages > @fluidframework/aqueduct
The aqueduct
package is a library for building Fluid objects and Fluid containers within the Fluid Framework. Its goal is to provide a thin base layer over the existing Fluid Framework interfaces that allows developers to get started quickly.
Remarks
About the package name: An Aqueduct is a way to transport water from a source to another location. The package name was chosen because its purpose is to facilitate using lower level constructs and therefore handle ‘fluid’ items same as an aqueduct.
Classes
Class | Description |
---|---|
BaseContainerRuntimeFactory | BaseContainerRuntimeFactory produces container runtimes with a given data store and service registry, as well as given request handlers. It can be subclassed to implement a first-time initialization procedure for the containers it creates. |
BaseContainerService | This class is a simple starter class for building a Container Service. It simply provides routing |
BlobHandle | This class represents blob (long string) This object is used only when creating (writing) new blob and serialization purposes. De-serialization process goes through FluidObjectHandle and request flow: DataObject.request() recognizes requests in the form of /blobs/<id> and loads blob. |
ContainerRuntimeFactoryWithDefaultDataStore | A ContainerRuntimeFactory that initializes Containers with a single default data store, which can be requested from the container with an empty URL.This factory should be exposed as fluidExport off the entry point to your module. |
DataObject | DataObject is a base data store that is primed with a root directory and task manager. It ensures that both are created and ready before you can access it.Having a single root directory allows for easier development. Instead of creating and registering channels with the runtime any new DDS that is set on the root will automatically be registered.Generics: P - represents a type that will define optional providers that will be injected S - the initial state type that the produced data store may take during creation E - represents events that will be available in the EventForwarder |
DataObjectFactory | DataObjectFactory is the IFluidDataStoreFactory for use with DataObjects. It facilitates DataObject's features (such as its shared directory) by ensuring relevant shared objects etc are available to the factory.Generics: P - represents a type that will define optional providers that will be injected S - the initial state type that the produced data object may take during creation |
PureDataObject | This is a bare-bones base class that does basic setup and enables for factory on an initialize call. You probably don't want to inherit from this data store directly unless you are creating another base data store classGenerics: P - represents a type that will define optional providers that will be injected S - the initial state type that the produced data store may take during creation E - represents events that will be available in the EventForwarder |
PureDataObjectFactory | PureDataObjectFactory is a barebones IFluidDataStoreFactory for use with PureDataObject. Consumers should typically use DataObjectFactory instead unless creating another base data store factory.Generics: P - represents a type that will define optional providers that will be injected S - the initial state type that the produced data store may take during creation |
Functions
Function | Description |
---|---|
getDefaultObjectFromContainer(container) | Helper function for getting the default Fluid Object from a Container. This function only works for Containers that support "/" request.T - defines the type you expect to be returned |
getObjectFromContainer(path, container) | Helper function for getting a Fluid Object from a Container given a path/url. This function only works for Containers that support getting FluidObjects via request.T - defines the type you expect to be returned |
getObjectWithIdFromContainer(id, container) | Helper function for getting as Fluid Object from a Container given a Unique Id. This function only works for Containers that support getting FluidObjects via request.T - defines the type you expect to be returned |
waitForAttach(dataStoreRuntime) |
Interfaces
Interface | Description |
---|---|
IDataObjectProps | |
IFluidDataObjectFactory |
Variables
Variable | Description |
---|---|
defaultRouteRequestHandler | Pipe through container request into internal request. If request is empty and default url is provided, redirect request to such default url. |
generateContainerServicesRequestHandler | Given a collection of IContainerServices will produce a RequestHandler for them all |
getFluidObjectFactoryFromInstance | |
mountableViewRequestHandler | A mountable view is only required if the view needs to be mounted across a bundle boundary. Mounting across bundle boundaries breaks some frameworks, so the mountable view is used to ensure the mounting is done within the same bundle as the view. For example, React hooks don't work if mounted across bundles since there will be two React instances, breaking the Rules of Hooks. When cross-bundle mounting isn't required, the mountable view isn't necessary.When a request is received with a mountableView: true header, this request handler will reissue the request without the header, and respond with a mountable view of the given class using the response. |
serviceRoutePathRoot |
Type Aliases
Type Alias | Description |
---|---|
ContainerServiceRegistryEntries |
Functions
getDefaultObjectFromContainer
Helper function for getting the default Fluid Object from a Container. This function only works for Containers that support “/” request.
T - defines the type you expect to be returned
Signature:
export declare function getDefaultObjectFromContainer<T = IFluidObject>(container: Container): Promise<T>;
Parameters
Parameter | Type | Description |
---|---|---|
container | Container | Container you're attempting to get the object from |
Returns:
Promise<T>
getObjectFromContainer
Helper function for getting a Fluid Object from a Container given a path/url. This function only works for Containers that support getting FluidObjects via request.
T - defines the type you expect to be returned
Signature:
export declare function getObjectFromContainer<T = IFluidObject>(path: string, container: Container): Promise<T>;
Parameters
Parameter | Type | Description |
---|---|---|
path | string | Unique path/url of the FluidObject |
container | Container | Container you're attempting to get the object from |
Returns:
Promise<T>
getObjectWithIdFromContainer
Helper function for getting as Fluid Object from a Container given a Unique Id. This function only works for Containers that support getting FluidObjects via request.
T - defines the type you expect to be returned
Signature:
export declare function getObjectWithIdFromContainer<T = IFluidObject>(id: string, container: Container): Promise<T>;
Parameters
Parameter | Type | Description |
---|---|---|
id | string | Unique id of the FluidObject |
container | Container | Container you're attempting to get the object from |
Returns:
Promise<T>
waitForAttach
Signature:
export declare function waitForAttach(dataStoreRuntime: IFluidDataStoreRuntime): Promise<void>;
Parameters
Parameter | Type | Description |
---|---|---|
dataStoreRuntime | IFluidDataStoreRuntime |
Returns:
Promise<void>
Variables
defaultRouteRequestHandler
Pipe through container request into internal request. If request is empty and default url is provided, redirect request to such default url.
Signature:
defaultRouteRequestHandler: (defaultRootId: string) => (request: IRequest, runtime: IContainerRuntime) => Promise<import("@fluidframework/core-interfaces").IResponse | undefined>
generateContainerServicesRequestHandler
Given a collection of IContainerServices will produce a RequestHandler for them all
Signature:
generateContainerServicesRequestHandler: (serviceRegistry: ContainerServiceRegistryEntries) => RuntimeRequestHandler
getFluidObjectFactoryFromInstance
Signature:
getFluidObjectFactoryFromInstance: (context: IFluidDataStoreContext) => IFluidDataObjectFactory
mountableViewRequestHandler
A mountable view is only required if the view needs to be mounted across a bundle boundary. Mounting across bundle boundaries breaks some frameworks, so the mountable view is used to ensure the mounting is done within the same bundle as the view. For example, React hooks don’t work if mounted across bundles since there will be two React instances, breaking the Rules of Hooks. When cross-bundle mounting isn’t required, the mountable view isn’t necessary.
When a request is received with a mountableView: true header, this request handler will reissue the request without the header, and respond with a mountable view of the given class using the response.
Signature:
mountableViewRequestHandler: (MountableViewClass: IFluidMountableViewClass, handlers: RuntimeRequestHandler[]) => (request: RequestParser, runtime: IContainerRuntime) => Promise<import("@fluidframework/core-interfaces").IResponse>
serviceRoutePathRoot
Signature:
serviceRoutePathRoot = "_services"
Type Aliases
ContainerServiceRegistryEntries
Signature:
export declare type ContainerServiceRegistryEntries = Iterable<[string, (runtime: IContainerRuntime) => Promise<IFluidObject>]>;