Skip to content
Draft
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
9 changes: 9 additions & 0 deletions .changeset/fine-areas-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@fluidframework/ordered-collection": minor
"__section": breaking
---
Remove deprecated ConsensusQueueClass export

The deprecated legacy beta export of `ConsensusQueueClass` has been removed:
Use the `ConsensusQueue` singleton (which implements `ISharedObjectKind<IConsensusOrderedCollection>`) instead.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should reference the deprecation issue #26691

The deprecated legacy beta export of the `ConsensusQueue` type now points to `IConsensusOrderedCollection`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As ConsensusQueue type is already deprecated, can we also remove it in this PR? OR should it stick around ... and we consider undeprecating.

Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,7 @@ export class ConsensusOrderedCollection<T = any> extends SharedObject<IConsensus
export const ConsensusQueue: ISharedObjectKind<IConsensusOrderedCollection<any>> & SharedObjectKind<IConsensusOrderedCollection<any>>;

// @beta @deprecated @legacy
export type ConsensusQueue<T = any> = ConsensusQueueClass<T>;

// @beta @deprecated @legacy
export class ConsensusQueueClass<T = any> extends ConsensusOrderedCollection<T> {
constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
}
export type ConsensusQueue<T = any> = IConsensusOrderedCollection<T>;

// @beta @legacy (undocumented)
export enum ConsensusResult {
Expand Down
13 changes: 12 additions & 1 deletion packages/dds/ordered-collection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,18 @@
"typescript": "~5.4.5"
},
"typeValidation": {
"broken": {},
"broken": {
"Class_ConsensusQueueClass": {
"forwardCompat": false,
"backCompat": false
},
"TypeAlias_ConsensusQueue": {
"backCompat": false
},
"ClassStatics_ConsensusQueueClass": {
"backCompat": false
}
},
"entrypoint": "legacy"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ export class ConsensusQueueFactory implements IConsensusOrderedCollectionFactory
}

/**
* {@inheritDoc ConsensusQueueClass}
* Shared object kind for queue-shaped ordered collections.
* @legacy @beta
*/
export const ConsensusQueue = createSharedObjectKind(ConsensusQueueFactory);

