@fluidframework/sequence 0.57.0 → 0.58.0-55983
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/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/intervalCollection.d.ts +7 -3
- package/dist/intervalCollection.d.ts.map +1 -1
- package/dist/intervalCollection.js +16 -30
- package/dist/intervalCollection.js.map +1 -1
- package/dist/localValues.d.ts.map +1 -1
- package/dist/localValues.js +0 -1
- package/dist/localValues.js.map +1 -1
- package/dist/mapKernel.d.ts +1 -1
- package/dist/mapKernel.js +4 -4
- package/dist/mapKernel.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/sequence.d.ts +7 -1
- package/dist/sequence.d.ts.map +1 -1
- package/dist/sequence.js +13 -7
- package/dist/sequence.js.map +1 -1
- package/dist/sequenceFactory.js +0 -3
- package/dist/sequenceFactory.js.map +1 -1
- package/dist/sharedIntervalCollection.d.ts +1 -1
- package/dist/sharedIntervalCollection.js +1 -1
- package/dist/sharedIntervalCollection.js.map +1 -1
- package/dist/sharedObjectSequence.js +0 -1
- package/dist/sharedObjectSequence.js.map +1 -1
- package/dist/sharedString.d.ts +1 -1
- package/dist/sharedString.d.ts.map +1 -1
- package/dist/sharedString.js.map +1 -1
- package/dist/sparsematrix.js +0 -3
- package/dist/sparsematrix.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/intervalCollection.d.ts +7 -3
- package/lib/intervalCollection.d.ts.map +1 -1
- package/lib/intervalCollection.js +8 -22
- package/lib/intervalCollection.js.map +1 -1
- package/lib/localValues.d.ts.map +1 -1
- package/lib/localValues.js +0 -1
- package/lib/localValues.js.map +1 -1
- package/lib/mapKernel.d.ts +1 -1
- package/lib/mapKernel.js +4 -4
- package/lib/mapKernel.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/sequence.d.ts +7 -1
- package/lib/sequence.d.ts.map +1 -1
- package/lib/sequence.js +13 -7
- package/lib/sequence.js.map +1 -1
- package/lib/sequenceFactory.js +0 -3
- package/lib/sequenceFactory.js.map +1 -1
- package/lib/sharedIntervalCollection.d.ts +1 -1
- package/lib/sharedIntervalCollection.js +1 -1
- package/lib/sharedIntervalCollection.js.map +1 -1
- package/lib/sharedObjectSequence.js +0 -1
- package/lib/sharedObjectSequence.js.map +1 -1
- package/lib/sharedString.d.ts +1 -1
- package/lib/sharedString.d.ts.map +1 -1
- package/lib/sharedString.js.map +1 -1
- package/lib/sparsematrix.js +0 -3
- package/lib/sparsematrix.js.map +1 -1
- package/package.json +14 -14
- package/src/index.ts +1 -0
- package/src/intervalCollection.ts +7 -26
- package/src/localValues.ts +0 -2
- package/src/mapKernel.ts +4 -4
- package/src/packageVersion.ts +1 -1
- package/src/sequence.ts +13 -7
- package/src/sequenceFactory.ts +3 -3
- package/src/sharedIntervalCollection.ts +1 -1
- package/src/sharedObjectSequence.ts +1 -1
- package/src/sharedString.ts +1 -3
- package/src/sparsematrix.ts +4 -4
package/src/sequence.ts
CHANGED
|
@@ -156,7 +156,7 @@ export abstract class SharedSegmentSequence<T extends ISegment>
|
|
|
156
156
|
protected client: Client;
|
|
157
157
|
// Deferred that triggers once the object is loaded
|
|
158
158
|
protected loadedDeferred = new Deferred<void>();
|
|
159
|
-
// cache out going ops created when
|
|
159
|
+
// cache out going ops created when partial loading
|
|
160
160
|
private readonly loadedDeferredOutgoingOps:
|
|
161
161
|
[IMergeTreeOp, SegmentGroup | SegmentGroup[]][] = [];
|
|
162
162
|
// cache incoming ops that arrive when partial loading
|
|
@@ -314,7 +314,13 @@ export abstract class SharedSegmentSequence<T extends ISegment>
|
|
|
314
314
|
/**
|
|
315
315
|
* Resolves a remote client's position against the local sequence
|
|
316
316
|
* and returns the remote client's position relative to the local
|
|
317
|
-
* sequence
|
|
317
|
+
* sequence. The client ref seq must be above the minimum sequence number
|
|
318
|
+
* or the return value will be undefined.
|
|
319
|
+
* Generally this method is used in conjunction with signals which provide
|
|
320
|
+
* point in time values for the below parameters, and is useful for things
|
|
321
|
+
* like displaying user position. It should not be used with persisted values
|
|
322
|
+
* as persisted values will quickly become invalid as the remoteClientRefSeq
|
|
323
|
+
* moves below the minimum sequence number
|
|
318
324
|
* @param remoteClientPosition - The remote client's position to resolve
|
|
319
325
|
* @param remoteClientRefSeq - The reference sequence number of the remote client
|
|
320
326
|
* @param remoteClientId - The client id of the remote client
|
|
@@ -538,7 +544,7 @@ export abstract class SharedSegmentSequence<T extends ISegment>
|
|
|
538
544
|
this.loadFinished(error);
|
|
539
545
|
});
|
|
540
546
|
if (this.dataStoreRuntime.options?.sequenceInitializeFromHeaderOnly !== true) {
|
|
541
|
-
// if we not doing
|
|
547
|
+
// if we not doing partial load, await the catch up ops,
|
|
542
548
|
// and the finalization of the load
|
|
543
549
|
await loadCatchUpOps;
|
|
544
550
|
}
|
|
@@ -594,14 +600,14 @@ export abstract class SharedSegmentSequence<T extends ISegment>
|
|
|
594
600
|
const message = parseHandles(rawMessage, this.serializer);
|
|
595
601
|
|
|
596
602
|
const ops: IMergeTreeDeltaOp[] = [];
|
|
597
|
-
function
|
|
603
|
+
function transformOps(event: SequenceDeltaEvent) {
|
|
598
604
|
ops.push(...SharedSegmentSequence.createOpsFromDelta(event));
|
|
599
605
|
}
|
|
600
606
|
const needsTransformation = message.referenceSequenceNumber !== message.sequenceNumber - 1;
|
|
601
607
|
let stashMessage: Readonly<ISequencedDocumentMessage> = message;
|
|
602
608
|
if (this.runtime.options?.newMergeTreeSnapshotFormat !== true) {
|
|
603
609
|
if (needsTransformation) {
|
|
604
|
-
this.on("sequenceDelta",
|
|
610
|
+
this.on("sequenceDelta", transformOps);
|
|
605
611
|
}
|
|
606
612
|
}
|
|
607
613
|
|
|
@@ -609,7 +615,7 @@ export abstract class SharedSegmentSequence<T extends ISegment>
|
|
|
609
615
|
|
|
610
616
|
if (this.runtime.options?.newMergeTreeSnapshotFormat !== true) {
|
|
611
617
|
if (needsTransformation) {
|
|
612
|
-
this.removeListener("sequenceDelta",
|
|
618
|
+
this.removeListener("sequenceDelta", transformOps);
|
|
613
619
|
// shallow clone the message as we only overwrite top level properties,
|
|
614
620
|
// like referenceSequenceNumber and content only
|
|
615
621
|
stashMessage = {
|
|
@@ -654,7 +660,7 @@ export abstract class SharedSegmentSequence<T extends ISegment>
|
|
|
654
660
|
throw error;
|
|
655
661
|
} else {
|
|
656
662
|
// it is important this series remains synchronous
|
|
657
|
-
// first we stop
|
|
663
|
+
// first we stop deferring incoming ops, and apply then all
|
|
658
664
|
this.deferIncomingOps = false;
|
|
659
665
|
while (this.loadedDeferredIncomingOps.length > 0) {
|
|
660
666
|
this.processCore(this.loadedDeferredIncomingOps.shift(), false, undefined);
|
package/src/sequenceFactory.ts
CHANGED
|
@@ -94,10 +94,10 @@ export class SharedObjectSequenceFactory implements IChannelFactory {
|
|
|
94
94
|
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
95
95
|
*/
|
|
96
96
|
public static segmentFromSpec(segSpec: IJSONSegment) {
|
|
97
|
-
|
|
97
|
+
|
|
98
98
|
const runSegment = segSpec as IJSONRunSegment<object>;
|
|
99
99
|
if (runSegment.items) {
|
|
100
|
-
|
|
100
|
+
|
|
101
101
|
const seg = new SubSequence<object>(runSegment.items);
|
|
102
102
|
if (runSegment.props) {
|
|
103
103
|
seg.addProperties(runSegment.props);
|
|
@@ -133,7 +133,7 @@ export class SharedObjectSequenceFactory implements IChannelFactory {
|
|
|
133
133
|
id: string,
|
|
134
134
|
services: IChannelServices,
|
|
135
135
|
attributes: IChannelAttributes): Promise<ISharedObject> {
|
|
136
|
-
|
|
136
|
+
|
|
137
137
|
const sharedSeq = new SharedObjectSequence<object>(runtime, id, attributes);
|
|
138
138
|
await sharedSeq.load(services);
|
|
139
139
|
return sharedSeq;
|
|
@@ -172,7 +172,7 @@ export class SharedIntervalCollection<TInterval extends ISerializableInterval =
|
|
|
172
172
|
|
|
173
173
|
/**
|
|
174
174
|
* Creates the full path of the intervalCollection label
|
|
175
|
-
* @param label - the incoming
|
|
175
|
+
* @param label - the incoming label
|
|
176
176
|
*/
|
|
177
177
|
protected getIntervalCollectionPath(label: string): string {
|
|
178
178
|
return label;
|
|
@@ -27,7 +27,7 @@ export class SharedObjectSequence<T> extends SharedSequence<T> {
|
|
|
27
27
|
* @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
|
|
28
28
|
* For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
public static create<T>(runtime: IFluidDataStoreRuntime, id?: string) {
|
|
32
32
|
return runtime.createChannel(id, SharedObjectSequenceFactory.Type) as SharedObjectSequence<T>;
|
|
33
33
|
}
|
package/src/sharedString.ts
CHANGED
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
// eslint-disable-next-line import/no-unassigned-import
|
|
7
|
-
import { } from "@fluidframework/core-interfaces";
|
|
8
6
|
import {
|
|
9
7
|
ICombiningOp,
|
|
10
8
|
IMergeTreeInsertMsg,
|
|
@@ -30,7 +28,7 @@ export interface ISharedString extends SharedSegmentSequence<SharedStringSegment
|
|
|
30
28
|
* Inserts the text at the position.
|
|
31
29
|
* @param pos - The position to insert the text at
|
|
32
30
|
* @param text - The text to insert
|
|
33
|
-
* @param props - The properties of text
|
|
31
|
+
* @param props - The properties of the text
|
|
34
32
|
*/
|
|
35
33
|
insertText(pos: number, text: string, props?: PropertySet): void;
|
|
36
34
|
|
package/src/sparsematrix.ts
CHANGED
|
@@ -159,7 +159,7 @@ export class RunSegment extends SubSequence<SparseMatrixItem> {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
public getTag(pos: number) {
|
|
162
|
-
|
|
162
|
+
|
|
163
163
|
return this.tags[pos];
|
|
164
164
|
}
|
|
165
165
|
|
|
@@ -276,13 +276,13 @@ export class SparseMatrix extends SharedSegmentSequence<MatrixSegment> {
|
|
|
276
276
|
|
|
277
277
|
public getItem(row: number, col: number):
|
|
278
278
|
// The return type is defined explicitly here to prevent TypeScript from generating dynamic imports
|
|
279
|
-
|
|
279
|
+
|
|
280
280
|
Jsonable<string | number | boolean | IFluidHandle<IFluidObject & FluidObject & IFluidLoadable>> {
|
|
281
281
|
const pos = rowColToPosition(row, col);
|
|
282
282
|
const { segment, offset } =
|
|
283
283
|
this.getContainingSegment(pos);
|
|
284
284
|
if (RunSegment.is(segment)) {
|
|
285
|
-
|
|
285
|
+
|
|
286
286
|
return segment.items[offset];
|
|
287
287
|
} else if (PaddingSegment.is(segment)) {
|
|
288
288
|
return undefined;
|
|
@@ -294,7 +294,7 @@ export class SparseMatrix extends SharedSegmentSequence<MatrixSegment> {
|
|
|
294
294
|
public getTag(row: number, col: number) {
|
|
295
295
|
const { segment, offset } = this.getSegment(row, col);
|
|
296
296
|
if (RunSegment.is(segment)) {
|
|
297
|
-
|
|
297
|
+
|
|
298
298
|
return segment.getTag(offset);
|
|
299
299
|
}
|
|
300
300
|
return undefined;
|