@fluidframework/fluid-static 2.0.0-internal.6.4.0 → 2.0.0-internal.7.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,65 @@
1
1
  # @fluidframework/fluid-static
2
2
 
3
+ ## 2.0.0-internal.7.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Dependencies on @fluidframework/protocol-definitions package updated to 3.0.0 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
8
+
9
+ This included the following changes from the protocol-definitions release:
10
+
11
+ - Updating signal interfaces for some planned improvements. The intention is split the interface between signals
12
+ submitted by clients to the server and the resulting signals sent from the server to clients.
13
+ - A new optional type member is available on the ISignalMessage interface and a new ISentSignalMessage interface has
14
+ been added, which will be the typing for signals sent from the client to the server. Both extend a new
15
+ ISignalMessageBase interface that contains common members.
16
+ - The @fluidframework/common-definitions package dependency has been updated to version 1.0.0.
17
+
18
+ - Server upgrade: dependencies on Fluid server packages updated to 2.0.1 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
19
+
20
+ Dependencies on the following Fluid server package have been updated to version 2.0.1:
21
+
22
+ - @fluidframework/gitresources: 2.0.1
23
+ - @fluidframework/server-kafka-orderer: 2.0.1
24
+ - @fluidframework/server-lambdas: 2.0.1
25
+ - @fluidframework/server-lambdas-driver: 2.0.1
26
+ - @fluidframework/server-local-server: 2.0.1
27
+ - @fluidframework/server-memory-orderer: 2.0.1
28
+ - @fluidframework/protocol-base: 2.0.1
29
+ - @fluidframework/server-routerlicious: 2.0.1
30
+ - @fluidframework/server-routerlicious-base: 2.0.1
31
+ - @fluidframework/server-services: 2.0.1
32
+ - @fluidframework/server-services-client: 2.0.1
33
+ - @fluidframework/server-services-core: 2.0.1
34
+ - @fluidframework/server-services-ordering-kafkanode: 2.0.1
35
+ - @fluidframework/server-services-ordering-rdkafka: 2.0.1
36
+ - @fluidframework/server-services-ordering-zookeeper: 2.0.1
37
+ - @fluidframework/server-services-shared: 2.0.1
38
+ - @fluidframework/server-services-telemetry: 2.0.1
39
+ - @fluidframework/server-services-utils: 2.0.1
40
+ - @fluidframework/server-test-utils: 2.0.1
41
+ - tinylicious: 2.0.1
42
+
43
+ - test-utils: provideEntryPoint is required [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
44
+
45
+ The optional `provideEntryPoint` method has become required on a number of constructors. A value will need to be provided to the following classes:
46
+
47
+ - `BaseContainerRuntimeFactory`
48
+ - `RuntimeFactory`
49
+ - `ContainerRuntime` (constructor and `loadRuntime`)
50
+ - `FluidDataStoreRuntime`
51
+
52
+ See [testContainerRuntimeFactoryWithDefaultDataStore.ts](https://github.com/microsoft/FluidFramework/tree/main/packages/test/test-utils/src/testContainerRuntimeFactoryWithDefaultDataStore.ts) for an example implemtation of `provideEntryPoint` for ContainerRuntime.
53
+ See [pureDataObjectFactory.ts](https://github.com/microsoft/FluidFramework/tree/main/packages/framework/aqueduct/src/data-object-factories/pureDataObjectFactory.ts#L83) for an example implementation of `provideEntryPoint` for DataStoreRuntime.
54
+
55
+ Subsequently, various `entryPoint` and `getEntryPoint()` endpoints have become required. Please see [containerRuntime.ts](https://github.com/microsoft/FluidFramework/tree/main/packages/runtime/container-runtime/src/containerRuntime.ts) for example implementations of these APIs.
56
+
57
+ For more details, see [Removing-IFluidRouter.md](https://github.com/microsoft/FluidFramework/blob/main/packages/common/core-interfaces/Removing-IFluidRouter.md)
58
+
59
+ - Minimum TypeScript version now 5.1.6 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
60
+
61
+ The minimum supported TypeScript version for Fluid 2.0 clients is now 5.1.6.
62
+
3
63
  ## 2.0.0-internal.6.4.0
4
64
 
5
65
  Dependency updates only.
@@ -1 +1 @@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B;CAMzE"}
@@ -87,7 +87,7 @@ class RootDataObject extends aqueduct_1.DataObject {
87
87
  const factory = dataObjectClass.factory;
88
88
  const packagePath = [...this.context.packagePath, factory.type];
89
89
  const dataStore = await this.context.containerRuntime.createDataStore(packagePath);
90
- const entryPoint = await dataStore.entryPoint?.get();
90
+ const entryPoint = await dataStore.entryPoint.get();
91
91
  return entryPoint;
92
92
  }
93
93
  createSharedObject(sharedObjectClass) {
@@ -110,10 +110,21 @@ class DOProviderContainerRuntimeFactory extends aqueduct_1.BaseContainerRuntimeF
110
110
  constructor(schema) {
111
111
  const [registryEntries, sharedObjects] = (0, utils_1.parseDataObjectsFromSharedObjects)(schema);
112
112
  const rootDataObjectFactory = new aqueduct_1.DataObjectFactory("rootDO", RootDataObject, sharedObjects, {}, registryEntries);
113
- super([rootDataObjectFactory.registryEntry], undefined, [(0, aqueduct_1.defaultRouteRequestHandler)(rootDataStoreId)],
114
- // temporary workaround to disable message batching until the message batch size issue is resolved
115
- // resolution progress is tracked by the Feature 465 work item in AzDO
116
- { flushMode: runtime_definitions_1.FlushMode.Immediate });
113
+ super({
114
+ registryEntries: [rootDataObjectFactory.registryEntry],
115
+ // eslint-disable-next-line import/no-deprecated
116
+ requestHandlers: [(0, aqueduct_1.defaultRouteRequestHandler)(rootDataStoreId)],
117
+ // temporary workaround to disable message batching until the message batch size issue is resolved
118
+ // resolution progress is tracked by the Feature 465 work item in AzDO
119
+ runtimeOptions: { flushMode: runtime_definitions_1.FlushMode.Immediate },
120
+ provideEntryPoint: async (containerRuntime) => {
121
+ const entryPoint = await containerRuntime.getAliasedDataStoreEntryPoint(rootDataStoreId);
122
+ if (entryPoint === undefined) {
123
+ throw new Error(`default dataStore [${rootDataStoreId}] must exist`);
124
+ }
125
+ return entryPoint.get();
126
+ },
127
+ });
117
128
  this.rootDataObjectFactory = rootDataObjectFactory;
118
129
  this.initialObjects = schema.initialObjects;
119
130
  }
@@ -1 +1 @@
1
- {"version":3,"file":"rootDataObject.js","sour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AAC,eAAe,EAAE,OAAO,EAAE;YAC7E,cAAc,EAAE,IAAI,CAAC,cAAc;SACnC,CAAC,CAAC;IACJ,CAAC;CACD;AAxCD,8EAwCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport {\n\tBaseContainerRuntimeFactory,\n\tDataObject,\n\tDataObjectFactory,\n\tdefaultRouteRequestHandler,\n} from \"@fluidframework/aqueduct\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { FlushMode } from \"@fluidframework/runtime-definitions\";\nimport {\n\tContainerSchema,\n\tDataObjectClass,\n\tIRootDataObject,\n\tLoadableObjectClass,\n\tLoadableObjectClassRecord,\n\tLoadableObjectRecord,\n\tSharedObjectClass,\n} from \"./types\";\nimport { isDataObjectClass, isSharedObjectClass, parseDataObjectsFromSharedObjects } from \"./utils\";\n\n/**\n * Input props for {@link RootDataObject.initializingFirstTime}.\n */\nexport interface RootDataObjectProps {\n\t/**\n\t * Initial object structure with which the {@link RootDataObject} will be first-time initialized.\n\t *\n\t * @see {@link RootDataObject.initializingFirstTime}\n\t */\n\tinitialObjects: LoadableObjectClassRecord;\n}\n\n/**\n * The entry-point/root collaborative object of the {@link IFluidContainer | Fluid Container}.\n * Abstracts the dynamic code required to build a Fluid Container into a static representation for end customers.\n */\nexport class RootDataObject\n\textends DataObject<{ InitialState: RootDataObjectProps }>\n\timplements IRootDataObject\n{\n\tprivate readonly initialObjectsDirKey = \"initial-objects-key\";\n\tprivate readonly _initialObjects: LoadableObjectRecord = {};\n\n\tprivate get initialObjectsDir() {\n\t\tconst dir = this.root.getSubDirectory(this.initialObjectsDirKey);\n\t\tif (dir === undefined) {\n\t\t\tthrow new Error(\"InitialObjects sub-directory was not initialized\");\n\t\t}\n\t\treturn dir;\n\t}\n\n\t/**\n\t * The first time this object is initialized, creates each object identified in\n\t * {@link RootDataObjectProps.initialObjects} and stores them as unique values in the root directory.\n\t *\n\t * @see {@link @fluidframework/aqueduct#PureDataObject.initializingFirstTime}\n\t */\n\tprotected async initializingFirstTime(props: RootDataObjectProps) {\n\t\tthis.root.createSubDirectory(this.initialObjectsDirKey);\n\n\t\t// Create initial objects provided by the developer\n\t\tconst initialObjectsP: Promise<void>[] = [];\n\t\tObject.entries(props.initialObjects).forEach(([id, objectClass]) => {\n\t\t\tconst createObject = async () => {\n\t\t\t\tconst obj = await this.create(objectClass);\n\t\t\t\tthis.initialObjectsDir.set(id, obj.handle);\n\t\t\t};\n\t\t\tinitialObjectsP.push(createObject());\n\t\t});\n\n\t\tawait Promise.all(initialObjectsP);\n\t}\n\n\t/**\n\t * Every time an instance is initialized, loads all of the initial objects in the root directory so they can be\n\t * accessed immediately.\n\t *\n\t * @see {@link @fluidframework/aqueduct#PureDataObject.hasInitialized}\n\t */\n\tprotected async hasInitialized() {\n\t\t// We will always load the initial objects so they are available to the developer\n\t\tconst loadInitialObjectsP: Promise<void>[] = [];\n\t\tfor (const [key, value] of Array.from(this.initialObjectsDir.entries())) {\n\t\t\tconst loadDir = async () => {\n\t\t\t\tconst obj = await value.get();\n\t\t\t\tObject.assign(this._initialObjects, { [key]: obj });\n\t\t\t};\n\t\t\tloadInitialObjectsP.push(loadDir());\n\t\t}\n\n\t\tawait Promise.all(loadInitialObjectsP);\n\t}\n\n\t/**\n\t * {@inheritDoc IRootDataObject.initialObjects}\n\t */\n\tpublic get initialObjects(): LoadableObjectRecord {\n\t\tif (Object.keys(this._initialObjects).length === 0) {\n\t\t\tthrow new Error(\"Initial Objects were not correctly initialized\");\n\t\t}\n\t\treturn this._initialObjects;\n\t}\n\n\t/**\n\t * {@inheritDoc IRootDataObject.create}\n\t */\n\tpublic async create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T> {\n\t\tif (isDataObjectClass(objectClass)) {\n\t\t\treturn this.createDataObject<T>(objectClass);\n\t\t} else if (isSharedObjectClass(objectClass)) {\n\t\t\treturn this.createSharedObject<T>(objectClass);\n\t\t}\n\t\tthrow new Error(\"Could not create new Fluid object because an unknown object was passed\");\n\t}\n\n\tprivate async createDataObject<T extends IFluidLoadable>(\n\t\tdataObjectClass: DataObjectClass<T>,\n\t): Promise<T> {\n\t\tconst factory = dataObjectClass.factory;\n\t\tconst packagePath = [...this.context.packagePath, factory.type];\n\t\tconst dataStore = await this.context.containerRuntime.createDataStore(packagePath);\n\t\tconst entryPoint = await dataStore.entryPoint?.get();\n\t\treturn entryPoint as unknown as T;\n\t}\n\n\tprivate createSharedObject<T extends IFluidLoadable>(\n\t\tsharedObjectClass: SharedObjectClass<T>,\n\t): T {\n\t\tconst factory = sharedObjectClass.getFactory();\n\t\tconst obj = this.runtime.createChannel(undefined, factory.type);\n\t\treturn obj as unknown as T;\n\t}\n}\n\nconst rootDataStoreId = \"rootDOId\";\n\n/**\n * Container code that provides a single {@link IRootDataObject}.\n *\n * @remarks\n *\n * This data object is dynamically customized (registry and initial objects) based on the schema provided.\n * to the container runtime factory.\n */\nexport class DOProviderContainerRuntimeFactory extends BaseContainerRuntimeFactory {\n\tprivate readonly rootDataObjectFactory: DataObjectFactory<\n\t\tRootDataObject,\n\t\t{\n\t\t\tInitialState: RootDataObjectProps;\n\t\t}\n\t>;\n\n\tprivate readonly initialObjects: LoadableObjectClassRecord;\n\n\tconstructor(schema: ContainerSchema) {\n\t\tconst [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);\n\t\tconst rootDataObjectFactory = new DataObjectFactory(\n\t\t\t\"rootDO\",\n\t\t\tRootDataObject,\n\t\t\tsharedObjects,\n\t\t\t{},\n\t\t\tregistryEntries,\n\t\t);\n\t\tsuper(\n\t\t\t[rootDataObjectFactory.registryEntry],\n\t\t\tundefined,\n\t\t\t[defaultRouteRequestHandler(rootDataStoreId)],\n\t\t\t// temporary workaround to disable message batching until the message batch size issue is resolved\n\t\t\t// resolution progress is tracked by the Feature 465 work item in AzDO\n\t\t\t{ flushMode: FlushMode.Immediate },\n\t\t);\n\t\tthis.rootDataObjectFactory = rootDataObjectFactory;\n\t\tthis.initialObjects = schema.initialObjects;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/aqueduct#BaseContainerRuntimeFactory.containerInitializingFirstTime}\n\t */\n\tprotected async containerInitializingFirstTime(runtime: IContainerRuntime) {\n\t\t// The first time we create the container we create the RootDataObject\n\t\tawait this.rootDataObjectFactory.createRootInstance(rootDataStoreId, runtime, {\n\t\t\tinitialObjects: this.initialObjects,\n\t\t});\n\t}\n}\n"]}
1
+ {"version":3,"file":"rootDataObject.js","sourceRoot":"","sources":["../src/rootDataObject.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uDAMkC;AAGlC,6EAAgE;AAUhE,mCAAoG;AAcpG;;;GAGG;AACH,MAAa,cACZ,SAAQ,qBAAiD;IAD1D;;QAIkB,yBAAoB,GAAG,qBAAqB,CAAC;QAC7C,oBAAe,GAAyB,EAAE,CAAC;IA2F7D,CAAC;IAzFA,IAAY,iBAAiB;QAC5B,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QACjE,IAAI,GAAG,KAAK,SAAS,EAAE;YACtB,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;SACpE;QACD,OAAO,GAAG,CAAC;IACZ,CAAC;IAED;;;;;OAKG;IACO,KAAK,CAAC,qBAAqB,CAAC,KAA0B;QAC/D,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QAExD,mDAAmD;QACnD,MAAM,eAAe,GAAoB,EAAE,CAAC;QAC5C,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,WAAW,CAAC,EAAE,EAAE;YAClE,MAAM,YAAY,GAAG,KAAK,IAAI,EAAE;gBAC/B,MAAM,GA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AAC,aAAa,CAAC;YACtD,gDAAgD;YAChD,eAAe,EAAE,CAAC,IAAA,qCAA0B,EAAC,eAAe,CAAC,CAAC;YAC9D,kGAAkG;YAClG,sEAAsE;YACtE,cAAc,EAAE,EAAE,SAAS,EAAE,+BAAS,CAAC,SAAS,EAAE;YAClD,iBAAiB,EAAE,KAAK,EAAE,gBAAmC,EAAE,EAAE;gBAChE,MAAM,UAAU,GAAG,MAAM,gBAAgB,CAAC,6BAA6B,CACtE,eAAe,CACf,CAAC;gBACF,IAAI,UAAU,KAAK,SAAS,EAAE;oBAC7B,MAAM,IAAI,KAAK,CAAC,sBAAsB,eAAe,cAAc,CAAC,CAAC;iBACrE;gBACD,OAAO,UAAU,CAAC,GAAG,EAAE,CAAC;YACzB,CAAC;SACD,CAAC,CAAC;QACH,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;QACnD,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;IAC7C,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,8BAA8B,CAAC,OAA0B;QACxE,sEAAsE;QACtE,MAAM,IAAI,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,eAAe,EAAE,OAAO,EAAE;YAC7E,cAAc,EAAE,IAAI,CAAC,cAAc;SACnC,CAAC,CAAC;IACJ,CAAC;CACD;AAjDD,8EAiDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport {\n\tBaseContainerRuntimeFactory,\n\tDataObject,\n\tDataObjectFactory,\n\t// eslint-disable-next-line import/no-deprecated\n\tdefaultRouteRequestHandler,\n} from \"@fluidframework/aqueduct\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { FlushMode } from \"@fluidframework/runtime-definitions\";\nimport {\n\tContainerSchema,\n\tDataObjectClass,\n\tIRootDataObject,\n\tLoadableObjectClass,\n\tLoadableObjectClassRecord,\n\tLoadableObjectRecord,\n\tSharedObjectClass,\n} from \"./types\";\nimport { isDataObjectClass, isSharedObjectClass, parseDataObjectsFromSharedObjects } from \"./utils\";\n\n/**\n * Input props for {@link RootDataObject.initializingFirstTime}.\n */\nexport interface RootDataObjectProps {\n\t/**\n\t * Initial object structure with which the {@link RootDataObject} will be first-time initialized.\n\t *\n\t * @see {@link RootDataObject.initializingFirstTime}\n\t */\n\tinitialObjects: LoadableObjectClassRecord;\n}\n\n/**\n * The entry-point/root collaborative object of the {@link IFluidContainer | Fluid Container}.\n * Abstracts the dynamic code required to build a Fluid Container into a static representation for end customers.\n */\nexport class RootDataObject\n\textends DataObject<{ InitialState: RootDataObjectProps }>\n\timplements IRootDataObject\n{\n\tprivate readonly initialObjectsDirKey = \"initial-objects-key\";\n\tprivate readonly _initialObjects: LoadableObjectRecord = {};\n\n\tprivate get initialObjectsDir() {\n\t\tconst dir = this.root.getSubDirectory(this.initialObjectsDirKey);\n\t\tif (dir === undefined) {\n\t\t\tthrow new Error(\"InitialObjects sub-directory was not initialized\");\n\t\t}\n\t\treturn dir;\n\t}\n\n\t/**\n\t * The first time this object is initialized, creates each object identified in\n\t * {@link RootDataObjectProps.initialObjects} and stores them as unique values in the root directory.\n\t *\n\t * @see {@link @fluidframework/aqueduct#PureDataObject.initializingFirstTime}\n\t */\n\tprotected async initializingFirstTime(props: RootDataObjectProps) {\n\t\tthis.root.createSubDirectory(this.initialObjectsDirKey);\n\n\t\t// Create initial objects provided by the developer\n\t\tconst initialObjectsP: Promise<void>[] = [];\n\t\tObject.entries(props.initialObjects).forEach(([id, objectClass]) => {\n\t\t\tconst createObject = async () => {\n\t\t\t\tconst obj = await this.create(objectClass);\n\t\t\t\tthis.initialObjectsDir.set(id, obj.handle);\n\t\t\t};\n\t\t\tinitialObjectsP.push(createObject());\n\t\t});\n\n\t\tawait Promise.all(initialObjectsP);\n\t}\n\n\t/**\n\t * Every time an instance is initialized, loads all of the initial objects in the root directory so they can be\n\t * accessed immediately.\n\t *\n\t * @see {@link @fluidframework/aqueduct#PureDataObject.hasInitialized}\n\t */\n\tprotected async hasInitialized() {\n\t\t// We will always load the initial objects so they are available to the developer\n\t\tconst loadInitialObjectsP: Promise<void>[] = [];\n\t\tfor (const [key, value] of Array.from(this.initialObjectsDir.entries())) {\n\t\t\tconst loadDir = async () => {\n\t\t\t\tconst obj = await value.get();\n\t\t\t\tObject.assign(this._initialObjects, { [key]: obj });\n\t\t\t};\n\t\t\tloadInitialObjectsP.push(loadDir());\n\t\t}\n\n\t\tawait Promise.all(loadInitialObjectsP);\n\t}\n\n\t/**\n\t * {@inheritDoc IRootDataObject.initialObjects}\n\t */\n\tpublic get initialObjects(): LoadableObjectRecord {\n\t\tif (Object.keys(this._initialObjects).length === 0) {\n\t\t\tthrow new Error(\"Initial Objects were not correctly initialized\");\n\t\t}\n\t\treturn this._initialObjects;\n\t}\n\n\t/**\n\t * {@inheritDoc IRootDataObject.create}\n\t */\n\tpublic async create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T> {\n\t\tif (isDataObjectClass(objectClass)) {\n\t\t\treturn this.createDataObject<T>(objectClass);\n\t\t} else if (isSharedObjectClass(objectClass)) {\n\t\t\treturn this.createSharedObject<T>(objectClass);\n\t\t}\n\t\tthrow new Error(\"Could not create new Fluid object because an unknown object was passed\");\n\t}\n\n\tprivate async createDataObject<T extends IFluidLoadable>(\n\t\tdataObjectClass: DataObjectClass<T>,\n\t): Promise<T> {\n\t\tconst factory = dataObjectClass.factory;\n\t\tconst packagePath = [...this.context.packagePath, factory.type];\n\t\tconst dataStore = await this.context.containerRuntime.createDataStore(packagePath);\n\t\tconst entryPoint = await dataStore.entryPoint.get();\n\t\treturn entryPoint as unknown as T;\n\t}\n\n\tprivate createSharedObject<T extends IFluidLoadable>(\n\t\tsharedObjectClass: SharedObjectClass<T>,\n\t): T {\n\t\tconst factory = sharedObjectClass.getFactory();\n\t\tconst obj = this.runtime.createChannel(undefined, factory.type);\n\t\treturn obj as unknown as T;\n\t}\n}\n\nconst rootDataStoreId = \"rootDOId\";\n\n/**\n * Container code that provides a single {@link IRootDataObject}.\n *\n * @remarks\n *\n * This data object is dynamically customized (registry and initial objects) based on the schema provided.\n * to the container runtime factory.\n */\nexport class DOProviderContainerRuntimeFactory extends BaseContainerRuntimeFactory {\n\tprivate readonly rootDataObjectFactory: DataObjectFactory<\n\t\tRootDataObject,\n\t\t{\n\t\t\tInitialState: RootDataObjectProps;\n\t\t}\n\t>;\n\n\tprivate readonly initialObjects: LoadableObjectClassRecord;\n\n\tconstructor(schema: ContainerSchema) {\n\t\tconst [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);\n\t\tconst rootDataObjectFactory = new DataObjectFactory(\n\t\t\t\"rootDO\",\n\t\t\tRootDataObject,\n\t\t\tsharedObjects,\n\t\t\t{},\n\t\t\tregistryEntries,\n\t\t);\n\t\tsuper({\n\t\t\tregistryEntries: [rootDataObjectFactory.registryEntry],\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\trequestHandlers: [defaultRouteRequestHandler(rootDataStoreId)],\n\t\t\t// temporary workaround to disable message batching until the message batch size issue is resolved\n\t\t\t// resolution progress is tracked by the Feature 465 work item in AzDO\n\t\t\truntimeOptions: { flushMode: FlushMode.Immediate },\n\t\t\tprovideEntryPoint: async (containerRuntime: IContainerRuntime) => {\n\t\t\t\tconst entryPoint = await containerRuntime.getAliasedDataStoreEntryPoint(\n\t\t\t\t\trootDataStoreId,\n\t\t\t\t);\n\t\t\t\tif (entryPoint === undefined) {\n\t\t\t\t\tthrow new Error(`default dataStore [${rootDataStoreId}] must exist`);\n\t\t\t\t}\n\t\t\t\treturn entryPoint.get();\n\t\t\t},\n\t\t});\n\t\tthis.rootDataObjectFactory = rootDataObjectFactory;\n\t\tthis.initialObjects = schema.initialObjects;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/aqueduct#BaseContainerRuntimeFactory.containerInitializingFirstTime}\n\t */\n\tprotected async containerInitializingFirstTime(runtime: IContainerRuntime) {\n\t\t// The first time we create the container we create the RootDataObject\n\t\tawait this.rootDataObjectFactory.createRootInstance(rootDataStoreId, runtime, {\n\t\t\tinitialObjects: this.initialObjects,\n\t\t});\n\t}\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.34.9"
8
+ "packageVersion": "7.37.0"
9
9
  }
10
10
  ]
11
11
  }
package/dist/types.d.ts CHANGED
@@ -8,25 +8,25 @@ import { IFluidDataStoreFactory } from "@fluidframework/runtime-definitions";
8
8
  /**
9
9
  * A mapping of string identifiers to instantiated `DataObject`s or `SharedObject`s.
10
10
  */
11
- export declare type LoadableObjectRecord = Record<string, IFluidLoadable>;
11
+ export type LoadableObjectRecord = Record<string, IFluidLoadable>;
12
12
  /**
13
13
  * A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`
14
14
  * or `SharedObject` in a {@link LoadableObjectRecord}.
15
15
  */
16
- export declare type LoadableObjectClassRecord = Record<string, LoadableObjectClass<any>>;
16
+ export type LoadableObjectClassRecord = Record<string, LoadableObjectClass<any>>;
17
17
  /**
18
18
  * A class object of `DataObject` or `SharedObject`.
19
19
  *
20
20
  * @typeParam T - The class of the `DataObject` or `SharedObject`.
21
21
  */
22
- export declare type LoadableObjectClass<T extends IFluidLoadable> = DataObjectClass<T> | SharedObjectClass<T>;
22
+ export type LoadableObjectClass<T extends IFluidLoadable> = DataObjectClass<T> | SharedObjectClass<T>;
23
23
  /**
24
24
  * A class that has a factory that can create a `DataObject` and a
25
25
  * constructor that will return the type of the `DataObject`.
26
26
  *
27
27
  * @typeParam T - The class of the `DataObject`.
28
28
  */
29
- export declare type DataObjectClass<T extends IFluidLoadable> = {
29
+ export type DataObjectClass<T extends IFluidLoadable> = {
30
30
  readonly factory: IFluidDataStoreFactory;
31
31
  } & LoadableObjectCtor<T>;
32
32
  /**
@@ -35,7 +35,7 @@ export declare type DataObjectClass<T extends IFluidLoadable> = {
35
35
  *
36
36
  * @typeParam T - The class of the `SharedObject`.
37
37
  */
38
- export declare type SharedObjectClass<T extends IFluidLoadable> = {
38
+ export type SharedObjectClass<T extends IFluidLoadable> = {
39
39
  readonly getFactory: () => IChannelFactory;
40
40
  } & LoadableObjectCtor<T>;
41
41
  /**
@@ -43,7 +43,7 @@ export declare type SharedObjectClass<T extends IFluidLoadable> = {
43
43
  *
44
44
  * @typeParam T - The class of the loadable object.
45
45
  */
46
- export declare type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
46
+ export type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
47
47
  /**
48
48
  * Declares the Fluid objects that will be available in the {@link IFluidContainer | Container}.
49
49
  *
@@ -110,7 +110,7 @@ export interface IRootDataObject {
110
110
  *
111
111
  * @see See {@link IServiceAudienceEvents} for usage details.
112
112
  */
113
- export declare type MemberChangedListener<M extends IMember> = (clientId: string, member: M) => void;
113
+ export type MemberChangedListener<M extends IMember> = (clientId: string, member: M) => void;
114
114
  /**
115
115
  * Events that trigger when the roster of members in the Fluid session change.
116
116
  *
@@ -196,7 +196,7 @@ export interface IMember {
196
196
  /**
197
197
  * An extended member object that includes currentConnection
198
198
  */
199
- export declare type Myself<M extends IMember = IMember> = M & {
199
+ export type Myself<M extends IMember = IMember> = M & {
200
200
  currentConnection: string;
201
201
  };
202
202
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAE7E;;GAEG;AACH,oBAAY,oBAAoB,GAAG,MAAM,CAA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,2BAA2B;IACjF,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAKpC;IAEF,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA4B;gBAE/C,MAAM,EAAE,eAAe;IA8BnC;;OAEG;cACa,8BAA8B,CAAC,OAAO,EAAE,iBAAiB;CAMzE"}
@@ -2,7 +2,9 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { BaseContainerRuntimeFactory, DataObject, DataObjectFactory, defaultRouteRequestHandler, } from "@fluidframework/aqueduct";
5
+ import { BaseContainerRuntimeFactory, DataObject, DataObjectFactory,
6
+ // eslint-disable-next-line import/no-deprecated
7
+ defaultRouteRequestHandler, } from "@fluidframework/aqueduct";
6
8
  import { FlushMode } from "@fluidframework/runtime-definitions";
7
9
  import { isDataObjectClass, isSharedObjectClass, parseDataObjectsFromSharedObjects } from "./utils";
8
10
  /**
@@ -84,7 +86,7 @@ export class RootDataObject extends DataObject {
84
86
  const factory = dataObjectClass.factory;
85
87
  const packagePath = [...this.context.packagePath, factory.type];
86
88
  const dataStore = await this.context.containerRuntime.createDataStore(packagePath);
87
- const entryPoint = await dataStore.entryPoint?.get();
89
+ const entryPoint = await dataStore.entryPoint.get();
88
90
  return entryPoint;
89
91
  }
90
92
  createSharedObject(sharedObjectClass) {
@@ -106,10 +108,21 @@ export class DOProviderContainerRuntimeFactory extends BaseContainerRuntimeFacto
106
108
  constructor(schema) {
107
109
  const [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);
108
110
  const rootDataObjectFactory = new DataObjectFactory("rootDO", RootDataObject, sharedObjects, {}, registryEntries);
109
- super([rootDataObjectFactory.registryEntry], undefined, [defaultRouteRequestHandler(rootDataStoreId)],
110
- // temporary workaround to disable message batching until the message batch size issue is resolved
111
- // resolution progress is tracked by the Feature 465 work item in AzDO
112
- { flushMode: FlushMode.Immediate });
111
+ super({
112
+ registryEntries: [rootDataObjectFactory.registryEntry],
113
+ // eslint-disable-next-line import/no-deprecated
114
+ requestHandlers: [defaultRouteRequestHandler(rootDataStoreId)],
115
+ // temporary workaround to disable message batching until the message batch size issue is resolved
116
+ // resolution progress is tracked by the Feature 465 work item in AzDO
117
+ runtimeOptions: { flushMode: FlushMode.Immediate },
118
+ provideEntryPoint: async (containerRuntime) => {
119
+ const entryPoint = await containerRuntime.getAliasedDataStoreEntryPoint(rootDataStoreId);
120
+ if (entryPoint === undefined) {
121
+ throw new Error(`default dataStore [${rootDataStoreId}] must exist`);
122
+ }
123
+ return entryPoint.get();
124
+ },
125
+ });
113
126
  this.rootDataObjectFactory = rootDataObjectFactory;
114
127
  this.initialObjects = schema.initialObjects;
115
128
  }
@@ -1 +1 @@
1
- {"version":3,"file":"rootDataObject.js","sourceRoot":"","sources":["../src/rootDataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACN,2BAA2B,EAC3B,UAAU,EACV,iBAAiB,EACjB,0BAA0B,GAC1B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAUhE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,iCAAiC,EAAE,MAAM,SAAS,CAAC;AAcpG;;;GAGG;AACH,MAAM,OAAO,cACZ,SAAQ,UAAiD;IAD1D;;QAIkB,yBAAoB,GAAG,qBAAqB,CAAC;QAC7C,oBAAe,GAAyB,EAAE,CAAC;IA2F7D,CAAC;IAzFA,IAAY,iBAAiB;QAC5B,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QACjE,IAAI,GAAG,KAAK,SAAS,EAAE;YACtB,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;SACpE;QACD,OAAO,GAAG,CAAC;IACZ,CAAC;IAED;;;;;OAKG;IACO,KAAK,CAAC,qBAAqB,CAAC,KAA0B;QAC/D,IAAI,CAAC,IAAI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IAUjF,YAAY,MAAuB;QAClC,MAAM,CAAC,eAAe,EAAE,aAAa,CAAC,GAAG,iCAAiC,CAAC,MAAM,CAAC,CAAC;QACnF,MAAM,qBAAqB,GAAG,IAAI,iBAAiB,CAClD,QAAQ,EACR,cAAc,EACd,aAAa,EACb,EAAE,EACF,eAAe,CACf,CAAC;QACF,KAAK,CACJ,CAAC,qBAAqB,CAAC,aAAa,CAAC,EACrC,SAAS,EACT,CAAC,0BAA0B,CAAC,eAAe,CAAC,CAAC;QAC7C,kGAAkG;QAClG,sEAAsE;QACtE,EAAE,SAAS,EAAE,SAAS,CAAC,SAAS,EAAE,CAClC,CAAC;QACF,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;QACnD,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;IAC7C,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,8BAA8B,CAAC,OAA0B;QACxE,sEAAsE;QACtE,MAAM,IAAI,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,eAAe,EAAE,OAAO,EAAE;YAC7E,cAAc,EAAE,IAAI,CAAC,cAAc;SACnC,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport {\n\tBaseContainerRuntimeFactory,\n\tDataObject,\n\tDataObjectFactory,\n\tdefaultRouteRequestHandler,\n} from \"@fluidframework/aqueduct\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { FlushMode } from \"@fluidframework/runtime-definitions\";\nimport {\n\tContainerSchema,\n\tDataObjectClass,\n\tIRootDataObject,\n\tLoadableObjectClass,\n\tLoadableObjectClassRecord,\n\tLoadableObjectRecord,\n\tSharedObjectClass,\n} from \"./types\";\nimport { isDataObjectClass, isSharedObjectClass, parseDataObjectsFromSharedObjects } from \"./utils\";\n\n/**\n * Input props for {@link RootDataObject.initializingFirstTime}.\n */\nexport interface RootDataObjectProps {\n\t/**\n\t * Initial object structure with which the {@link RootDataObject} will be first-time initialized.\n\t *\n\t * @see {@link RootDataObject.initializingFirstTime}\n\t */\n\tinitialObjects: LoadableObjectClassRecord;\n}\n\n/**\n * The entry-point/root collaborative object of the {@link IFluidContainer | Fluid Container}.\n * Abstracts the dynamic code required to build a Fluid Container into a static representation for end customers.\n */\nexport class RootDataObject\n\textends DataObject<{ InitialState: RootDataObjectProps }>\n\timplements IRootDataObject\n{\n\tprivate readonly initialObjectsDirKey = \"initial-objects-key\";\n\tprivate readonly _initialObjects: LoadableObjectRecord = {};\n\n\tprivate get initialObjectsDir() {\n\t\tconst dir = this.root.getSubDirectory(this.initialObjectsDirKey);\n\t\tif (dir === undefined) {\n\t\t\tthrow new Error(\"InitialObjects sub-directory was not initialized\");\n\t\t}\n\t\treturn dir;\n\t}\n\n\t/**\n\t * The first time this object is initialized, creates each object identified in\n\t * {@link RootDataObjectProps.initialObjects} and stores them as unique values in the root directory.\n\t *\n\t * @see {@link @fluidframework/aqueduct#PureDataObject.initializingFirstTime}\n\t */\n\tprotected async initializingFirstTime(props: RootDataObjectProps) {\n\t\tthis.root.createSubDirectory(this.initialObjectsDirKey);\n\n\t\t// Create initial objects provided by the developer\n\t\tconst initialObjectsP: Promise<void>[] = [];\n\t\tObject.entries(props.initialObjects).forEach(([id, objectClass]) => {\n\t\t\tconst createObject = async () => {\n\t\t\t\tconst obj = await this.create(objectClass);\n\t\t\t\tthis.initialObjectsDir.set(id, obj.handle);\n\t\t\t};\n\t\t\tinitialObjectsP.push(createObject());\n\t\t});\n\n\t\tawait Promise.all(initialObjectsP);\n\t}\n\n\t/**\n\t * Every time an instance is initialized, loads all of the initial objects in the root directory so they can be\n\t * accessed immediately.\n\t *\n\t * @see {@link @fluidframework/aqueduct#PureDataObject.hasInitialized}\n\t */\n\tprotected async hasInitialized() {\n\t\t// We will always load the initial objects so they are available to the developer\n\t\tconst loadInitialObjectsP: Promise<void>[] = [];\n\t\tfor (const [key, value] of Array.from(this.initialObjectsDir.entries())) {\n\t\t\tconst loadDir = async () => {\n\t\t\t\tconst obj = await value.get();\n\t\t\t\tObject.assign(this._initialObjects, { [key]: obj });\n\t\t\t};\n\t\t\tloadInitialObjectsP.push(loadDir());\n\t\t}\n\n\t\tawait Promise.all(loadInitialObjectsP);\n\t}\n\n\t/**\n\t * {@inheritDoc IRootDataObject.initialObjects}\n\t */\n\tpublic get initialObjects(): LoadableObjectRecord {\n\t\tif (Object.keys(this._initialObjects).length === 0) {\n\t\t\tthrow new Error(\"Initial Objects were not correctly initialized\");\n\t\t}\n\t\treturn this._initialObjects;\n\t}\n\n\t/**\n\t * {@inheritDoc IRootDataObject.create}\n\t */\n\tpublic async create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T> {\n\t\tif (isDataObjectClass(objectClass)) {\n\t\t\treturn this.createDataObject<T>(objectClass);\n\t\t} else if (isSharedObjectClass(objectClass)) {\n\t\t\treturn this.createSharedObject<T>(objectClass);\n\t\t}\n\t\tthrow new Error(\"Could not create new Fluid object because an unknown object was passed\");\n\t}\n\n\tprivate async createDataObject<T extends IFluidLoadable>(\n\t\tdataObjectClass: DataObjectClass<T>,\n\t): Promise<T> {\n\t\tconst factory = dataObjectClass.factory;\n\t\tconst packagePath = [...this.context.packagePath, factory.type];\n\t\tconst dataStore = await this.context.containerRuntime.createDataStore(packagePath);\n\t\tconst entryPoint = await dataStore.entryPoint?.get();\n\t\treturn entryPoint as unknown as T;\n\t}\n\n\tprivate createSharedObject<T extends IFluidLoadable>(\n\t\tsharedObjectClass: SharedObjectClass<T>,\n\t): T {\n\t\tconst factory = sharedObjectClass.getFactory();\n\t\tconst obj = this.runtime.createChannel(undefined, factory.type);\n\t\treturn obj as unknown as T;\n\t}\n}\n\nconst rootDataStoreId = \"rootDOId\";\n\n/**\n * Container code that provides a single {@link IRootDataObject}.\n *\n * @remarks\n *\n * This data object is dynamically customized (registry and initial objects) based on the schema provided.\n * to the container runtime factory.\n */\nexport class DOProviderContainerRuntimeFactory extends BaseContainerRuntimeFactory {\n\tprivate readonly rootDataObjectFactory: DataObjectFactory<\n\t\tRootDataObject,\n\t\t{\n\t\t\tInitialState: RootDataObjectProps;\n\t\t}\n\t>;\n\n\tprivate readonly initialObjects: LoadableObjectClassRecord;\n\n\tconstructor(schema: ContainerSchema) {\n\t\tconst [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);\n\t\tconst rootDataObjectFactory = new DataObjectFactory(\n\t\t\t\"rootDO\",\n\t\t\tRootDataObject,\n\t\t\tsharedObjects,\n\t\t\t{},\n\t\t\tregistryEntries,\n\t\t);\n\t\tsuper(\n\t\t\t[rootDataObjectFactory.registryEntry],\n\t\t\tundefined,\n\t\t\t[defaultRouteRequestHandler(rootDataStoreId)],\n\t\t\t// temporary workaround to disable message batching until the message batch size issue is resolved\n\t\t\t// resolution progress is tracked by the Feature 465 work item in AzDO\n\t\t\t{ flushMode: FlushMode.Immediate },\n\t\t);\n\t\tthis.rootDataObjectFactory = rootDataObjectFactory;\n\t\tthis.initialObjects = schema.initialObjects;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/aqueduct#BaseContainerRuntimeFactory.containerInitializingFirstTime}\n\t */\n\tprotected async containerInitializingFirstTime(runtime: IContainerRuntime) {\n\t\t// The first time we create the container we create the RootDataObject\n\t\tawait this.rootDataObjectFactory.createRootInstance(rootDataStoreId, runtime, {\n\t\t\tinitialObjects: this.initialObjects,\n\t\t});\n\t}\n}\n"]}
1
+ {"version":3,"file":"rootDataObject.js","sourceRoot":"","sources":["../src/rootDataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACN,2BAA2B,EAC3B,UAAU,EACV,iBAAiB;AACjB,gDAAgD;AAChD,0BAA0B,GAC1B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAUhE,OAAO,EAAE,iB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AAE,CAAC;YACzB,CAAC;SACD,CAAC,CAAC;QACH,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;QACnD,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;IAC7C,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,8BAA8B,CAAC,OAA0B;QACxE,sEAAsE;QACtE,MAAM,IAAI,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,eAAe,EAAE,OAAO,EAAE;YAC7E,cAAc,EAAE,IAAI,CAAC,cAAc;SACnC,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport {\n\tBaseContainerRuntimeFactory,\n\tDataObject,\n\tDataObjectFactory,\n\t// eslint-disable-next-line import/no-deprecated\n\tdefaultRouteRequestHandler,\n} from \"@fluidframework/aqueduct\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { FlushMode } from \"@fluidframework/runtime-definitions\";\nimport {\n\tContainerSchema,\n\tDataObjectClass,\n\tIRootDataObject,\n\tLoadableObjectClass,\n\tLoadableObjectClassRecord,\n\tLoadableObjectRecord,\n\tSharedObjectClass,\n} from \"./types\";\nimport { isDataObjectClass, isSharedObjectClass, parseDataObjectsFromSharedObjects } from \"./utils\";\n\n/**\n * Input props for {@link RootDataObject.initializingFirstTime}.\n */\nexport interface RootDataObjectProps {\n\t/**\n\t * Initial object structure with which the {@link RootDataObject} will be first-time initialized.\n\t *\n\t * @see {@link RootDataObject.initializingFirstTime}\n\t */\n\tinitialObjects: LoadableObjectClassRecord;\n}\n\n/**\n * The entry-point/root collaborative object of the {@link IFluidContainer | Fluid Container}.\n * Abstracts the dynamic code required to build a Fluid Container into a static representation for end customers.\n */\nexport class RootDataObject\n\textends DataObject<{ InitialState: RootDataObjectProps }>\n\timplements IRootDataObject\n{\n\tprivate readonly initialObjectsDirKey = \"initial-objects-key\";\n\tprivate readonly _initialObjects: LoadableObjectRecord = {};\n\n\tprivate get initialObjectsDir() {\n\t\tconst dir = this.root.getSubDirectory(this.initialObjectsDirKey);\n\t\tif (dir === undefined) {\n\t\t\tthrow new Error(\"InitialObjects sub-directory was not initialized\");\n\t\t}\n\t\treturn dir;\n\t}\n\n\t/**\n\t * The first time this object is initialized, creates each object identified in\n\t * {@link RootDataObjectProps.initialObjects} and stores them as unique values in the root directory.\n\t *\n\t * @see {@link @fluidframework/aqueduct#PureDataObject.initializingFirstTime}\n\t */\n\tprotected async initializingFirstTime(props: RootDataObjectProps) {\n\t\tthis.root.createSubDirectory(this.initialObjectsDirKey);\n\n\t\t// Create initial objects provided by the developer\n\t\tconst initialObjectsP: Promise<void>[] = [];\n\t\tObject.entries(props.initialObjects).forEach(([id, objectClass]) => {\n\t\t\tconst createObject = async () => {\n\t\t\t\tconst obj = await this.create(objectClass);\n\t\t\t\tthis.initialObjectsDir.set(id, obj.handle);\n\t\t\t};\n\t\t\tinitialObjectsP.push(createObject());\n\t\t});\n\n\t\tawait Promise.all(initialObjectsP);\n\t}\n\n\t/**\n\t * Every time an instance is initialized, loads all of the initial objects in the root directory so they can be\n\t * accessed immediately.\n\t *\n\t * @see {@link @fluidframework/aqueduct#PureDataObject.hasInitialized}\n\t */\n\tprotected async hasInitialized() {\n\t\t// We will always load the initial objects so they are available to the developer\n\t\tconst loadInitialObjectsP: Promise<void>[] = [];\n\t\tfor (const [key, value] of Array.from(this.initialObjectsDir.entries())) {\n\t\t\tconst loadDir = async () => {\n\t\t\t\tconst obj = await value.get();\n\t\t\t\tObject.assign(this._initialObjects, { [key]: obj });\n\t\t\t};\n\t\t\tloadInitialObjectsP.push(loadDir());\n\t\t}\n\n\t\tawait Promise.all(loadInitialObjectsP);\n\t}\n\n\t/**\n\t * {@inheritDoc IRootDataObject.initialObjects}\n\t */\n\tpublic get initialObjects(): LoadableObjectRecord {\n\t\tif (Object.keys(this._initialObjects).length === 0) {\n\t\t\tthrow new Error(\"Initial Objects were not correctly initialized\");\n\t\t}\n\t\treturn this._initialObjects;\n\t}\n\n\t/**\n\t * {@inheritDoc IRootDataObject.create}\n\t */\n\tpublic async create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T> {\n\t\tif (isDataObjectClass(objectClass)) {\n\t\t\treturn this.createDataObject<T>(objectClass);\n\t\t} else if (isSharedObjectClass(objectClass)) {\n\t\t\treturn this.createSharedObject<T>(objectClass);\n\t\t}\n\t\tthrow new Error(\"Could not create new Fluid object because an unknown object was passed\");\n\t}\n\n\tprivate async createDataObject<T extends IFluidLoadable>(\n\t\tdataObjectClass: DataObjectClass<T>,\n\t): Promise<T> {\n\t\tconst factory = dataObjectClass.factory;\n\t\tconst packagePath = [...this.context.packagePath, factory.type];\n\t\tconst dataStore = await this.context.containerRuntime.createDataStore(packagePath);\n\t\tconst entryPoint = await dataStore.entryPoint.get();\n\t\treturn entryPoint as unknown as T;\n\t}\n\n\tprivate createSharedObject<T extends IFluidLoadable>(\n\t\tsharedObjectClass: SharedObjectClass<T>,\n\t): T {\n\t\tconst factory = sharedObjectClass.getFactory();\n\t\tconst obj = this.runtime.createChannel(undefined, factory.type);\n\t\treturn obj as unknown as T;\n\t}\n}\n\nconst rootDataStoreId = \"rootDOId\";\n\n/**\n * Container code that provides a single {@link IRootDataObject}.\n *\n * @remarks\n *\n * This data object is dynamically customized (registry and initial objects) based on the schema provided.\n * to the container runtime factory.\n */\nexport class DOProviderContainerRuntimeFactory extends BaseContainerRuntimeFactory {\n\tprivate readonly rootDataObjectFactory: DataObjectFactory<\n\t\tRootDataObject,\n\t\t{\n\t\t\tInitialState: RootDataObjectProps;\n\t\t}\n\t>;\n\n\tprivate readonly initialObjects: LoadableObjectClassRecord;\n\n\tconstructor(schema: ContainerSchema) {\n\t\tconst [registryEntries, sharedObjects] = parseDataObjectsFromSharedObjects(schema);\n\t\tconst rootDataObjectFactory = new DataObjectFactory(\n\t\t\t\"rootDO\",\n\t\t\tRootDataObject,\n\t\t\tsharedObjects,\n\t\t\t{},\n\t\t\tregistryEntries,\n\t\t);\n\t\tsuper({\n\t\t\tregistryEntries: [rootDataObjectFactory.registryEntry],\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\trequestHandlers: [defaultRouteRequestHandler(rootDataStoreId)],\n\t\t\t// temporary workaround to disable message batching until the message batch size issue is resolved\n\t\t\t// resolution progress is tracked by the Feature 465 work item in AzDO\n\t\t\truntimeOptions: { flushMode: FlushMode.Immediate },\n\t\t\tprovideEntryPoint: async (containerRuntime: IContainerRuntime) => {\n\t\t\t\tconst entryPoint = await containerRuntime.getAliasedDataStoreEntryPoint(\n\t\t\t\t\trootDataStoreId,\n\t\t\t\t);\n\t\t\t\tif (entryPoint === undefined) {\n\t\t\t\t\tthrow new Error(`default dataStore [${rootDataStoreId}] must exist`);\n\t\t\t\t}\n\t\t\t\treturn entryPoint.get();\n\t\t\t},\n\t\t});\n\t\tthis.rootDataObjectFactory = rootDataObjectFactory;\n\t\tthis.initialObjects = schema.initialObjects;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/aqueduct#BaseContainerRuntimeFactory.containerInitializingFirstTime}\n\t */\n\tprotected async containerInitializingFirstTime(runtime: IContainerRuntime) {\n\t\t// The first time we create the container we create the RootDataObject\n\t\tawait this.rootDataObjectFactory.createRootInstance(rootDataStoreId, runtime, {\n\t\t\tinitialObjects: this.initialObjects,\n\t\t});\n\t}\n}\n"]}
package/lib/types.d.ts CHANGED
@@ -8,25 +8,25 @@ import { IFluidDataStoreFactory } from "@fluidframework/runtime-definitions";
8
8
  /**
9
9
  * A mapping of string identifiers to instantiated `DataObject`s or `SharedObject`s.
10
10
  */
11
- export declare type LoadableObjectRecord = Record<string, IFluidLoadable>;
11
+ export type LoadableObjectRecord = Record<string, IFluidLoadable>;
12
12
  /**
13
13
  * A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`
14
14
  * or `SharedObject` in a {@link LoadableObjectRecord}.
15
15
  */
16
- export declare type LoadableObjectClassRecord = Record<string, LoadableObjectClass<any>>;
16
+ export type LoadableObjectClassRecord = Record<string, LoadableObjectClass<any>>;
17
17
  /**
18
18
  * A class object of `DataObject` or `SharedObject`.
19
19
  *
20
20
  * @typeParam T - The class of the `DataObject` or `SharedObject`.
21
21
  */
22
- export declare type LoadableObjectClass<T extends IFluidLoadable> = DataObjectClass<T> | SharedObjectClass<T>;
22
+ export type LoadableObjectClass<T extends IFluidLoadable> = DataObjectClass<T> | SharedObjectClass<T>;
23
23
  /**
24
24
  * A class that has a factory that can create a `DataObject` and a
25
25
  * constructor that will return the type of the `DataObject`.
26
26
  *
27
27
  * @typeParam T - The class of the `DataObject`.
28
28
  */
29
- export declare type DataObjectClass<T extends IFluidLoadable> = {
29
+ export type DataObjectClass<T extends IFluidLoadable> = {
30
30
  readonly factory: IFluidDataStoreFactory;
31
31
  } & LoadableObjectCtor<T>;
32
32
  /**
@@ -35,7 +35,7 @@ export declare type DataObjectClass<T extends IFluidLoadable> = {
35
35
  *
36
36
  * @typeParam T - The class of the `SharedObject`.
37
37
  */
38
- export declare type SharedObjectClass<T extends IFluidLoadable> = {
38
+ export type SharedObjectClass<T extends IFluidLoadable> = {
39
39
  readonly getFactory: () => IChannelFactory;
40
40
  } & LoadableObjectCtor<T>;
41
41
  /**
@@ -43,7 +43,7 @@ export declare type SharedObjectClass<T extends IFluidLoadable> = {
43
43
  *
44
44
  * @typeParam T - The class of the loadable object.
45
45
  */
46
- export declare type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
46
+ export type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
47
47
  /**
48
48
  * Declares the Fluid objects that will be available in the {@link IFluidContainer | Container}.
49
49
  *
@@ -110,7 +110,7 @@ export interface IRootDataObject {
110
110
  *
111
111
  * @see See {@link IServiceAudienceEvents} for usage details.
112
112
  */
113
- export declare type MemberChangedListener<M extends IMember> = (clientId: string, member: M) => void;
113
+ export type MemberChangedListener<M extends IMember> = (clientId: string, member: M) => void;
114
114
  /**
115
115
  * Events that trigger when the roster of members in the Fluid session change.
116
116
  *
@@ -196,7 +196,7 @@ export interface IMember {
196
196
  /**
197
197
  * An extended member object that includes currentConnection
198
198
  */
199
- export declare type Myself<M extends IMember = IMember> = M & {
199
+ export type Myself<M extends IMember = IMember> = M & {
200
200
  currentConnection: string;
201
201
  };
202
202
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAE7E;;GAEG;AACH,oBAAY,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAElE;;;GAGG;AACH,oBAAY,yBAAyB,GAAG,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC;AAEjF;;;;GAIG;AACH,oBAAY,mBAAmB,CAAC,CAAC,SAAS,cAAc,IACrD,eAAe,CAAC,CAAC,CAAC,GAClB,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAExB;;;;;GAKG;AACH,oBAAY,eAAe,CAAC,CAAC,SAAS,cAAc,IAAI;IACvD,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;CACzC,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC;AAE1B;;;;;GAKG;AACH,oBAAY,iBAAiB,CAAC,CAAC,SAAS,cAAc,IAAI;IACzD,QAAQ,CAAC,UAAU,EAAE,MAAM,eAAe,CAAC;CAC3C,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC;AAE1B;;;;GAIG;AACH,oBAAY,k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CAAC,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CACnE;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,OAAO,CAClD,SAAQ,cAAc,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;IACjD;;;;OAIG;IACH,UAAU,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAE7B;;OAEG;IACH,SAAS,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CACnC;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,MAAM,WAAW,OAAO;IACvB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,WAAW,EAAE,WAAW,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,IAAI,CAAC,GAAG;IAAE,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/fluid-static",
3
- "version": "2.0.0-internal.6.4.0",
3
+ "version": "2.0.0-internal.7.0.1",
4
4
  "description": "A tool to enable consumption of Fluid Data Objects without requiring custom container code.",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -35,28 +35,28 @@
35
35
  "temp-directory": "nyc/.nyc_output"
36
36
  },
37
37
  "dependencies": {
38
- "@fluid-internal/client-utils": ">=2.0.0-internal.6.4.0 <2.0.0-internal.6.5.0",
39
- "@fluidframework/aqueduct": ">=2.0.0-internal.6.4.0 <2.0.0-internal.6.5.0",
40
- "@fluidframework/container-definitions": ">=2.0.0-internal.6.4.0 <2.0.0-internal.6.5.0",
41
- "@fluidframework/container-loader": ">=2.0.0-internal.6.4.0 <2.0.0-internal.6.5.0",
42
- "@fluidframework/container-runtime-definitions": ">=2.0.0-internal.6.4.0 <2.0.0-internal.6.5.0",
43
- "@fluidframework/core-interfaces": ">=2.0.0-internal.6.4.0 <2.0.0-internal.6.5.0",
44
- "@fluidframework/datastore-definitions": ">=2.0.0-internal.6.4.0 <2.0.0-internal.6.5.0",
45
- "@fluidframework/protocol-definitions": "^1.1.0",
46
- "@fluidframework/request-handler": ">=2.0.0-internal.6.4.0 <2.0.0-internal.6.5.0",
47
- "@fluidframework/runtime-definitions": ">=2.0.0-internal.6.4.0 <2.0.0-internal.6.5.0",
48
- "@fluidframework/runtime-utils": ">=2.0.0-internal.6.4.0 <2.0.0-internal.6.5.0"
38
+ "@fluid-internal/client-utils": ">=2.0.0-internal.7.0.1 <2.0.0-internal.7.1.0",
39
+ "@fluidframework/aqueduct": ">=2.0.0-internal.7.0.1 <2.0.0-internal.7.1.0",
40
+ "@fluidframework/container-definitions": ">=2.0.0-internal.7.0.1 <2.0.0-internal.7.1.0",
41
+ "@fluidframework/container-loader": ">=2.0.0-internal.7.0.1 <2.0.0-internal.7.1.0",
42
+ "@fluidframework/container-runtime-definitions": ">=2.0.0-internal.7.0.1 <2.0.0-internal.7.1.0",
43
+ "@fluidframework/core-interfaces": ">=2.0.0-internal.7.0.1 <2.0.0-internal.7.1.0",
44
+ "@fluidframework/datastore-definitions": ">=2.0.0-internal.7.0.1 <2.0.0-internal.7.1.0",
45
+ "@fluidframework/protocol-definitions": "^3.0.0",
46
+ "@fluidframework/request-handler": ">=2.0.0-internal.7.0.1 <2.0.0-internal.7.1.0",
47
+ "@fluidframework/runtime-definitions": ">=2.0.0-internal.7.0.1 <2.0.0-internal.7.1.0",
48
+ "@fluidframework/runtime-utils": ">=2.0.0-internal.7.0.1 <2.0.0-internal.7.1.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@fluid-tools/build-cli": "^0.22.0",
51
+ "@fluid-tools/build-cli": "^0.24.0",
52
52
  "@fluidframework/build-common": "^2.0.0",
53
- "@fluidframework/build-tools": "^0.22.0",
53
+ "@fluidframework/build-tools": "^0.24.0",
54
54
  "@fluidframework/eslint-config-fluid": "^2.1.0",
55
55
  "@fluidframework/fluid-static-previous": "npm:@fluidframework/fluid-static@2.0.0-internal.6.3.0",
56
- "@fluidframework/map": ">=2.0.0-internal.6.4.0 <2.0.0-internal.6.5.0",
57
- "@fluidframework/mocha-test-setup": ">=2.0.0-internal.6.4.0 <2.0.0-internal.6.5.0",
58
- "@fluidframework/sequence": ">=2.0.0-internal.6.4.0 <2.0.0-internal.6.5.0",
59
- "@microsoft/api-extractor": "^7.34.4",
56
+ "@fluidframework/map": ">=2.0.0-internal.7.0.1 <2.0.0-internal.7.1.0",
57
+ "@fluidframework/mocha-test-setup": ">=2.0.0-internal.7.0.1 <2.0.0-internal.7.1.0",
58
+ "@fluidframework/sequence": ">=2.0.0-internal.7.0.1 <2.0.0-internal.7.1.0",
59
+ "@microsoft/api-extractor": "^7.37.0",
60
60
  "@types/mocha": "^9.1.1",
61
61
  "@types/node": "^16.18.38",
62
62
  "c8": "^7.7.1",
@@ -69,7 +69,7 @@
69
69
  "moment": "^2.21.0",
70
70
  "prettier": "~2.6.2",
71
71
  "rimraf": "^4.4.0",
72
- "typescript": "~4.5.5"
72
+ "typescript": "~5.1.6"
73
73
  },
74
74
  "typeValidation": {
75
75
  "broken": {}
@@ -6,6 +6,7 @@ import {
6
6
  BaseContainerRuntimeFactory,
7
7
  DataObject,
8
8
  DataObjectFactory,
9
+ // eslint-disable-next-line import/no-deprecated
9
10
  defaultRouteRequestHandler,
10
11
  } from "@fluidframework/aqueduct";
11
12
  import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
@@ -123,7 +124,7 @@ export class RootDataObject
123
124
  const factory = dataObjectClass.factory;
124
125
  const packagePath = [...this.context.packagePath, factory.type];
125
126
  const dataStore = await this.context.containerRuntime.createDataStore(packagePath);
126
- const entryPoint = await dataStore.entryPoint?.get();
127
+ const entryPoint = await dataStore.entryPoint.get();
127
128
  return entryPoint as unknown as T;
128
129
  }
129
130
 
@@ -165,14 +166,23 @@ export class DOProviderContainerRuntimeFactory extends BaseContainerRuntimeFacto
165
166
  {},
166
167
  registryEntries,
167
168
  );
168
- super(
169
- [rootDataObjectFactory.registryEntry],
170
- undefined,
171
- [defaultRouteRequestHandler(rootDataStoreId)],
169
+ super({
170
+ registryEntries: [rootDataObjectFactory.registryEntry],
171
+ // eslint-disable-next-line import/no-deprecated
172
+ requestHandlers: [defaultRouteRequestHandler(rootDataStoreId)],
172
173
  // temporary workaround to disable message batching until the message batch size issue is resolved
173
174
  // resolution progress is tracked by the Feature 465 work item in AzDO
174
- { flushMode: FlushMode.Immediate },
175
- );
175
+ runtimeOptions: { flushMode: FlushMode.Immediate },
176
+ provideEntryPoint: async (containerRuntime: IContainerRuntime) => {
177
+ const entryPoint = await containerRuntime.getAliasedDataStoreEntryPoint(
178
+ rootDataStoreId,
179
+ );
180
+ if (entryPoint === undefined) {
181
+ throw new Error(`default dataStore [${rootDataStoreId}] must exist`);
182
+ }
183
+ return entryPoint.get();
184
+ },
185
+ });
176
186
  this.rootDataObjectFactory = rootDataObjectFactory;
177
187
  this.initialObjects = schema.initialObjects;
178
188
  }