Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove _createDataStoreWithProps #22996

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .changeset/gold-maps-cut.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add a note at the bottom with a link to the release notes where these APIs were deprecated? Something like:

The initial deprecations of the now changed or removed types were announced in Fluid Framework v2.4.0: Several MergeTree Client Legacy APIs are now deprecated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have been trying to remove this api for 4 years, but our first deprecation occurred here: #1537

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Original file line number Diff line number Diff line change
@@ -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

Removed two main APIs, `ContainerRuntime.createDataStoreWithProps` and `IContainerRuntimeBase.createDataStoreWithProps`
has been removed.
Comment on lines +12 to +13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ContainerRuntime.createDataStoreWithProps and IContainerRuntimeBase.createDataStoreWithProps APIs 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)
6 changes: 5 additions & 1 deletion packages/framework/aqueduct/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@
"typescript": "~5.4.5"
},
"typeValidation": {
"broken": {},
"broken": {
"Interface_IDataObjectProps": {
"backCompat": false
}
},
"entrypoint": "legacy"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<current.IDataObjectProps>, TypeOnly<old.IDataObjectProps>>
12 changes: 11 additions & 1 deletion packages/runtime/container-runtime-definitions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ declare type MakeUnusedImportErrorsGoAway<T> = TypeOnly<T> | MinimalType<T> | 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<current.IContainerRuntime>, TypeOnly<old.IContainerRuntime>>

/*
Expand Down Expand Up @@ -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<current.IContainerRuntimeWithResolveHandle_Deprecated>, TypeOnly<old.IContainerRuntimeWithResolveHandle_Deprecated>>

/*
Expand All @@ -58,4 +60,5 @@ declare type current_as_old_for_Interface_IContainerRuntimeWithResolveHandle_Dep
* typeValidation.broken:
* "TypeAlias_IContainerRuntimeBaseWithCombinedEvents": {"backCompat": false}
*/
// @ts-expect-error compatibility expected to be broken
declare type current_as_old_for_TypeAlias_IContainerRuntimeBaseWithCombinedEvents = requireAssignableTo<TypeOnly<current.IContainerRuntimeBaseWithCombinedEvents>, TypeOnly<old.IContainerRuntimeBaseWithCombinedEvents>>
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ export class ContainerRuntime extends TypedEventEmitter<IContainerRuntimeEvents
get containerRuntime(): this;
// (undocumented)
createDataStore(pkg: Readonly<string | string[]>, loadingGroupId?: string): Promise<IDataStore>;
// @deprecated (undocumented)
_createDataStoreWithProps(pkg: Readonly<string | string[]>, props?: any): Promise<IDataStore>;
// (undocumented)
createDetachedDataStore(pkg: Readonly<string[]>, loadingGroupId?: string): IFluidDataStoreContextDetached;
createSummary(blobRedirectTable?: Map<string, string>, telemetryContext?: ITelemetryContext): ISummaryTree;
Expand Down
12 changes: 11 additions & 1 deletion packages/runtime/container-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,17 @@
"typescript": "~5.4.5"
},
"typeValidation": {
"broken": {},
"broken": {
"Class_ContainerRuntime": {
"backCompat": false
},
"Class_DocumentsSchemaController": {
"forwardCompat": false
},
"ClassStatics_ContainerRuntime": {
"backCompat": false
}
},
"entrypoint": "legacy"
}
}
19 changes: 0 additions & 19 deletions packages/runtime/container-runtime/src/containerRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3377,25 +3377,6 @@ export class ContainerRuntime
);
}

