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 14 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 @@ -287,12 +277,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 @@ -327,10 +311,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 @@ -341,14 +321,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 @@ -380,29 +355,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 @@ -457,18 +409,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 @@ -522,50 +462,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 @@ -600,39 +501,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
1 change: 1 addition & 0 deletions packages/dds/merge-tree/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
"typescript": "~5.4.5"
},
"typeValidation": {
"disabled": true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

waiting to update closer until this can be merged

"broken": {
"Interface_IMergeTreeDeltaOpArgs": {
"backCompat": false
Expand Down
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 @@ -884,9 +884,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 @@ -1006,7 +1006,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 @@ -1170,7 +1169,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 @@ -65,7 +65,6 @@ export {
ISegment,
ISegmentAction,
Marker,
MergeNode,
reservedMarkerIdKey,
reservedMarkerSimpleTypeKey,
SegmentGroup,
Expand Down Expand Up @@ -123,7 +122,6 @@ export {
reservedRangeLabelsKey,
reservedTileLabelsKey,
} from "./referencePositions.js";
export { SegmentGroupCollection } from "./segmentGroupCollection.js";
export { PropertiesManager, PropertiesRollback } from "./segmentPropertiesManager.js";
export {
InteriorSequencePlace,
Expand Down
17 changes: 6 additions & 11 deletions packages/dds/merge-tree/src/localReference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { assert } from "@fluidframework/core-utils/internal";
import { UsageError } from "@fluidframework/telemetry-utils/internal";

import { DoublyLinkedList, ListNode, walkList } from "./collections/index.js";
import { ISegmentInternal, type ISegment } from "./mergeTreeNodes.js";
import { type ISegmentInternal } from "./mergeTreeNodes.js";
import { TrackingGroup, TrackingGroupCollection } from "./mergeTreeTracking.js";
import { ReferenceType } from "./ops.js";
import { PropertySet, addProperties } from "./properties.js";
Expand Down Expand Up @@ -79,10 +79,6 @@ export interface LocalReferencePosition extends ReferencePosition {
addProperties(newProps: PropertySet): void;
}

/**
* @privateRemarks This should not be exported outside merge tree.
* @internal
*/
class LocalReference implements LocalReferencePosition {
public properties: PropertySet | undefined;

Expand Down Expand Up @@ -226,11 +222,10 @@ export function setValidateRefCount(
* Represents a collection of {@link LocalReferencePosition}s associated with one segment in a merge-tree.
* @sealed
*
* @legacy
* @alpha
* @internal
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Non-deprecated class is being removed from legacy API

export class LocalReferenceCollection {
public static append(seg1: ISegment, seg2: ISegment): void {
public static append(seg1: ISegmentInternal, seg2: ISegmentInternal): void {
if (seg2.localRefs && !seg2.localRefs.empty) {
if (!seg1.localRefs) {
seg1.localRefs = new LocalReferenceCollection(seg1);
Expand All @@ -249,7 +244,7 @@ export class LocalReferenceCollection {
validateRefCount?.(seg2.localRefs);
}

public static setOrGet(segment: ISegment): LocalReferenceCollection {
public static setOrGet(segment: ISegmentInternal): LocalReferenceCollection {
return (segment.localRefs ??= new LocalReferenceCollection(segment));
}

Expand All @@ -260,7 +255,7 @@ export class LocalReferenceCollection {
/**
* The segment this `LocalReferenceCollection` is associated with.
*/
private readonly segment: ISegment,
private readonly segment: ISegmentInternal,
initialRefsByfOffset: (IRefsAtOffset | undefined)[] = Array.from({
length: segment.cachedLength,
}),
Expand Down Expand Up @@ -460,7 +455,7 @@ export class LocalReferenceCollection {
*
* @remarks This method should only be called by mergeTree.
*/
public split(offset: number, splitSeg: ISegment): void {
public split(offset: number, splitSeg: ISegmentInternal): void {
if (this.empty) {
// shrink the offset array when empty and splitting
this.refsByOffset.length = offset;
Expand Down
Loading
Loading