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

Test/remove i segment deprecations #22696

Draft
wants to merge 32 commits into
base: test/internal-merge-tree-client
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5e747b4
MergeTree: Separate Segment Interfaces Based on Visibility
anthony-murphy Sep 30, 2024
d59ee81
Merge branch 'main' of https://github.com/microsoft/FluidFramework in…
anthony-murphy Sep 30, 2024
319e1d4
Merge branch 'test/internal-merge-tree-client' into test/remove-ISegm…
anthony-murphy Oct 1, 2024
6905f27
remove deprecations
anthony-murphy Oct 1, 2024
e11b49c
Merge branch 'main' of https://github.com/microsoft/FluidFramework in…
anthony-murphy Oct 1, 2024
fb201de
Merge branch 'main' of https://github.com/microsoft/FluidFramework in…
anthony-murphy Oct 2, 2024
d251c2a
Merge branch 'main' of https://github.com/microsoft/FluidFramework in…
anthony-murphy Oct 2, 2024
47bdab0
fix tests
anthony-murphy Oct 2, 2024
3993dfc
Merge branch 'main' into test/remove-ISegment-deprecations
anthony-murphy Oct 3, 2024
37f754c
Merge branch 'main' into test/remove-ISegment-deprecations
anthony-murphy Oct 4, 2024
f1586dc
Merge branch 'main' into test/remove-ISegment-deprecations
anthony-murphy Oct 4, 2024
c112816
Merge branch 'main' into test/remove-ISegment-deprecations
anthony-murphy Oct 7, 2024
cb1c19f
Merge branch 'main' into test/remove-ISegment-deprecations
anthony-murphy Oct 7, 2024
f75264d
Merge branch 'test/internal-merge-tree-client' into test/remove-ISegm…
anthony-murphy Oct 8, 2024
8eb582a
Apply suggestions from code review
anthony-murphy Oct 8, 2024
c5d6026
Merge branch 'test/internal-merge-tree-client' into test/remove-ISegm…
anthony-murphy Oct 8, 2024
a3c4896
remove missed method
anthony-murphy Oct 8, 2024
704f29f
Merge branch 'test/internal-merge-tree-client' into test/remove-ISegm…
anthony-murphy Oct 8, 2024
f4cf507
Merge branch 'test/internal-merge-tree-client' into test/remove-ISegm…
anthony-murphy Oct 10, 2024
34d54ad
Merge branch 'test/internal-merge-tree-client' into test/remove-ISegm…
anthony-murphy Oct 15, 2024
74eda59
Merge branch 'test/internal-merge-tree-client' into test/remove-ISegm…
anthony-murphy Oct 17, 2024
6575577
Merge branch 'test/internal-merge-tree-client' into test/remove-ISegm…
anthony-murphy Oct 17, 2024
802a21f
Merge branch 'test/internal-merge-tree-client' into test/remove-ISegm…
anthony-murphy Oct 18, 2024
0663c9b
Merge branch 'test/internal-merge-tree-client' into test/remove-ISegm…
anthony-murphy Oct 25, 2024
684644b
Merge branch 'test/internal-merge-tree-client' into test/remove-ISegm…
anthony-murphy Oct 29, 2024
393f5de
Merge branch 'test/internal-merge-tree-client' into test/remove-ISegm…
anthony-murphy Oct 29, 2024
f2e2e8d
Merge branch 'test/internal-merge-tree-client' into test/remove-ISegm…
anthony-murphy Oct 30, 2024
bfeab60
Merge branch 'test/internal-merge-tree-client' into test/remove-ISegm…
anthony-murphy Oct 31, 2024
525cea2
Merge branch 'test/internal-merge-tree-client' into test/remove-ISegm…
anthony-murphy Oct 31, 2024
65fd710
Merge branch 'test/internal-merge-tree-client' into test/remove-ISegm…
anthony-murphy Oct 31, 2024
e3d1a48
Merge branch 'test/internal-merge-tree-client' into test/remove-ISegm…
anthony-murphy Oct 31, 2024
5fc4397
enable type tests
anthony-murphy Oct 31, 2024
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
3 changes: 2 additions & 1 deletion packages/dds/matrix/src/test/matrix.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
IChannelServices,
type IChannel,
} from "@fluidframework/datastore-definitions/internal";
import type { ISegmentInternal } from "@fluidframework/merge-tree/internal";
import {
MockContainerRuntimeFactory,
MockContainerRuntimeFactoryForReconnection,
Expand Down Expand Up @@ -967,7 +968,7 @@ describe("Matrix1", () => {

function findVectorReferenceCount(vector: PermutationVector): number {
let count = 0;
vector.walkSegments((segment) => {
vector.walkSegments((segment: ISegmentInternal) => {
count += [...(segment.localRefs ?? [])].length;
return true;
});
Expand Down
132 changes: 0 additions & 132 deletions packages/dds/merge-tree/api-report/merge-tree.legacy.alpha.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ export function appendToMergeTreeDeltaRevertibles(deltaArgs: IMergeTreeDeltaCall
// @alpha (undocumented)
export abstract class BaseSegment implements ISegment {
constructor(properties?: PropertySet);
// @deprecated (undocumented)
ack(segmentGroup: SegmentGroup, opArgs: IMergeTreeDeltaOpArgs): boolean;
// @deprecated
addProperties(newProps: PropertySet, seq?: number, collaborating?: boolean, rollback?: PropertiesRollback): PropertySet;
// (undocumented)
protected addSerializedProps(jseg: IJSONSegment): void;
// (undocumented)
Expand Down Expand Up @@ -41,8 +37,6 @@ export abstract class BaseSegment implements ISegment {
// (undocumented)
localMovedSeq?: number;
// (undocumented)
localRefs?: LocalReferenceCollection;
// (undocumented)
localRemovedSeq?: number;
// (undocumented)
localSeq?: number;
Expand All @@ -56,14 +50,10 @@ export abstract class BaseSegment implements ISegment {
ordinal: string;
// (undocumented)
properties?: PropertySet;
// @deprecated
propertyManager?: PropertiesManager;
// (undocumented)
removedClientIds?: number[];
// (undocumented)
removedSeq?: number;
// @deprecated (undocumented)
readonly segmentGroups: SegmentGroupCollection;
// (undocumented)
seq: number;
// (undocumented)
Expand Down Expand Up @@ -300,12 +290,6 @@ export interface IMergeTreeSegmentDelta {
segment: ISegment;
}

// @alpha @deprecated (undocumented)
export interface IMergeTreeTextHelper {
// (undocumented)
getText(refSeq: number, clientId: number, placeholder: string, start?: number, end?: number): string;
}

// @alpha
export interface IMoveInfo {
localMovedSeq?: number;
Expand Down Expand Up @@ -340,10 +324,6 @@ export interface IRemovalInfo {

// @alpha
export interface ISegment extends IMergeNodeCommon, Partial<IRemovalInfo>, Partial<IMoveInfo> {
// @deprecated (undocumented)
ack(segmentGroup: SegmentGroup, opArgs: IMergeTreeDeltaOpArgs): boolean;
// @deprecated
addProperties(newProps: PropertySet, seq?: number, collaborating?: boolean, rollback?: PropertiesRollback): PropertySet;
// (undocumented)
append(segment: ISegment): void;
attribution?: IAttributionCollection<AttributionKey>;
Expand All @@ -354,14 +334,9 @@ export interface ISegment extends IMergeNodeCommon, Partial<IRemovalInfo>, Parti
// (undocumented)
clone(): ISegment;
readonly endpointType?: "start" | "end";
localRefs?: LocalReferenceCollection;
localRemovedSeq?: number;
localSeq?: number;
properties?: PropertySet;
// @deprecated
propertyManager?: PropertiesManager;
// @deprecated (undocumented)
readonly segmentGroups: SegmentGroupCollection;
seq?: number;
// (undocumented)
splitAt(pos: number): ISegment | undefined;
Expand Down Expand Up @@ -393,29 +368,6 @@ export interface ITrackingGroup {
unlink(trackable: Trackable): boolean;
}

// @alpha @sealed
export class LocalReferenceCollection {
[Symbol.iterator](): {
next(): IteratorResult<LocalReferencePosition>;
[Symbol.iterator](): IterableIterator<LocalReferencePosition>;
};
addAfterTombstones(...refs: Iterable<LocalReferencePosition>[]): void;
addBeforeTombstones(...refs: Iterable<LocalReferencePosition>[]): void;
addLocalRef(lref: LocalReferencePosition, offset: number): void;
// (undocumented)
static append(seg1: ISegment, seg2: ISegment): void;
append(other: LocalReferenceCollection): void;
createLocalRef(offset: number, refType: ReferenceType, properties: PropertySet | undefined, slidingPreference?: SlidingPreference, canSlideToEndpoint?: boolean): LocalReferencePosition;
get empty(): boolean;
has(lref: ReferencePosition): boolean;
isAfterTombstone(lref: LocalReferencePosition): boolean;
removeLocalRef(lref: LocalReferencePosition): LocalReferencePosition | undefined;
// (undocumented)
static setOrGet(segment: ISegment): LocalReferenceCollection;
split(offset: number, splitSeg: ISegment): void;
walkReferences(visitor: (lref: LocalReferencePosition) => boolean | void | undefined, start?: LocalReferencePosition, forward?: boolean): boolean;
}

// @alpha @sealed (undocumented)
export interface LocalReferencePosition extends ReferencePosition {
// (undocumented)
Expand Down Expand Up @@ -470,18 +422,6 @@ export class Marker extends BaseSegment implements ReferencePosition, ISegment {
readonly type = "Marker";
}

// @alpha @deprecated (undocumented)
export class MergeNode implements IMergeNodeCommon {
// (undocumented)
cachedLength: number;
// (undocumented)
index: number;
// (undocumented)
isLeaf(): this is ISegment;
// (undocumented)
ordinal: string;
}

// @alpha (undocumented)
export type MergeTreeDeltaOperationType = typeof MergeTreeDeltaType.ANNOTATE | typeof MergeTreeDeltaType.INSERT | typeof MergeTreeDeltaType.REMOVE | typeof MergeTreeDeltaType.OBLITERATE;

Expand Down Expand Up @@ -535,50 +475,11 @@ export interface MergeTreeRevertibleDriver {
removeRange(start: number, end: number): void;
}

// @alpha @deprecated (undocumented)
export interface ObliterateInfo {
// (undocumented)
clientId: number;
// (undocumented)
end: LocalReferencePosition;
// (undocumented)
localSeq: number | undefined;
// (undocumented)
refSeq: number;
// (undocumented)
segmentGroup: SegmentGroup | undefined;
// (undocumented)
seq: number;
// (undocumented)
start: LocalReferencePosition;
}

// @alpha @deprecated (undocumented)
export class PropertiesManager {
// (undocumented)
ackPendingProperties(annotateOp: IMergeTreeAnnotateMsg): void;
// (undocumented)
addProperties(oldProps: PropertySet, newProps: PropertySet, seq?: number, collaborating?: boolean, rollback?: PropertiesRollback): PropertySet;
// (undocumented)
copyTo(oldProps: PropertySet, newProps: PropertySet | undefined, newManager: PropertiesManager): PropertySet | undefined;
hasPendingProperties(props: PropertySet): boolean;
// (undocumented)
hasPendingProperty(key: string): boolean;
}

// @alpha @deprecated (undocumented)
export enum PropertiesRollback {
None = 0,
Rollback = 1
}

// @alpha
export type PropertySet = MapLike<any>;

// @alpha
export interface ReferencePosition {
// @deprecated (undocumented)
addProperties(newProps: PropertySet): void;
getOffset(): number;
getSegment(): ISegment | undefined;
// (undocumented)
Expand Down Expand Up @@ -613,39 +514,6 @@ export const reservedMarkerIdKey = "markerId";
// @alpha
export function revertMergeTreeDeltaRevertibles(driver: MergeTreeRevertibleDriver, revertibles: MergeTreeDeltaRevertible[]): void;

// @alpha @deprecated (undocumented)
export interface SegmentGroup {
// (undocumented)
localSeq?: number;
// (undocumented)
obliterateInfo?: ObliterateInfo;
// (undocumented)
previousProps?: PropertySet[];
// (undocumented)
refSeq: number;
// (undocumented)
segments: ISegment[];
}

// @alpha @deprecated (undocumented)
export class SegmentGroupCollection {
constructor(segment: ISegment);
// (undocumented)
copyTo(segment: ISegment): void;
// (undocumented)
dequeue(): SegmentGroup | undefined;
// (undocumented)
get empty(): boolean;
// (undocumented)
enqueue(segmentGroup: SegmentGroup): void;
// (undocumented)
pop?(): SegmentGroup | undefined;
// (undocumented)
remove?(segmentGroup: SegmentGroup): boolean;
// (undocumented)
get size(): number;
}

// @alpha (undocumented)
export interface SequenceOffsets {
// (undocumented)
Expand Down
75 changes: 74 additions & 1 deletion packages/dds/merge-tree/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,80 @@
"typescript": "~5.4.5"
},
"typeValidation": {
"broken": {},
"broken": {
"Class_BaseSegment": {
"backCompat": false
},
"Class_Marker": {
"backCompat": false
},
"Class_MergeNode": {
"backCompat": false,
"forwardCompat": false
},
"Class_TextSegment": {
"backCompat": false
},
"Class_TrackingGroup": {
"backCompat": false
},
"Class_SegmentGroupCollection": {
"backCompat": false,
"forwardCompat": false
},
"ClassStatics_BaseSegment": {
"backCompat": false
},
"ClassStatics_Marker": {
"backCompat": false
},
"ClassStatics_MergeNode": {
"backCompat": false
},
"ClassStatics_TextSegment": {
"backCompat": false
},
"ClassStatics_TrackingGroup": {
"backCompat": false
},
"ClassStatics_SegmentGroupCollection": {
"backCompat": false
},
"Interface_IMergeTreeDeltaCallbackArgs": {
"backCompat": false
},
"Interface_IMergeTreeMaintenanceCallbackArgs": {
"backCompat": false
},
"Interface_IMergeTreeSegmentDelta": {
"backCompat": false
},
"Interface_IMoveInfo": {
"backCompat": false
},
"Interface_ISegment": {
"backCompat": false
},
"Interface_ITrackingGroup": {
"backCompat": false
},
"Interface_ObliterateInfo": {
"backCompat": false
},
"Interface_ReferencePosition": {
"backCompat": false
},
"Interface_SegmentGroup": {
"backCompat": false
},

"TypeAlias_MergeTreeDeltaRevertible": {
"backCompat": false
},
"TypeAlias_Trackable": {
"backCompat": false
}
},
"entrypoint": "legacy"
}
}
6 changes: 2 additions & 4 deletions packages/dds/merge-tree/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -888,9 +888,9 @@ export class Client extends TypedEventEmitter<IClientEvents> {
// so their recalculated positions will be correct.
for (const segment of segmentGroup.segments.sort((a, b) =>
a.ordinal < b.ordinal ? -1 : 1,
)) {
) as ISegmentLeaf[]) {
assert(
segment.segmentGroups.remove?.(segmentGroup) === true,
segment.segmentGroups?.remove?.(segmentGroup) === true,
0x035 /* "Segment group not in segment pending queue" */,
);
assert(
Expand Down Expand Up @@ -1010,7 +1010,6 @@ export class Client extends TypedEventEmitter<IClientEvents> {
opList.push(newOp);
}
} else if (newOp) {
// eslint-disable-next-line import/no-deprecated
const newSegmentGroup: SegmentGroup = {
segments: [],
localSeq: segmentGroup.localSeq,
Expand Down Expand Up @@ -1174,7 +1173,6 @@ export class Client extends TypedEventEmitter<IClientEvents> {
segmentGroup: SegmentGroup | SegmentGroup[],
): IMergeTreeOp {
if (this.pendingRebase === undefined || this.pendingRebase.empty) {
// eslint-disable-next-line import/no-deprecated
let firstGroup: SegmentGroup;
if (Array.isArray(segmentGroup)) {
if (segmentGroup.length === 0) {
Expand Down
2 changes: 0 additions & 2 deletions packages/dds/merge-tree/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export {
ISegment,
ISegmentAction,
Marker,
MergeNode,
reservedMarkerIdKey,
reservedMarkerSimpleTypeKey,
SegmentGroup,
Expand Down Expand Up @@ -124,7 +123,6 @@ export {
reservedRangeLabelsKey,
reservedTileLabelsKey,
} from "./referencePositions.js";
export { SegmentGroupCollection } from "./segmentGroupCollection.js";
export { PropertiesManager, PropertiesRollback } from "./segmentPropertiesManager.js";
export {
InteriorSequencePlace,
Expand Down
Loading
Loading