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 api #22994

Closed
Show file tree
Hide file tree
Changes from 2 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
100 changes: 100 additions & 0 deletions .changeset/gold-maps-cut.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
"@fluidframework/agent-scheduler": minor
Copy link
Contributor

@anthony-murphy anthony-murphy Nov 6, 2024

Choose a reason for hiding this comment

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

while technically true, i'd trim this remove example, tests, experimental, private, and cases where the change really shouldn't be impactful

"@fluid-experimental/ai-collab": minor
"@fluidframework/app-insights-logger": minor
"@fluidframework/aqueduct": minor
"@fluid-experimental/attributable-map": minor
"@fluid-experimental/attributor": minor
"@fluidframework/azure-client": minor
"@fluidframework/azure-end-to-end-tests": minor
"@fluidframework/azure-local-service": minor
"@fluid-experimental/azure-scenario-runner": minor
"@fluidframework/azure-service-utils": minor
"@fluidframework/cell": minor
"@fluidframework/container-definitions": minor
"@fluidframework/container-loader": minor
"@fluidframework/container-runtime": minor
"@fluidframework/container-runtime-definitions": minor
"@fluidframework/core-interfaces": minor
"@fluidframework/core-utils": minor
"@fluidframework/counter": minor
"@fluid-experimental/data-object-base": minor
"@fluid-experimental/data-objects": minor
"@fluidframework/datastore": minor
"@fluidframework/datastore-definitions": minor
"@fluid-experimental/dds-interceptions": minor
"@fluidframework/debugger": minor
"@fluidframework/devtools": minor
"@fluidframework/devtools-core": minor
"@fluidframework/driver-base": minor
"@fluidframework/driver-definitions": minor
"@fluidframework/driver-utils": minor
"@fluidframework/driver-web-cache": minor
"@fluid-tools/fetch-tool": minor
"@fluidframework/file-driver": minor
"fluid-framework": minor
"@fluidframework/fluid-runner": minor
"@fluidframework/fluid-static": minor
"@fluidframework/fluid-telemetry": minor
"@fluidframework/id-compressor": minor
"@fluid-experimental/ink": minor
"@fluid-experimental/last-edited": minor
"@fluidframework/local-driver": minor
"@fluidframework/map": minor
"@fluidframework/matrix": minor
"@fluidframework/merge-tree": minor
"@fluidframework/odsp-client": minor
"@fluidframework/odsp-doclib-utils": minor
"@fluidframework/odsp-driver": minor
"@fluidframework/odsp-driver-definitions": minor
"@fluid-experimental/odsp-end-to-end-tests": minor
"@fluidframework/odsp-urlresolver": minor
"@fluid-experimental/oldest-client-observer": minor
"@fluidframework/ordered-collection": minor
"@fluid-experimental/ot": minor
"@fluid-experimental/pact-map": minor
"@fluid-experimental/presence": minor
"@fluid-experimental/property-changeset": minor
"@fluid-experimental/property-common": minor
"@fluid-experimental/property-dds": minor
"@fluid-experimental/property-properties": minor
"@fluidframework/register-collection": minor
"@fluidframework/replay-driver": minor
"@fluidframework/request-handler": minor
"@fluidframework/routerlicious-driver": minor
"@fluidframework/routerlicious-urlresolver": minor
"@fluidframework/runtime-definitions": minor
"@fluidframework/runtime-utils": minor
"@fluidframework/sequence": minor
"@fluid-experimental/sequence-deprecated": minor
"@fluidframework/shared-object-base": minor
"@fluidframework/shared-summary-block": minor
"@fluid-experimental/sharejs-json1": minor
"@fluid-private/stochastic-test-utils": minor
"@fluidframework/synthesize": minor
"@fluidframework/task-manager": minor
"@fluidframework/telemetry-utils": minor
"@fluid-private/test-dds-utils": minor
"@fluid-private/test-drivers": minor
"@fluid-private/test-end-to-end-tests": minor
"@fluid-private/test-loader-utils": minor
"@fluid-private/test-pairwise-generator": minor
"@fluidframework/test-runtime-utils": minor
"@fluidframework/test-utils": minor
"@fluid-private/test-version-utils": minor
"@fluidframework/tinylicious-client": minor
"@fluidframework/tinylicious-driver": minor
"@fluidframework/tool-utils": minor
"@fluid-experimental/tree": minor
"@fluidframework/tree": minor
"@fluid-experimental/tree-react-api": minor
"@fluidframework/undo-redo": minor
---

# Removed `_createDataStoreWithProps`

Removed two main APIs, `ContainerRuntime.createDataStoreWithProps` and `IContainerRuntimeBase.createDataStoreWithProps`
has been removed.

For alternative solutions use `PureDataObjectFactory.createInstanceWithDataStore` and pass in props via the `initialState`
parameter.
4 changes: 3 additions & 1 deletion packages/framework/aqueduct/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@
"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>>
6 changes: 5 additions & 1 deletion packages/runtime/container-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,11 @@
"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
6 changes: 5 additions & 1 deletion packages/runtime/datastore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@
"typescript": "~5.4.5"
},
"typeValidation": {
"broken": {},
"broken": {
"Class_FluidDataStoreRuntime": {
"forwardCompat": 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:
* "Class_FluidDataStoreRuntime": {"forwardCompat": false}
*/
// @ts-expect-error compatibility expected to be broken
declare type old_as_current_for_Class_FluidDataStoreRuntime = requireAssignableTo<TypeOnly<old.FluidDataStoreRuntime>, TypeOnly<current.FluidDataStoreRuntime>>

/*
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
15 changes: 14 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,20 @@
"typescript": "~5.4.5"
},
"typeValidation": {
"broken": {},
"broken": {
"Class_MockDeltaConnection": {
"forwardCompat": false
},
"Class_MockFluidDataStoreContext": {
"backCompat": false
},
"Class_MockFluidDataStoreRuntime": {
"forwardCompat": false
},
"ClassStatics_MockFluidDataStoreContext": {
"backCompat": false
}
},
"entrypoint": "legacy"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ declare type current_as_old_for_Class_MockContainerRuntimeForReconnection = requ
* typeValidation.broken:
* "Class_MockDeltaConnection": {"forwardCompat": false}
*/
// @ts-expect-error compatibility expected to be broken
declare type old_as_current_for_Class_MockDeltaConnection = requireAssignableTo<TypeOnly<old.MockDeltaConnection>, TypeOnly<current.MockDeltaConnection>>

/*
Expand Down Expand Up @@ -175,6 +176,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 All @@ -184,6 +186,7 @@ declare type current_as_old_for_Class_MockFluidDataStoreContext = requireAssigna
* typeValidation.broken:
* "Class_MockFluidDataStoreRuntime": {"forwardCompat": false}
*/
// @ts-expect-error compatibility expected to be broken
declare type old_as_current_for_Class_MockFluidDataStoreRuntime = requireAssignableTo<TypeOnly<old.MockFluidDataStoreRuntime>, TypeOnly<current.MockFluidDataStoreRuntime>>

/*
Expand Down Expand Up @@ -364,6 +367,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
5 changes: 4 additions & 1 deletion packages/test/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@
"typescript": "~5.4.5"
},
"typeValidation": {
"broken": {},
"broken": {
"Interface_IProvideTestFluidObject": {"backCompat": false},
"Interface_ITestFluidObject": {"backCompat": false}
},
"entrypoint": "legacy"
}
}
Loading
Loading