@fluidframework/merge-tree 3.0.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +30 -34
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +6 -7
- package/dist/client.js.map +1 -1
- package/dist/mergeTreeNodes.d.ts +0 -8
- package/dist/mergeTreeNodes.d.ts.map +1 -1
- package/dist/mergeTreeNodes.js +1 -11
- package/dist/mergeTreeNodes.js.map +1 -1
- package/dist/test/beastTest.spec.d.ts +0 -3
- package/dist/test/beastTest.spec.d.ts.map +1 -1
- package/dist/test/beastTest.spec.js +0 -201
- package/dist/test/beastTest.spec.js.map +1 -1
- package/dist/test/testServer.d.ts +1 -2
- package/dist/test/testServer.d.ts.map +1 -1
- package/dist/test/testServer.js +3 -6
- package/dist/test/testServer.js.map +1 -1
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +7 -8
- package/lib/client.js.map +1 -1
- package/lib/mergeTreeNodes.d.ts +0 -8
- package/lib/mergeTreeNodes.d.ts.map +1 -1
- package/lib/mergeTreeNodes.js +0 -8
- package/lib/mergeTreeNodes.js.map +1 -1
- package/lib/test/beastTest.spec.d.ts +0 -3
- package/lib/test/beastTest.spec.d.ts.map +1 -1
- package/lib/test/beastTest.spec.js +1 -199
- package/lib/test/beastTest.spec.js.map +1 -1
- package/lib/test/testServer.d.ts +1 -2
- package/lib/test/testServer.d.ts.map +1 -1
- package/lib/test/testServer.js +3 -6
- package/lib/test/testServer.js.map +1 -1
- package/package.json +15 -15
- package/src/client.ts +6 -8
- package/src/mergeTreeNodes.ts +0 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/merge-tree",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Merge tree",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -61,30 +61,30 @@
|
|
|
61
61
|
"temp-directory": "nyc/.nyc_output"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@fluid-internal/client-utils": "~3.0
|
|
65
|
-
"@fluidframework/container-definitions": "~3.0
|
|
66
|
-
"@fluidframework/core-interfaces": "~3.0
|
|
67
|
-
"@fluidframework/core-utils": "~3.0
|
|
68
|
-
"@fluidframework/datastore-definitions": "~3.0
|
|
69
|
-
"@fluidframework/driver-definitions": "~3.0
|
|
70
|
-
"@fluidframework/runtime-definitions": "~3.0
|
|
71
|
-
"@fluidframework/runtime-utils": "~3.0
|
|
72
|
-
"@fluidframework/shared-object-base": "~3.0
|
|
73
|
-
"@fluidframework/telemetry-utils": "~3.0
|
|
64
|
+
"@fluid-internal/client-utils": "~3.1.0",
|
|
65
|
+
"@fluidframework/container-definitions": "~3.1.0",
|
|
66
|
+
"@fluidframework/core-interfaces": "~3.1.0",
|
|
67
|
+
"@fluidframework/core-utils": "~3.1.0",
|
|
68
|
+
"@fluidframework/datastore-definitions": "~3.1.0",
|
|
69
|
+
"@fluidframework/driver-definitions": "~3.1.0",
|
|
70
|
+
"@fluidframework/runtime-definitions": "~3.1.0",
|
|
71
|
+
"@fluidframework/runtime-utils": "~3.1.0",
|
|
72
|
+
"@fluidframework/shared-object-base": "~3.1.0",
|
|
73
|
+
"@fluidframework/telemetry-utils": "~3.1.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
77
77
|
"@biomejs/biome": "~2.4.5",
|
|
78
|
-
"@fluid-internal/mocha-test-setup": "~3.0
|
|
79
|
-
"@fluid-private/stochastic-test-utils": "~3.0
|
|
80
|
-
"@fluid-private/test-pairwise-generator": "~3.0
|
|
78
|
+
"@fluid-internal/mocha-test-setup": "~3.1.0",
|
|
79
|
+
"@fluid-private/stochastic-test-utils": "~3.1.0",
|
|
80
|
+
"@fluid-private/test-pairwise-generator": "~3.1.0",
|
|
81
81
|
"@fluid-tools/benchmark": "^0.59.0",
|
|
82
82
|
"@fluid-tools/build-cli": "^0.67.0",
|
|
83
83
|
"@fluidframework/build-common": "^2.0.3",
|
|
84
84
|
"@fluidframework/build-tools": "^0.67.0",
|
|
85
85
|
"@fluidframework/eslint-config-fluid": "^14.0.0",
|
|
86
86
|
"@fluidframework/merge-tree-previous": "npm:@fluidframework/merge-tree@2.116.0",
|
|
87
|
-
"@fluidframework/test-runtime-utils": "~3.0
|
|
87
|
+
"@fluidframework/test-runtime-utils": "~3.1.0",
|
|
88
88
|
"@microsoft/api-extractor": "7.58.1",
|
|
89
89
|
"@types/diff": "^3.5.1",
|
|
90
90
|
"@types/mocha": "^10.0.10",
|
package/src/client.ts
CHANGED
|
@@ -31,7 +31,6 @@ import {
|
|
|
31
31
|
} from "@fluidframework/telemetry-utils/internal";
|
|
32
32
|
|
|
33
33
|
import { MergeTreeTextHelper, type IMergeTreeTextHelper } from "./MergeTreeTextHelper.js";
|
|
34
|
-
import { RedBlackTree } from "./collections/index.js";
|
|
35
34
|
import { NonCollabClient, SquashClient, UniversalSequenceNumber } from "./constants.js";
|
|
36
35
|
import { type LocalReferencePosition, SlidingPreference } from "./localReference.js";
|
|
37
36
|
import {
|
|
@@ -54,7 +53,6 @@ import {
|
|
|
54
53
|
type ISegmentPrivate,
|
|
55
54
|
type Marker,
|
|
56
55
|
type SegmentGroup,
|
|
57
|
-
compareStrings,
|
|
58
56
|
isSegmentLeaf,
|
|
59
57
|
type ISegmentInternal,
|
|
60
58
|
type ISegmentLeaf,
|
|
@@ -173,7 +171,7 @@ export class Client extends TypedEventEmitter<IClientEvents> {
|
|
|
173
171
|
|
|
174
172
|
private readonly _mergeTree: MergeTree;
|
|
175
173
|
|
|
176
|
-
private readonly clientNameToIds = new
|
|
174
|
+
private readonly clientNameToIds = new Map<string, number>();
|
|
177
175
|
private readonly shortClientIdMap: string[] = [];
|
|
178
176
|
|
|
179
177
|
/**
|
|
@@ -829,14 +827,14 @@ export class Client extends TypedEventEmitter<IClientEvents> {
|
|
|
829
827
|
}
|
|
830
828
|
|
|
831
829
|
getOrAddShortClientId(longClientId: string): number {
|
|
832
|
-
if (!this.clientNameToIds.
|
|
830
|
+
if (!this.clientNameToIds.has(longClientId)) {
|
|
833
831
|
this.addLongClientId(longClientId);
|
|
834
832
|
}
|
|
835
833
|
return this.getShortClientId(longClientId);
|
|
836
834
|
}
|
|
837
835
|
|
|
838
836
|
protected getShortClientId(longClientId: string): number {
|
|
839
|
-
return this.clientNameToIds.get(longClientId)
|
|
837
|
+
return this.clientNameToIds.get(longClientId)!;
|
|
840
838
|
}
|
|
841
839
|
|
|
842
840
|
getLongClientId(shortClientId: number): string {
|
|
@@ -844,7 +842,7 @@ export class Client extends TypedEventEmitter<IClientEvents> {
|
|
|
844
842
|
}
|
|
845
843
|
|
|
846
844
|
addLongClientId(longClientId: string): void {
|
|
847
|
-
this.clientNameToIds.
|
|
845
|
+
this.clientNameToIds.set(longClientId, this.shortClientIdMap.length);
|
|
848
846
|
this.shortClientIdMap.push(longClientId);
|
|
849
847
|
}
|
|
850
848
|
|
|
@@ -1718,9 +1716,9 @@ export class Client extends TypedEventEmitter<IClientEvents> {
|
|
|
1718
1716
|
);
|
|
1719
1717
|
} else {
|
|
1720
1718
|
const oldClientId = this.longClientId;
|
|
1721
|
-
const oldData = this.clientNameToIds.get(oldClientId)
|
|
1719
|
+
const oldData = this.clientNameToIds.get(oldClientId)!;
|
|
1722
1720
|
this.longClientId = longClientId;
|
|
1723
|
-
this.clientNameToIds.
|
|
1721
|
+
this.clientNameToIds.set(longClientId, oldData);
|
|
1724
1722
|
this.shortClientIdMap[oldData] = longClientId;
|
|
1725
1723
|
}
|
|
1726
1724
|
}
|
package/src/mergeTreeNodes.ts
CHANGED
|
@@ -694,13 +694,3 @@ export class CollaborationWindow {
|
|
|
694
694
|
};
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
|
-
|
|
698
|
-
/**
|
|
699
|
-
* Compares two numbers.
|
|
700
|
-
*/
|
|
701
|
-
export const compareNumbers = (a: number, b: number): number => a - b;
|
|
702
|
-
|
|
703
|
-
/**
|
|
704
|
-
* Compares two strings.
|
|
705
|
-
*/
|
|
706
|
-
export const compareStrings = (a: string, b: string): number => a.localeCompare(b);
|