/**
* @deprecated 0.16 Issue #1537, #3631
*/
public async _createDataStoreWithProps(
pkg: Readonly<string | string[]>,
props?: any,
): Promise<IDataStore> {
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ declare type old_as_current_for_Class_ContainerRuntime = requireAssignableTo<Typ
* typeValidation.broken:
* "Class_ContainerRuntime": {"backCompat": false}
*/
// @ts-expect-error compatibility expected to be broken
declare type current_as_old_for_Class_ContainerRuntime = requireAssignableTo<TypeOnly<current.ContainerRuntime>, TypeOnly<old.ContainerRuntime>>

/*
Expand Down Expand Up @@ -85,6 +86,7 @@ declare type current_as_old_for_Class_SummaryCollection = requireAssignableTo<Ty
* typeValidation.broken:
* "ClassStatics_ContainerRuntime": {"backCompat": false}
*/
// @ts-expect-error compatibility expected to be broken
declare type current_as_old_for_ClassStatics_ContainerRuntime = requireAssignableTo<TypeOnly<typeof current.ContainerRuntime>, TypeOnly<typeof old.ContainerRuntime>>

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ export interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeB
// (undocumented)
readonly clientDetails: IClientDetails;
createDataStore(pkg: Readonly<string | string[]>, loadingGroupId?: string): Promise<IDataStore>;
// @deprecated (undocumented)
_createDataStoreWithProps(pkg: Readonly<string | string[]>, props?: any, id?: string): Promise<IDataStore>;
createDetachedDataStore(pkg: Readonly<string[]>, loadingGroupId?: string): IFluidDataStoreContextDetached;
// (undocumented)
readonly disposed: boolean;
Expand Down
15 changes: 14 additions & 1 deletion packages/runtime/runtime-definitions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
9 changes: 0 additions & 9 deletions packages/runtime/runtime-definitions/src/dataStoreContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,6 @@ export interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeB
*/
submitSignal: (type: string, content: unknown, targetClientId?: string) => void;

/**
* @deprecated 0.16 Issue #1537, #3631
*/
_createDataStoreWithProps(
pkg: Readonly<string | string[]>,
props?: any,
id?: string,
): Promise<IDataStore>;

/**
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ declare type current_as_old_for_Interface_IAttachMessage = requireAssignableTo<T
* typeValidation.broken:
* "Interface_IContainerRuntimeBase": {"backCompat": false}
*/
// @ts-expect-error compatibility expected to be broken
declare type current_as_old_for_Interface_IContainerRuntimeBase = requireAssignableTo<TypeOnly<current.IContainerRuntimeBase>, TypeOnly<old.IContainerRuntimeBase>>

/*
Expand Down Expand Up @@ -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<current.IFluidDataStoreContext>, TypeOnly<old.IFluidDataStoreContext>>

/*
Expand All @@ -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<current.IFluidDataStoreContextDetached>, TypeOnly<old.IFluidDataStoreContextDetached>>

/*
Expand Down Expand Up @@ -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<current.IFluidParentContext>, TypeOnly<old.IFluidParentContext>>

/*
Expand Down
9 changes: 8 additions & 1 deletion packages/runtime/test-runtime-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,14 @@
"typescript": "~5.4.5"
},
"typeValidation": {
"broken": {},
"broken": {
"Class_MockFluidDataStoreContext": {
"backCompat": false
},
"ClassStatics_MockFluidDataStoreContext": {
"backCompat": false
}
},
"entrypoint": "legacy"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<current.MockFluidDataStoreContext>, TypeOnly<old.MockFluidDataStoreContext>>

/*
Expand Down Expand Up @@ -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<typeof current.MockFluidDataStoreContext>, TypeOnly<typeof old.MockFluidDataStoreContext>>

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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";

Expand Down
9 changes: 8 additions & 1 deletion packages/test/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,14 @@
"typescript": "~5.4.5"
},
"typeValidation": {
"broken": {},
"broken": {
"Interface_IProvideTestFluidObject": {
"backCompat": false
},
"Interface_ITestFluidObject": {
"backCompat": false
}
},
"entrypoint": "legacy"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<current.IProvideTestFluidObject>, TypeOnly<old.IProvideTestFluidObject>>

/*
Expand All @@ -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<current.ITestFluidObject>, TypeOnly<old.ITestFluidObject>>
Loading