@fluidframework/merge-tree 0.51.0 → 0.52.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/dist/collections.d.ts +41 -92
- package/dist/collections.d.ts.map +1 -1
- package/dist/collections.js +4 -334
- package/dist/collections.js.map +1 -1
- package/dist/index.d.ts +10 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -12
- package/dist/index.js.map +1 -1
- package/dist/localReference.d.ts +2 -2
- package/dist/localReference.d.ts.map +1 -1
- package/dist/localReference.js +0 -1
- package/dist/localReference.js.map +1 -1
- package/dist/snapshotV1.d.ts +1 -1
- package/dist/snapshotV1.d.ts.map +1 -1
- package/dist/snapshotV1.js.map +1 -1
- package/dist/snapshotlegacy.d.ts +7 -28
- package/dist/snapshotlegacy.d.ts.map +1 -1
- package/dist/snapshotlegacy.js.map +1 -1
- package/lib/collections.d.ts +41 -92
- package/lib/collections.d.ts.map +1 -1
- package/lib/collections.js +5 -326
- package/lib/collections.js.map +1 -1
- package/lib/index.d.ts +10 -11
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +10 -11
- package/lib/index.js.map +1 -1
- package/lib/localReference.d.ts +2 -2
- package/lib/localReference.d.ts.map +1 -1
- package/lib/localReference.js +0 -1
- package/lib/localReference.js.map +1 -1
- package/lib/snapshotV1.d.ts +1 -1
- package/lib/snapshotV1.d.ts.map +1 -1
- package/lib/snapshotV1.js.map +1 -1
- package/lib/snapshotlegacy.d.ts +7 -28
- package/lib/snapshotlegacy.d.ts.map +1 -1
- package/lib/snapshotlegacy.js.map +1 -1
- package/package.json +9 -8
- package/src/collections.ts +109 -470
- package/src/index.ts +10 -11
- package/src/localReference.ts +3 -4
- package/src/snapshotV1.ts +1 -1
- package/src/snapshotlegacy.ts +9 -22
package/src/index.ts
CHANGED
|
@@ -3,21 +3,20 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export * from "./mergeTree";
|
|
7
|
-
export * from "./ops";
|
|
8
|
-
export * from "./properties";
|
|
9
|
-
export * from "./snapshotlegacy";
|
|
10
|
-
export * from "./collections";
|
|
11
6
|
export * from "./base";
|
|
12
|
-
export { loadSegments } from "./text";
|
|
13
7
|
export * from "./client";
|
|
14
|
-
export * from "./
|
|
8
|
+
export * from "./collections";
|
|
9
|
+
export * from "./constants";
|
|
10
|
+
export * from "./localReference";
|
|
11
|
+
export * from "./mergeTree";
|
|
15
12
|
export * from "./mergeTreeDeltaCallback";
|
|
16
|
-
export * from "./opBuilder";
|
|
17
13
|
export * from "./mergeTreeTracking";
|
|
14
|
+
export * from "./opBuilder";
|
|
15
|
+
export * from "./ops";
|
|
16
|
+
export * from "./properties";
|
|
17
|
+
export * from "./segmentGroupCollection";
|
|
18
18
|
export * from "./segmentPropertiesManager";
|
|
19
|
+
export * from "./snapshotlegacy";
|
|
19
20
|
export * from "./sortedSegmentSet";
|
|
21
|
+
export { loadSegments } from "./text";
|
|
20
22
|
export * from "./textSegment";
|
|
21
|
-
export * from "./localReference";
|
|
22
|
-
export * from "./snapshotLoader";
|
|
23
|
-
export * from "./constants";
|
package/src/localReference.ts
CHANGED
|
@@ -110,7 +110,6 @@ export class LocalReference implements ReferencePosition {
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
public getOffset() {
|
|
113
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
114
113
|
if (this.segment?.removedSeq) {
|
|
115
114
|
return 0;
|
|
116
115
|
}
|
|
@@ -122,7 +121,7 @@ export class LocalReference implements ReferencePosition {
|
|
|
122
121
|
}
|
|
123
122
|
}
|
|
124
123
|
|
|
125
|
-
interface
|
|
124
|
+
interface IRefsAtOffset {
|
|
126
125
|
before?: LocalReference[];
|
|
127
126
|
at?: LocalReference[];
|
|
128
127
|
after?: LocalReference[];
|
|
@@ -139,12 +138,12 @@ export class LocalReferenceCollection {
|
|
|
139
138
|
}
|
|
140
139
|
|
|
141
140
|
public hierRefCount: number = 0;
|
|
142
|
-
private readonly refsByOffset: (
|
|
141
|
+
private readonly refsByOffset: (IRefsAtOffset | undefined)[];
|
|
143
142
|
private refCount: number = 0;
|
|
144
143
|
|
|
145
144
|
constructor(
|
|
146
145
|
private readonly segment: ISegment,
|
|
147
|
-
initialRefsByfOffset = new Array<
|
|
146
|
+
initialRefsByfOffset = new Array<IRefsAtOffset | undefined>(segment.cachedLength)) {
|
|
148
147
|
// Since javascript arrays are sparse the above won't populate any of the
|
|
149
148
|
// indicies, but it will ensure the length property of the array matches
|
|
150
149
|
// the length of the segment.
|
package/src/snapshotV1.ts
CHANGED
package/src/snapshotlegacy.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
7
7
|
|
|
8
8
|
import { ITelemetryLogger } from "@fluidframework/common-definitions";
|
|
9
|
-
import { assert
|
|
9
|
+
import { assert } from "@fluidframework/common-utils";
|
|
10
10
|
import {
|
|
11
11
|
IFluidHandle,
|
|
12
12
|
IFluidSerializer,
|
|
@@ -25,18 +25,7 @@ import {
|
|
|
25
25
|
serializeAsMinSupportedVersion,
|
|
26
26
|
} from "./snapshotChunks";
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
export interface SnapChunk {
|
|
30
|
-
/**
|
|
31
|
-
* Offset from beginning of segments.
|
|
32
|
-
*/
|
|
33
|
-
position: number;
|
|
34
|
-
lengthBytes: number;
|
|
35
|
-
sequenceLength: number;
|
|
36
|
-
buffer?: IsoBuffer;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface SnapshotHeader {
|
|
28
|
+
interface SnapshotHeader {
|
|
40
29
|
chunkCount?: number;
|
|
41
30
|
segmentsTotalLength: number;
|
|
42
31
|
indexOffset?: number;
|
|
@@ -50,7 +39,7 @@ export interface SnapshotHeader {
|
|
|
50
39
|
export class SnapshotLegacy {
|
|
51
40
|
public static readonly header = "header";
|
|
52
41
|
public static readonly body = "body";
|
|
53
|
-
|
|
42
|
+
private static readonly catchupOps = "catchupOps";
|
|
54
43
|
|
|
55
44
|
// Split snapshot into two entries - headers (small) and body (overflow) for faster loading initial content
|
|
56
45
|
// Please note that this number has no direct relationship to anything other than size of raw text (characters).
|
|
@@ -60,13 +49,11 @@ export class SnapshotLegacy {
|
|
|
60
49
|
// for very chunky text, blob size can easily be 4x-8x of that number.
|
|
61
50
|
public static readonly sizeOfFirstChunk: number = 10000;
|
|
62
51
|
|
|
63
|
-
header: SnapshotHeader | undefined;
|
|
64
|
-
seq: number | undefined;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
segmentLengths: number[] | undefined;
|
|
69
|
-
logger: ITelemetryLogger;
|
|
52
|
+
private header: SnapshotHeader | undefined;
|
|
53
|
+
private seq: number | undefined;
|
|
54
|
+
private segments: IJSONSegment[] | undefined;
|
|
55
|
+
private segmentLengths: number[] | undefined;
|
|
56
|
+
private readonly logger: ITelemetryLogger;
|
|
70
57
|
private readonly chunkSize: number;
|
|
71
58
|
|
|
72
59
|
constructor(public mergeTree: MergeTree, logger: ITelemetryLogger, public filename?: string,
|
|
@@ -75,7 +62,7 @@ export class SnapshotLegacy {
|
|
|
75
62
|
this.chunkSize = mergeTree?.options?.mergeTreeSnapshotChunkSize ?? SnapshotLegacy.sizeOfFirstChunk;
|
|
76
63
|
}
|
|
77
64
|
|
|
78
|
-
getSeqLengthSegs(
|
|
65
|
+
private getSeqLengthSegs(
|
|
79
66
|
allSegments: IJSONSegment[],
|
|
80
67
|
allLengths: number[],
|
|
81
68
|
approxSequenceLength: number,
|