/**
* {@inheritDoc ConsensusQueueClass}
* {@inheritDoc IConsensusOrderedCollection}
* @deprecated Use {@link IConsensusOrderedCollection} for typing instead. This type alias will be removed in a future release.
* @legacy @beta
*/
// TODO: #22835 Use undefined instead of any (breaking change)
// eslint-disable-next-line @typescript-eslint/no-explicit-any, import-x/no-deprecated
export type ConsensusQueue<T = any> = ConsensusQueueClass<T>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type ConsensusQueue<T = any> = IConsensusOrderedCollection<T>;
2 changes: 0 additions & 2 deletions packages/dds/ordered-collection/src/consensusQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ class SnapshotableQueue<T> extends SnapshotableArray<T> implements IOrderedColle
* Implementation of a consensus stack
*
* An derived type of ConsensusOrderedCollection with a queue as the backing data and order.
* @deprecated Use the `ConsensusQueue` singleton and {@link IConsensusOrderedCollection} for typing. This implementation class will be removed in a future release.
* @legacy @beta
*/
// TODO: #22835 Use undefined instead of any (breaking change)
// eslint-disable-next-line @typescript-eslint/no-explicit-any, import-x/no-deprecated
Expand Down
1 change: 0 additions & 1 deletion packages/dds/ordered-collection/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export {
} from "./interfaces.js";
export { ConsensusQueueFactory, ConsensusQueue } from "./consensusOrderedCollectionFactory.js";
export { ConsensusOrderedCollection } from "./consensusOrderedCollection.js";
export { ConsensusQueueClass } from "./consensusQueue.js";
export {
acquireAndComplete,
waitAcquireAndComplete,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ import {
} from "@fluidframework/test-runtime-utils/internal";

import { ConsensusOrderedCollection } from "../consensusOrderedCollection.js";
import {
ConsensusQueueFactory,
type ConsensusQueue,
} from "../consensusOrderedCollectionFactory.js";
import { ConsensusQueueFactory } from "../consensusOrderedCollectionFactory.js";
import { ConsensusQueueClass } from "../consensusQueue.js";
import { ConsensusResult, type IConsensusOrderedCollection } from "../interfaces.js";
import {
Expand All @@ -41,7 +38,7 @@ class TestConsensusQueue extends ConsensusQueueClass {
function createConnectedCollection(
id: string,
runtimeFactory: MockContainerRuntimeFactory,
): ConsensusQueue {
): ConsensusQueueClass {
const dataStoreRuntime = new MockFluidDataStoreRuntime();
runtimeFactory.createContainerRuntime(dataStoreRuntime);
const services: IChannelServices = {
Expand All @@ -52,12 +49,12 @@ function createConnectedCollection(
const factory = new ConsensusQueueFactory();
const testCollection = factory.create(dataStoreRuntime, id);
testCollection.connect(services);
return testCollection as ConsensusQueue;
return testCollection as ConsensusQueueClass;
}

function createLocalCollection(id: string): ConsensusQueue {
function createLocalCollection(id: string): ConsensusQueueClass {
const factory = new ConsensusQueueFactory();
return factory.create(new MockFluidDataStoreRuntime(), id) as ConsensusQueue;
return factory.create(new MockFluidDataStoreRuntime(), id) as ConsensusQueueClass;
}

function createCollectionForReconnection(
Expand Down Expand Up @@ -155,7 +152,7 @@ describe("ConsensusOrderedCollection", () => {
const acquiredValue = (await removeItem()) as IFluidHandleInternal;

assert.strictEqual(acquiredValue.absolutePath, handle.absolutePath);
const dataStore = (await handle.get()) as ConsensusQueue;
const dataStore = (await handle.get()) as ConsensusQueueClass;
assert.strictEqual(dataStore.handle.absolutePath, testCollection.handle.absolutePath);

assert.strictEqual(await removeItem(), undefined);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ declare type current_as_old_for_Class_ConsensusOrderedCollection = requireAssign
* typeValidation.broken:
* "Class_ConsensusQueueClass": {"forwardCompat": false}
*/
// @ts-expect-error compatibility expected to be broken
declare type old_as_current_for_Class_ConsensusQueueClass = requireAssignableTo<TypeOnly<old.ConsensusQueueClass>, TypeOnly<current.ConsensusQueueClass>>

/*
Expand All @@ -51,6 +52,7 @@ declare type old_as_current_for_Class_ConsensusQueueClass = requireAssignableTo<
* typeValidation.broken:
* "Class_ConsensusQueueClass": {"backCompat": false}
*/
// @ts-expect-error compatibility expected to be broken
declare type current_as_old_for_Class_ConsensusQueueClass = requireAssignableTo<TypeOnly<current.ConsensusQueueClass>, TypeOnly<old.ConsensusQueueClass>>

/*
Expand All @@ -69,6 +71,7 @@ declare type current_as_old_for_ClassStatics_ConsensusOrderedCollection = requir
* typeValidation.broken:
* "ClassStatics_ConsensusQueueClass": {"backCompat": false}
*/
// @ts-expect-error compatibility expected to be broken
declare type current_as_old_for_ClassStatics_ConsensusQueueClass = requireAssignableTo<TypeOnly<typeof current.ConsensusQueueClass>, TypeOnly<typeof old.ConsensusQueueClass>>

/*
Expand Down Expand Up @@ -195,6 +198,7 @@ declare type old_as_current_for_TypeAlias_ConsensusQueue = requireAssignableTo<T
* typeValidation.broken:
* "TypeAlias_ConsensusQueue": {"backCompat": false}
*/
// @ts-expect-error compatibility expected to be broken
declare type current_as_old_for_TypeAlias_ConsensusQueue = requireAssignableTo<TypeOnly<current.ConsensusQueue>, TypeOnly<old.ConsensusQueue>>

/*
Expand Down
Loading