diff --git a/.changeset/gold-maps-cut.md b/.changeset/gold-maps-cut.md new file mode 100644 index 000000000000..3790848acb57 --- /dev/null +++ b/.changeset/gold-maps-cut.md @@ -0,0 +1,21 @@ +--- +"@fluidframework/aqueduct": minor +"@fluidframework/container-runtime": minor +"@fluidframework/container-runtime-definitions": minor +"@fluidframework/datastore": minor +"@fluidframework/runtime-definitions": minor +"@fluidframework/test-runtime-utils": minor +--- + +# The createDataStoreWithProps APIs on ContainerRuntime and IContainerRuntimeBase have been removed + +`ContainerRuntime.createDataStoreWithProps` and `IContainerRuntimeBase.createDataStoreWithProps` +have been removed. + +Replace uses of these APIs with `PureDataObjectFactory.createInstanceWithDataStore` and pass in props via the `initialState` +parameter. + +# Initial deprecation/removal announcement + +The initial deprecations of the now changed or removed types were announced [#1537](https://github.com/microsoft/FluidFramework/issues/1537) +in Fluid Framework v0.25 [#2931](https://github.com/microsoft/FluidFramework/pull/2931) diff --git a/packages/framework/aqueduct/package.json b/packages/framework/aqueduct/package.json index 68fb1020ce55..97c72c64ec89 100644 --- a/packages/framework/aqueduct/package.json +++ b/packages/framework/aqueduct/package.json @@ -156,7 +156,11 @@ "typescript": "~5.4.5" }, "typeValidation": { - "broken": {}, + "broken": { + "Interface_IDataObjectProps": { + "backCompat": false + } + }, "entrypoint": "legacy" } } diff --git a/packages/framework/aqueduct/src/test/types/validateAqueductPrevious.generated.ts b/packages/framework/aqueduct/src/test/types/validateAqueductPrevious.generated.ts index b7fd21423392..aad878387976 100644 --- a/packages/framework/aqueduct/src/test/types/validateAqueductPrevious.generated.ts +++ b/packages/framework/aqueduct/src/test/types/validateAqueductPrevious.generated.ts @@ -247,4 +247,5 @@ declare type old_as_current_for_Interface_IDataObjectProps = requireAssignableTo * typeValidation.broken: * "Interface_IDataObjectProps": {"backCompat": false} */ +// @ts-expect-error compatibility expected to be broken declare type current_as_old_for_Interface_IDataObjectProps = requireAssignableTo, TypeOnly> diff --git a/packages/runtime/container-runtime-definitions/package.json b/packages/runtime/container-runtime-definitions/package.json index fe58ab33f1ad..4a0a0b3bf8be 100644 --- a/packages/runtime/container-runtime-definitions/package.json +++ b/packages/runtime/container-runtime-definitions/package.json @@ -103,7 +103,17 @@ "typescript": "~5.4.5" }, "typeValidation": { - "broken": {}, + "broken": { + "Interface_IContainerRuntime": { + "backCompat": false + }, + "Interface_IContainerRuntimeWithResolveHandle_Deprecated": { + "backCompat": false + }, + "TypeAlias_IContainerRuntimeBaseWithCombinedEvents": { + "backCompat": false + } + }, "entrypoint": "legacy" } } diff --git a/packages/runtime/container-runtime-definitions/src/test/types/validateContainerRuntimeDefinitionsPrevious.generated.ts b/packages/runtime/container-runtime-definitions/src/test/types/validateContainerRuntimeDefinitionsPrevious.generated.ts index 13f5bcb7b763..f746d36779d7 100644 --- a/packages/runtime/container-runtime-definitions/src/test/types/validateContainerRuntimeDefinitionsPrevious.generated.ts +++ b/packages/runtime/container-runtime-definitions/src/test/types/validateContainerRuntimeDefinitionsPrevious.generated.ts @@ -22,6 +22,7 @@ declare type MakeUnusedImportErrorsGoAway = TypeOnly | MinimalType | Fu * typeValidation.broken: * "Interface_IContainerRuntime": {"backCompat": false} */ +// @ts-expect-error compatibility expected to be broken declare type current_as_old_for_Interface_IContainerRuntime = requireAssignableTo, TypeOnly> /* @@ -49,6 +50,7 @@ declare type old_as_current_for_Interface_IContainerRuntimeWithResolveHandle_Dep * typeValidation.broken: * "Interface_IContainerRuntimeWithResolveHandle_Deprecated": {"backCompat": false} */ +// @ts-expect-error compatibility expected to be broken declare type current_as_old_for_Interface_IContainerRuntimeWithResolveHandle_Deprecated = requireAssignableTo, TypeOnly> /* @@ -85,6 +87,7 @@ declare type current_as_old_for_Interface_ISummarizerObservabilityProps = requir * typeValidation.broken: * "TypeAlias_IContainerRuntimeBaseWithCombinedEvents": {"backCompat": false} */ +// @ts-expect-error compatibility expected to be broken declare type current_as_old_for_TypeAlias_IContainerRuntimeBaseWithCombinedEvents = requireAssignableTo, TypeOnly> /* diff --git a/packages/runtime/container-runtime/package.json b/packages/runtime/container-runtime/package.json index 4fcc023f5a59..4b4b078f4b59 100644 --- a/packages/runtime/container-runtime/package.json +++ b/packages/runtime/container-runtime/package.json @@ -221,7 +221,17 @@ "typescript": "~5.4.5" }, "typeValidation": { - "broken": {}, + "broken": { + "Class_ContainerRuntime": { + "backCompat": false + }, + "Class_DocumentsSchemaController": { + "forwardCompat": false + }, + "ClassStatics_ContainerRuntime": { + "backCompat": false + } + }, "entrypoint": "legacy" } } diff --git a/packages/runtime/container-runtime/src/containerRuntime.ts b/packages/runtime/container-runtime/src/containerRuntime.ts index 96a50678b9e7..d81f025ec8b3 100644 --- a/packages/runtime/container-runtime/src/containerRuntime.ts +++ b/packages/runtime/container-runtime/src/containerRuntime.ts @@ -3431,25 +3431,6 @@ export class ContainerRuntime ); } - /** - * @deprecated 0.16 Issue #1537, #3631 - */ - public async _createDataStoreWithProps( - pkg: Readonly, - props?: any, - ): Promise { - const context = this.channelCollection.createDataStoreContext( - Array.isArray(pkg) ? pkg : [pkg], - props, - ); - return channelToDataStore( - await context.realize(), - context.id, - this.channelCollection, - this.mc.logger, - ); - } - private canSendOps() { // Note that the real (non-proxy) delta manager is needed here to get the readonly info. This is because // container runtime's ability to send ops depend on the actual readonly state of the delta manager. diff --git a/packages/runtime/container-runtime/src/test/types/validateContainerRuntimePrevious.generated.ts b/packages/runtime/container-runtime/src/test/types/validateContainerRuntimePrevious.generated.ts index 2dbf49f28ded..a9f4bad04ac1 100644 --- a/packages/runtime/container-runtime/src/test/types/validateContainerRuntimePrevious.generated.ts +++ b/packages/runtime/container-runtime/src/test/types/validateContainerRuntimePrevious.generated.ts @@ -31,6 +31,7 @@ declare type old_as_current_for_Class_ContainerRuntime = requireAssignableTo, TypeOnly> /* @@ -85,6 +86,7 @@ declare type current_as_old_for_Class_SummaryCollection = requireAssignableTo, TypeOnly> /* diff --git a/packages/runtime/runtime-definitions/api-report/runtime-definitions.legacy.alpha.api.md b/packages/runtime/runtime-definitions/api-report/runtime-definitions.legacy.alpha.api.md index f7fe04a66dae..1821c8da82cf 100644 --- a/packages/runtime/runtime-definitions/api-report/runtime-definitions.legacy.alpha.api.md +++ b/packages/runtime/runtime-definitions/api-report/runtime-definitions.legacy.alpha.api.md @@ -72,8 +72,6 @@ export interface IContainerRuntimeBase extends IEventProvider, loadingGroupId?: string): Promise; - // @deprecated (undocumented) - _createDataStoreWithProps(pkg: Readonly, props?: any, id?: string): Promise; createDetachedDataStore(pkg: Readonly, loadingGroupId?: string): IFluidDataStoreContextDetached; // (undocumented) readonly disposed: boolean; diff --git a/packages/runtime/runtime-definitions/package.json b/packages/runtime/runtime-definitions/package.json index 35169d042bbe..172c45a5e7ba 100644 --- a/packages/runtime/runtime-definitions/package.json +++ b/packages/runtime/runtime-definitions/package.json @@ -111,7 +111,20 @@ "typescript": "~5.4.5" }, "typeValidation": { - "broken": {}, + "broken": { + "Interface_IContainerRuntimeBase": { + "backCompat": false + }, + "Interface_IFluidDataStoreContext": { + "backCompat": false + }, + "Interface_IFluidDataStoreContextDetached": { + "backCompat": false + }, + "Interface_IFluidParentContext": { + "backCompat": false + } + }, "entrypoint": "legacy" } } diff --git a/packages/runtime/runtime-definitions/src/dataStoreContext.ts b/packages/runtime/runtime-definitions/src/dataStoreContext.ts index 718325b2d79e..d87e1b0aad8a 100644 --- a/packages/runtime/runtime-definitions/src/dataStoreContext.ts +++ b/packages/runtime/runtime-definitions/src/dataStoreContext.ts @@ -216,15 +216,6 @@ export interface IContainerRuntimeBase extends IEventProvider void; - /** - * @deprecated 0.16 Issue #1537, #3631 - */ - _createDataStoreWithProps( - pkg: Readonly, - props?: any, - id?: string, - ): Promise; - /** * Creates a data store and returns an object that exposes a handle to the data store's entryPoint, and also serves * as the data store's router. The data store is not bound to a container, and in such state is not persisted to diff --git a/packages/runtime/runtime-definitions/src/test/types/validateRuntimeDefinitionsPrevious.generated.ts b/packages/runtime/runtime-definitions/src/test/types/validateRuntimeDefinitionsPrevious.generated.ts index 61b1cd698cb4..5031c28d1216 100644 --- a/packages/runtime/runtime-definitions/src/test/types/validateRuntimeDefinitionsPrevious.generated.ts +++ b/packages/runtime/runtime-definitions/src/test/types/validateRuntimeDefinitionsPrevious.generated.ts @@ -112,6 +112,7 @@ declare type current_as_old_for_Interface_IAttachMessage = requireAssignableTo, TypeOnly> /* @@ -211,6 +212,7 @@ declare type old_as_current_for_Interface_IFluidDataStoreContext = requireAssign * typeValidation.broken: * "Interface_IFluidDataStoreContext": {"backCompat": false} */ +// @ts-expect-error compatibility expected to be broken declare type current_as_old_for_Interface_IFluidDataStoreContext = requireAssignableTo, TypeOnly> /* @@ -229,6 +231,7 @@ declare type old_as_current_for_Interface_IFluidDataStoreContextDetached = requi * typeValidation.broken: * "Interface_IFluidDataStoreContextDetached": {"backCompat": false} */ +// @ts-expect-error compatibility expected to be broken declare type current_as_old_for_Interface_IFluidDataStoreContextDetached = requireAssignableTo, TypeOnly> /* @@ -283,6 +286,7 @@ declare type old_as_current_for_Interface_IFluidParentContext = requireAssignabl * typeValidation.broken: * "Interface_IFluidParentContext": {"backCompat": false} */ +// @ts-expect-error compatibility expected to be broken declare type current_as_old_for_Interface_IFluidParentContext = requireAssignableTo, TypeOnly> /* diff --git a/packages/runtime/test-runtime-utils/package.json b/packages/runtime/test-runtime-utils/package.json index 6b34e307ae96..2453e4ba8268 100644 --- a/packages/runtime/test-runtime-utils/package.json +++ b/packages/runtime/test-runtime-utils/package.json @@ -157,7 +157,14 @@ "typescript": "~5.4.5" }, "typeValidation": { - "broken": {}, + "broken": { + "Class_MockFluidDataStoreContext": { + "backCompat": false + }, + "ClassStatics_MockFluidDataStoreContext": { + "backCompat": false + } + }, "entrypoint": "legacy" } } diff --git a/packages/runtime/test-runtime-utils/src/test/types/validateTestRuntimeUtilsPrevious.generated.ts b/packages/runtime/test-runtime-utils/src/test/types/validateTestRuntimeUtilsPrevious.generated.ts index 60347db4f053..a88ba30aba20 100644 --- a/packages/runtime/test-runtime-utils/src/test/types/validateTestRuntimeUtilsPrevious.generated.ts +++ b/packages/runtime/test-runtime-utils/src/test/types/validateTestRuntimeUtilsPrevious.generated.ts @@ -175,6 +175,7 @@ declare type old_as_current_for_Class_MockFluidDataStoreContext = requireAssigna * typeValidation.broken: * "Class_MockFluidDataStoreContext": {"backCompat": false} */ +// @ts-expect-error compatibility expected to be broken declare type current_as_old_for_Class_MockFluidDataStoreContext = requireAssignableTo, TypeOnly> /* @@ -364,6 +365,7 @@ declare type current_as_old_for_ClassStatics_MockDeltaQueue = requireAssignableT * typeValidation.broken: * "ClassStatics_MockFluidDataStoreContext": {"backCompat": false} */ +// @ts-expect-error compatibility expected to be broken declare type current_as_old_for_ClassStatics_MockFluidDataStoreContext = requireAssignableTo, TypeOnly> /* diff --git a/packages/test/test-end-to-end-tests/src/test/rootDatastores.spec.ts b/packages/test/test-end-to-end-tests/src/test/rootDatastores.spec.ts index b52afcc247b6..fd949e81b098 100644 --- a/packages/test/test-end-to-end-tests/src/test/rootDatastores.spec.ts +++ b/packages/test/test-end-to-end-tests/src/test/rootDatastores.spec.ts @@ -61,9 +61,6 @@ describeCompat("Named root data stores", "FullCompat", (getTestObjectProvider) = const runtimeOf = (dataObject: ITestFluidObject): IContainerRuntime => dataObject.context.containerRuntime as IContainerRuntime; - const createDataStoreWithProps = async (dataObject: ITestFluidObject, id: string) => - runtimeOf(dataObject)._createDataStoreWithProps(packageName, {}, id); - /** * Gets an aliased data store with the given id. Throws an error if the data store cannot be retrieved. */ @@ -78,14 +75,6 @@ describeCompat("Named root data stores", "FullCompat", (getTestObjectProvider) = return dataStore; } - describe("Legacy APIs", () => { - it("Datastore creation with legacy API returns datastore which can be aliased", async () => { - const ds = await createDataStoreWithProps(dataObject1, "1"); - const aliasResult = await ds.trySetAlias("2"); - assert.equal(aliasResult, "Success"); - }); - }); - describe("Aliasing", () => { const alias = "alias"; diff --git a/packages/test/test-utils/package.json b/packages/test/test-utils/package.json index 5d9cf87aa2f7..c9ae7ee694d1 100644 --- a/packages/test/test-utils/package.json +++ b/packages/test/test-utils/package.json @@ -167,7 +167,14 @@ "typescript": "~5.4.5" }, "typeValidation": { - "broken": {}, + "broken": { + "Interface_IProvideTestFluidObject": { + "backCompat": false + }, + "Interface_ITestFluidObject": { + "backCompat": false + } + }, "entrypoint": "legacy" } } diff --git a/packages/test/test-utils/src/test/types/validateTestUtilsPrevious.generated.ts b/packages/test/test-utils/src/test/types/validateTestUtilsPrevious.generated.ts index 23bb8b2365d0..d14180f98964 100644 --- a/packages/test/test-utils/src/test/types/validateTestUtilsPrevious.generated.ts +++ b/packages/test/test-utils/src/test/types/validateTestUtilsPrevious.generated.ts @@ -85,6 +85,7 @@ declare type old_as_current_for_Interface_IProvideTestFluidObject = requireAssig * typeValidation.broken: * "Interface_IProvideTestFluidObject": {"backCompat": false} */ +// @ts-expect-error compatibility expected to be broken declare type current_as_old_for_Interface_IProvideTestFluidObject = requireAssignableTo, TypeOnly> /* @@ -103,4 +104,5 @@ declare type old_as_current_for_Interface_ITestFluidObject = requireAssignableTo * typeValidation.broken: * "Interface_ITestFluidObject": {"backCompat": false} */ +// @ts-expect-error compatibility expected to be broken declare type current_as_old_for_Interface_ITestFluidObject = requireAssignableTo, TypeOnly>