@fluidframework/container-runtime 2.43.0 → 2.50.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/container-runtime.test-files.tar +0 -0
- package/dist/blobManager/blobManager.d.ts +1 -5
- package/dist/blobManager/blobManager.d.ts.map +1 -1
- package/dist/blobManager/blobManager.js +0 -7
- package/dist/blobManager/blobManager.js.map +1 -1
- package/dist/channelCollection.d.ts +1 -1
- package/dist/channelCollection.js.map +1 -1
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +3 -3
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +45 -9
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +26 -12
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +3 -1
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +1 -4
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/runtimeLayerCompatState.d.ts +3 -3
- package/dist/runtimeLayerCompatState.d.ts.map +1 -1
- package/dist/runtimeLayerCompatState.js +10 -10
- package/dist/runtimeLayerCompatState.js.map +1 -1
- package/lib/blobManager/blobManager.d.ts +1 -5
- package/lib/blobManager/blobManager.d.ts.map +1 -1
- package/lib/blobManager/blobManager.js +0 -7
- package/lib/blobManager/blobManager.js.map +1 -1
- package/lib/channelCollection.d.ts +1 -1
- package/lib/channelCollection.js.map +1 -1
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +3 -3
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +45 -9
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +26 -12
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +3 -1
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +1 -4
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/runtimeLayerCompatState.d.ts +3 -3
- package/lib/runtimeLayerCompatState.d.ts.map +1 -1
- package/lib/runtimeLayerCompatState.js +9 -9
- package/lib/runtimeLayerCompatState.js.map +1 -1
- package/package.json +18 -18
- package/src/blobManager/blobManager.ts +0 -9
- package/src/channelCollection.ts +1 -1
- package/src/containerRuntime.ts +3 -5
- package/src/dataStoreContext.ts +61 -25
- package/src/gc/gcTelemetry.ts +3 -1
- package/src/index.ts +7 -0
- package/src/opLifecycle/outbox.ts +1 -4
- package/src/packageVersion.ts +1 -1
- package/src/runtimeLayerCompatState.ts +10 -10
package/src/dataStoreContext.ts
CHANGED
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
type IPendingMessagesState,
|
|
63
63
|
type IRuntimeMessageCollection,
|
|
64
64
|
type IFluidDataStoreFactory,
|
|
65
|
-
type
|
|
65
|
+
type PackagePath,
|
|
66
66
|
} from "@fluidframework/runtime-definitions/internal";
|
|
67
67
|
import {
|
|
68
68
|
addBlobToSummary,
|
|
@@ -149,7 +149,13 @@ export interface IFluidDataStoreContextProps {
|
|
|
149
149
|
readonly storage: IDocumentStorageService;
|
|
150
150
|
readonly scope: FluidObject;
|
|
151
151
|
readonly createSummarizerNodeFn: CreateChildSummarizerNodeFn;
|
|
152
|
-
|
|
152
|
+
/**
|
|
153
|
+
* See {@link FluidDataStoreContext.pkg}.
|
|
154
|
+
*/
|
|
155
|
+
readonly pkg?: PackagePath;
|
|
156
|
+
/**
|
|
157
|
+
* See {@link FluidDataStoreContext.loadingGroupId}.
|
|
158
|
+
*/
|
|
153
159
|
readonly loadingGroupId?: string;
|
|
154
160
|
}
|
|
155
161
|
|
|
@@ -179,8 +185,6 @@ export interface IRemoteFluidDataStoreContextProps extends IFluidDataStoreContex
|
|
|
179
185
|
|
|
180
186
|
// back-compat: To be removed in the future.
|
|
181
187
|
// Added in "2.0.0-rc.2.0.0" timeframe (to support older builds).
|
|
182
|
-
/**
|
|
183
|
-
*/
|
|
184
188
|
export interface IFluidDataStoreContextEvents extends IEvent {
|
|
185
189
|
(event: "attaching" | "attached", listener: () => void);
|
|
186
190
|
}
|
|
@@ -235,13 +239,13 @@ class ContextDeltaManagerProxy extends BaseDeltaManagerProxy {
|
|
|
235
239
|
}
|
|
236
240
|
|
|
237
241
|
/**
|
|
238
|
-
*
|
|
242
|
+
* {@link IFluidDataStoreContext} for the implementations of {@link IFluidDataStoreChannel} which powers the {@link IDataStore}s.
|
|
239
243
|
*/
|
|
240
244
|
export abstract class FluidDataStoreContext
|
|
241
245
|
extends TypedEventEmitter<IFluidDataStoreContextEvents>
|
|
242
|
-
implements IFluidDataStoreContextInternal,
|
|
246
|
+
implements IFluidDataStoreContextInternal, IFluidDataStoreContext, IDisposable
|
|
243
247
|
{
|
|
244
|
-
public get packagePath():
|
|
248
|
+
public get packagePath(): PackagePath {
|
|
245
249
|
assert(this.pkg !== undefined, 0x139 /* "Undefined package path" */);
|
|
246
250
|
return this.pkg;
|
|
247
251
|
}
|
|
@@ -413,14 +417,32 @@ export abstract class FluidDataStoreContext
|
|
|
413
417
|
|
|
414
418
|
public readonly id: string;
|
|
415
419
|
private readonly _containerRuntime: IContainerRuntimeBase;
|
|
420
|
+
/**
|
|
421
|
+
* Information for this data store from its parent.
|
|
422
|
+
*
|
|
423
|
+
* @remarks
|
|
424
|
+
* The parent which provided this information currently can be the container runtime or a datastore (if the datastore this context is for is nested under another one).
|
|
425
|
+
*/
|
|
416
426
|
private readonly parentContext: IFluidParentContextPrivate;
|
|
417
427
|
public readonly storage: IDocumentStorageService;
|
|
418
428
|
public readonly scope: FluidObject;
|
|
419
|
-
|
|
429
|
+
/**
|
|
430
|
+
* The loading group to which the data store belongs to.
|
|
431
|
+
*/
|
|
420
432
|
public readonly loadingGroupId: string | undefined;
|
|
421
|
-
|
|
433
|
+
/**
|
|
434
|
+
* {@link PackagePath} of this data store.
|
|
435
|
+
*
|
|
436
|
+
* This can be undefined when a data store is delay loaded, i.e., the attributes of this data store in the snapshot are not fetched until this data store is actually used.
|
|
437
|
+
* At that time, the attributes blob is fetched and the pkg is updated from it.
|
|
438
|
+
*
|
|
439
|
+
* @see {@link PackagePath}.
|
|
440
|
+
* @see {@link IFluidDataStoreContext.packagePath}.
|
|
441
|
+
* @see {@link factoryFromPackagePath}.
|
|
442
|
+
*/
|
|
443
|
+
protected pkg?: PackagePath;
|
|
422
444
|
|
|
423
|
-
constructor(
|
|
445
|
+
public constructor(
|
|
424
446
|
props: IFluidDataStoreContextProps,
|
|
425
447
|
private readonly existing: boolean,
|
|
426
448
|
public readonly isLocalDataStore: boolean,
|
|
@@ -522,10 +544,13 @@ export abstract class FluidDataStoreContext
|
|
|
522
544
|
attachState: AttachState.Attaching | AttachState.Attached,
|
|
523
545
|
): void;
|
|
524
546
|
|
|
525
|
-
|
|
547
|
+
/**
|
|
548
|
+
* Throw a {@link LoggingError} indicating that {@link factoryFromPackagePath} failed.
|
|
549
|
+
*/
|
|
550
|
+
private factoryFromPackagePathError(
|
|
526
551
|
reason: string,
|
|
527
552
|
failedPkgPath?: string,
|
|
528
|
-
fullPackageName?:
|
|
553
|
+
fullPackageName?: PackagePath,
|
|
529
554
|
): never {
|
|
530
555
|
throw new LoggingError(
|
|
531
556
|
reason,
|
|
@@ -560,34 +585,45 @@ export abstract class FluidDataStoreContext
|
|
|
560
585
|
return this.channelP;
|
|
561
586
|
}
|
|
562
587
|
|
|
588
|
+
/**
|
|
589
|
+
* Gets the factory that would be used to instantiate this data store by calling `instantiateDataStore` based on {@link pkg}.
|
|
590
|
+
* @remarks
|
|
591
|
+
* Also populates {@link registry}.
|
|
592
|
+
*
|
|
593
|
+
* Must be called after {@link pkg} is set, and only called once.
|
|
594
|
+
*
|
|
595
|
+
* @see {@link @fluidframework/container-runtime-definitions#IContainerRuntimeBase.createDataStore}.
|
|
596
|
+
* @see {@link FluidDataStoreContext.pkg}.
|
|
597
|
+
*/
|
|
563
598
|
protected async factoryFromPackagePath(): Promise<IFluidDataStoreFactory> {
|
|
564
|
-
const
|
|
565
|
-
if (
|
|
566
|
-
this.
|
|
599
|
+
const path = this.pkg;
|
|
600
|
+
if (path === undefined) {
|
|
601
|
+
this.factoryFromPackagePathError("packages is undefined");
|
|
567
602
|
}
|
|
568
603
|
|
|
569
604
|
let entry: FluidDataStoreRegistryEntry | undefined;
|
|
570
605
|
let registry: IFluidDataStoreRegistry | undefined =
|
|
571
606
|
this.parentContext.IFluidDataStoreRegistry;
|
|
572
|
-
let
|
|
573
|
-
|
|
607
|
+
let lastIdentifier: string | undefined;
|
|
608
|
+
// Follow the path, looking up each identifier in the registry along the way:
|
|
609
|
+
for (const identifier of path) {
|
|
574
610
|
if (!registry) {
|
|
575
|
-
this.
|
|
611
|
+
this.factoryFromPackagePathError("No registry for package", lastIdentifier, path);
|
|
576
612
|
}
|
|
577
|
-
|
|
578
|
-
entry = registry.getSync?.(
|
|
613
|
+
lastIdentifier = identifier;
|
|
614
|
+
entry = registry.getSync?.(identifier) ?? (await registry.get(identifier));
|
|
579
615
|
if (!entry) {
|
|
580
|
-
this.
|
|
616
|
+
this.factoryFromPackagePathError(
|
|
581
617
|
"Registry does not contain entry for the package",
|
|
582
|
-
|
|
583
|
-
|
|
618
|
+
identifier,
|
|
619
|
+
path,
|
|
584
620
|
);
|
|
585
621
|
}
|
|
586
622
|
registry = entry.IFluidDataStoreRegistry;
|
|
587
623
|
}
|
|
588
624
|
const factory = entry?.IFluidDataStoreFactory;
|
|
589
625
|
if (factory === undefined) {
|
|
590
|
-
this.
|
|
626
|
+
this.factoryFromPackagePathError("Can't find factory for package", lastIdentifier, path);
|
|
591
627
|
}
|
|
592
628
|
|
|
593
629
|
assert(this.registry === undefined, 0x157 /* "datastore registry already attached" */);
|
|
@@ -596,7 +632,7 @@ export abstract class FluidDataStoreContext
|
|
|
596
632
|
return factory;
|
|
597
633
|
}
|
|
598
634
|
|
|
599
|
-
createChildDataStore<T extends IFluidDataStoreFactory>(
|
|
635
|
+
public createChildDataStore<T extends IFluidDataStoreFactory>(
|
|
600
636
|
childFactory: T,
|
|
601
637
|
): ReturnType<Exclude<T["createDataStore"], undefined>> {
|
|
602
638
|
const maybe = this.registry?.getSync?.(childFactory.type);
|
package/src/gc/gcTelemetry.ts
CHANGED
|
@@ -77,7 +77,9 @@ interface INodeUsageProps extends ICommonProps {
|
|
|
77
77
|
*/
|
|
78
78
|
currentReferenceTimestampMs: number;
|
|
79
79
|
/**
|
|
80
|
-
* The package path of the node. This may not be available if the node hasn't been loaded yet
|
|
80
|
+
* The package path of the node. This may not be available if the node hasn't been loaded yet.
|
|
81
|
+
*
|
|
82
|
+
* @see {@link @fluidframework/runtime-definitions#IFluidDataStoreContext.packagePath} for more details.
|
|
81
83
|
*/
|
|
82
84
|
packagePath: readonly string[] | undefined;
|
|
83
85
|
/**
|
package/src/index.ts
CHANGED
|
@@ -112,3 +112,10 @@ export {
|
|
|
112
112
|
DefaultSummaryConfiguration,
|
|
113
113
|
} from "./summary/index.js";
|
|
114
114
|
export { IChunkedOp, unpackRuntimeMessage } from "./opLifecycle/index.js";
|
|
115
|
+
export {
|
|
116
|
+
runtimeCoreCompatDetails,
|
|
117
|
+
runtimeCompatDetailsForLoader,
|
|
118
|
+
runtimeCompatDetailsForDataStore,
|
|
119
|
+
loaderSupportRequirementsForRuntime,
|
|
120
|
+
dataStoreSupportRequirementsForRuntime,
|
|
121
|
+
} from "./runtimeLayerCompatState.js";
|
|
@@ -455,10 +455,7 @@ export class Outbox {
|
|
|
455
455
|
if (
|
|
456
456
|
batchManager.options.canRebase &&
|
|
457
457
|
rawBatch.hasReentrantOps === true &&
|
|
458
|
-
|
|
459
|
-
// However there is some test that is depending on this behavior so we haven't removed these conditions yet. See AB#33427
|
|
460
|
-
groupingEnabled &&
|
|
461
|
-
rawBatch.messages.length > 1
|
|
458
|
+
groupingEnabled
|
|
462
459
|
) {
|
|
463
460
|
assert(!this.rebasing, 0x6fa /* A rebased batch should never have reentrant ops */);
|
|
464
461
|
// If a batch contains reentrant ops (ops created as a result from processing another op)
|
package/src/packageVersion.ts
CHANGED
|
@@ -48,7 +48,7 @@ export const runtimeCompatDetailsForLoader: ILayerCompatDetails = {
|
|
|
48
48
|
* The requirements that the Loader layer must meet to be compatible with this Runtime.
|
|
49
49
|
* @internal
|
|
50
50
|
*/
|
|
51
|
-
export const
|
|
51
|
+
export const loaderSupportRequirementsForRuntime: ILayerCompatSupportRequirements = {
|
|
52
52
|
/**
|
|
53
53
|
* Minimum generation that Loader must be at to be compatible with Runtime. Note that 0 is used here so
|
|
54
54
|
* that Loader layers before the introduction of the layer compatibility enforcement are compatible.
|
|
@@ -76,7 +76,7 @@ export const runtimeCompatDetailsForDataStore: ILayerCompatDetails = {
|
|
|
76
76
|
* The requirements that the DataStore layer must meet to be compatible with this Runtime.
|
|
77
77
|
* @internal
|
|
78
78
|
*/
|
|
79
|
-
export const
|
|
79
|
+
export const dataStoreSupportRequirementsForRuntime: ILayerCompatSupportRequirements = {
|
|
80
80
|
/**
|
|
81
81
|
* Minimum generation that DataStore must be at to be compatible with Runtime. Note that 0 is used here so
|
|
82
82
|
* that DataStore layers before the introduction of the layer compatibility enforcement are compatible.
|
|
@@ -93,21 +93,21 @@ export const dataStoreSupportRequirements: ILayerCompatSupportRequirements = {
|
|
|
93
93
|
* @internal
|
|
94
94
|
*/
|
|
95
95
|
export function validateLoaderCompatibility(
|
|
96
|
-
|
|
96
|
+
maybeLoaderCompatDetailsForRuntime: ILayerCompatDetails | undefined,
|
|
97
97
|
disposeFn: (error?: ICriticalContainerError) => void,
|
|
98
98
|
): void {
|
|
99
99
|
const layerCheckResult = checkLayerCompatibility(
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
loaderSupportRequirementsForRuntime,
|
|
101
|
+
maybeLoaderCompatDetailsForRuntime,
|
|
102
102
|
);
|
|
103
103
|
if (!layerCheckResult.isCompatible) {
|
|
104
104
|
const error = new UsageError("Runtime is not compatible with Loader", {
|
|
105
105
|
errorDetails: JSON.stringify({
|
|
106
106
|
runtimeVersion: runtimeCoreCompatDetails.pkgVersion,
|
|
107
|
-
loaderVersion:
|
|
107
|
+
loaderVersion: maybeLoaderCompatDetailsForRuntime?.pkgVersion,
|
|
108
108
|
runtimeGeneration: runtimeCoreCompatDetails.generation,
|
|
109
|
-
loaderGeneration:
|
|
110
|
-
minSupportedGeneration:
|
|
109
|
+
loaderGeneration: maybeLoaderCompatDetailsForRuntime?.generation,
|
|
110
|
+
minSupportedGeneration: loaderSupportRequirementsForRuntime.minSupportedGeneration,
|
|
111
111
|
isGenerationCompatible: layerCheckResult.isGenerationCompatible,
|
|
112
112
|
unsupportedFeatures: layerCheckResult.unsupportedFeatures,
|
|
113
113
|
}),
|
|
@@ -126,7 +126,7 @@ export function validateDatastoreCompatibility(
|
|
|
126
126
|
disposeFn: () => void,
|
|
127
127
|
): void {
|
|
128
128
|
const layerCheckResult = checkLayerCompatibility(
|
|
129
|
-
|
|
129
|
+
dataStoreSupportRequirementsForRuntime,
|
|
130
130
|
maybeDataStoreCompatDetails,
|
|
131
131
|
);
|
|
132
132
|
if (!layerCheckResult.isCompatible) {
|
|
@@ -136,7 +136,7 @@ export function validateDatastoreCompatibility(
|
|
|
136
136
|
dataStoreVersion: maybeDataStoreCompatDetails?.pkgVersion,
|
|
137
137
|
runtimeGeneration: runtimeCoreCompatDetails.generation,
|
|
138
138
|
dataStoreGeneration: maybeDataStoreCompatDetails?.generation,
|
|
139
|
-
minSupportedGeneration:
|
|
139
|
+
minSupportedGeneration: dataStoreSupportRequirementsForRuntime.minSupportedGeneration,
|
|
140
140
|
isGenerationCompatible: layerCheckResult.isGenerationCompatible,
|
|
141
141
|
unsupportedFeatures: layerCheckResult.unsupportedFeatures,
|
|
142
142
|
}),
|