@fluidframework/container-loader 2.117.0 → 3.0.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 +76 -2
- package/README.md +53 -50
- package/{api-extractor.json → api-extractor/api-extractor-model.json} +1 -1
- package/api-report/container-loader.legacy.alpha.api.md +4 -3
- package/dist/attachment.d.ts.map +1 -1
- package/dist/audience.js +3 -2
- package/dist/audience.js.map +1 -1
- package/dist/captureReferencedContents.js +9 -9
- package/dist/captureReferencedContents.js.map +1 -1
- package/dist/catchUpMonitor.js +11 -8
- package/dist/catchUpMonitor.js.map +1 -1
- package/dist/connectionManager.d.ts.map +1 -1
- package/dist/connectionManager.js +86 -51
- package/dist/connectionManager.js.map +1 -1
- package/dist/connectionStateHandler.js +40 -14
- package/dist/connectionStateHandler.js.map +1 -1
- package/dist/container.d.ts +1 -1
- package/dist/container.d.ts.map +1 -1
- package/dist/container.js +193 -143
- package/dist/container.js.map +1 -1
- package/dist/containerContext.js +48 -11
- package/dist/containerContext.js.map +1 -1
- package/dist/containerStorageAdapter.js +25 -17
- package/dist/containerStorageAdapter.js.map +1 -1
- package/dist/contracts.d.ts.map +1 -1
- package/dist/createAndLoadContainerUtils.d.ts +34 -13
- package/dist/createAndLoadContainerUtils.d.ts.map +1 -1
- package/dist/createAndLoadContainerUtils.js +97 -37
- package/dist/createAndLoadContainerUtils.js.map +1 -1
- package/dist/debugLogger.d.ts +7 -22
- package/dist/debugLogger.d.ts.map +1 -1
- package/dist/debugLogger.js +34 -34
- package/dist/debugLogger.js.map +1 -1
- package/dist/deltaManager.d.ts +16 -4
- package/dist/deltaManager.d.ts.map +1 -1
- package/dist/deltaManager.js +75 -49
- package/dist/deltaManager.js.map +1 -1
- package/dist/deltaManagerFactory.d.ts +23 -0
- package/dist/deltaManagerFactory.d.ts.map +1 -0
- package/dist/deltaManagerFactory.js +17 -0
- package/dist/deltaManagerFactory.js.map +1 -0
- package/dist/deltaQueue.js +14 -7
- package/dist/deltaQueue.js.map +1 -1
- package/dist/disposal.js +1 -2
- package/dist/disposal.js.map +1 -1
- package/dist/error.js +5 -4
- package/dist/error.js.map +1 -1
- package/dist/frozenServices.d.ts +2 -2
- package/dist/frozenServices.d.ts.map +1 -1
- package/dist/frozenServices.js +52 -34
- package/dist/frozenServices.js.map +1 -1
- 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/loadContainerToSequenceNumber.d.ts +6 -5
- package/dist/loadContainerToSequenceNumber.d.ts.map +1 -1
- package/dist/loadContainerToSequenceNumber.js +5 -6
- package/dist/loadContainerToSequenceNumber.js.map +1 -1
- package/dist/loadPaused.js +1 -2
- package/dist/loadPaused.js.map +1 -1
- package/dist/loader.js +5 -1
- package/dist/loader.js.map +1 -1
- package/dist/loaderLayerCompatState.d.ts +25 -1
- package/dist/loaderLayerCompatState.d.ts.map +1 -1
- package/dist/loaderLayerCompatState.js +79 -11
- package/dist/loaderLayerCompatState.js.map +1 -1
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.js +2 -3
- package/dist/location-redirection-utilities/resolveWithLocationRedirection.js.map +1 -1
- package/dist/memoryBlobStorage.js +2 -3
- package/dist/memoryBlobStorage.js.map +1 -1
- package/dist/noopHeuristic.js +3 -1
- package/dist/noopHeuristic.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/pendingLocalStateStore.d.ts +4 -3
- package/dist/pendingLocalStateStore.d.ts.map +1 -1
- package/dist/pendingLocalStateStore.js +26 -37
- package/dist/pendingLocalStateStore.js.map +1 -1
- package/dist/pointInTimeServices.js +4 -2
- package/dist/pointInTimeServices.js.map +1 -1
- package/dist/protocol/protocol.js +3 -0
- package/dist/protocol/protocol.js.map +1 -1
- package/dist/protocol/quorum.js +26 -5
- package/dist/protocol/quorum.js.map +1 -1
- package/dist/protocol.js +5 -3
- package/dist/protocol.js.map +1 -1
- package/dist/protocolTreeDocumentStorageService.js +10 -0
- package/dist/protocolTreeDocumentStorageService.js.map +1 -1
- package/dist/quorum.js +1 -2
- package/dist/quorum.js.map +1 -1
- package/dist/retriableDocumentStorageService.d.ts.map +1 -1
- package/dist/retriableDocumentStorageService.js +5 -1
- package/dist/retriableDocumentStorageService.js.map +1 -1
- package/dist/serializedStateManager.d.ts +6 -0
- package/dist/serializedStateManager.d.ts.map +1 -1
- package/dist/serializedStateManager.js +19 -24
- package/dist/serializedStateManager.js.map +1 -1
- package/dist/snapshotRefresher.js +31 -36
- package/dist/snapshotRefresher.js.map +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +13 -13
- package/dist/utils.js.map +1 -1
- package/lib/attachment.d.ts.map +1 -1
- package/lib/audience.js +3 -2
- package/lib/audience.js.map +1 -1
- package/lib/catchUpMonitor.js +11 -8
- package/lib/catchUpMonitor.js.map +1 -1
- package/lib/connectionManager.d.ts.map +1 -1
- package/lib/connectionManager.js +86 -51
- package/lib/connectionManager.js.map +1 -1
- package/lib/connectionStateHandler.js +37 -11
- package/lib/connectionStateHandler.js.map +1 -1
- package/lib/container.d.ts +1 -1
- package/lib/container.d.ts.map +1 -1
- package/lib/container.js +191 -141
- package/lib/container.js.map +1 -1
- package/lib/containerContext.js +48 -11
- package/lib/containerContext.js.map +1 -1
- package/lib/containerStorageAdapter.js +22 -14
- package/lib/containerStorageAdapter.js.map +1 -1
- package/lib/contracts.d.ts.map +1 -1
- package/lib/createAndLoadContainerUtils.d.ts +34 -13
- package/lib/createAndLoadContainerUtils.d.ts.map +1 -1
- package/lib/createAndLoadContainerUtils.js +93 -32
- package/lib/createAndLoadContainerUtils.js.map +1 -1
- package/lib/debugLogger.d.ts +7 -22
- package/lib/debugLogger.d.ts.map +1 -1
- package/lib/debugLogger.js +34 -33
- package/lib/debugLogger.js.map +1 -1
- package/lib/deltaManager.d.ts +16 -4
- package/lib/deltaManager.d.ts.map +1 -1
- package/lib/deltaManager.js +75 -49
- package/lib/deltaManager.js.map +1 -1
- package/lib/deltaManagerFactory.d.ts +23 -0
- package/lib/deltaManagerFactory.d.ts.map +1 -0
- package/lib/deltaManagerFactory.js +14 -0
- package/lib/deltaManagerFactory.js.map +1 -0
- package/lib/deltaQueue.js +14 -7
- package/lib/deltaQueue.js.map +1 -1
- package/lib/error.js +5 -4
- package/lib/error.js.map +1 -1
- package/lib/frozenServices.d.ts +2 -2
- package/lib/frozenServices.d.ts.map +1 -1
- package/lib/frozenServices.js +48 -30
- package/lib/frozenServices.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/legacy.d.ts +1 -1
- package/lib/legacyAlpha.d.ts +1 -1
- package/lib/loadContainerToSequenceNumber.d.ts +6 -5
- package/lib/loadContainerToSequenceNumber.d.ts.map +1 -1
- package/lib/loadContainerToSequenceNumber.js +4 -4
- package/lib/loadContainerToSequenceNumber.js.map +1 -1
- package/lib/loader.js +6 -2
- package/lib/loader.js.map +1 -1
- package/lib/loaderLayerCompatState.d.ts +25 -1
- package/lib/loaderLayerCompatState.d.ts.map +1 -1
- package/lib/loaderLayerCompatState.js +76 -9
- package/lib/loaderLayerCompatState.js.map +1 -1
- package/lib/noopHeuristic.js +3 -1
- package/lib/noopHeuristic.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/pendingLocalStateStore.d.ts +4 -3
- package/lib/pendingLocalStateStore.d.ts.map +1 -1
- package/lib/pendingLocalStateStore.js +26 -37
- package/lib/pendingLocalStateStore.js.map +1 -1
- package/lib/pointInTimeServices.js +2 -0
- package/lib/pointInTimeServices.js.map +1 -1
- package/lib/protocol/protocol.js +3 -0
- package/lib/protocol/protocol.js.map +1 -1
- package/lib/protocol/quorum.js +26 -5
- package/lib/protocol/quorum.js.map +1 -1
- package/lib/protocol.js +2 -0
- package/lib/protocol.js.map +1 -1
- package/lib/protocolTreeDocumentStorageService.js +10 -0
- package/lib/protocolTreeDocumentStorageService.js.map +1 -1
- package/lib/public.d.ts +1 -1
- package/lib/retriableDocumentStorageService.d.ts.map +1 -1
- package/lib/retriableDocumentStorageService.js +5 -1
- package/lib/retriableDocumentStorageService.js.map +1 -1
- package/lib/serializedStateManager.d.ts +6 -0
- package/lib/serializedStateManager.d.ts.map +1 -1
- package/lib/serializedStateManager.js +15 -20
- package/lib/serializedStateManager.js.map +1 -1
- package/lib/snapshotRefresher.js +31 -36
- package/lib/snapshotRefresher.js.map +1 -1
- package/lib/utils.d.ts +1 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +3 -3
- package/lib/utils.js.map +1 -1
- package/package.json +44 -106
- package/src/container.ts +35 -22
- package/src/createAndLoadContainerUtils.ts +131 -46
- package/src/debugLogger.ts +39 -40
- package/src/deltaManager.ts +18 -5
- package/src/deltaManagerFactory.ts +53 -0
- package/src/frozenServices.ts +6 -7
- package/src/index.ts +1 -0
- package/src/loadContainerToSequenceNumber.ts +7 -6
- package/src/loader.ts +2 -2
- package/src/loaderLayerCompatState.ts +85 -20
- package/src/packageVersion.ts +1 -1
- package/src/pendingLocalStateStore.ts +7 -3
- package/src/pointInTime/DEV.md +47 -4
- package/src/serializedStateManager.ts +6 -0
- package/src/utils.ts +3 -3
- package/tsconfig.json +1 -1
- package/internal.d.ts +0 -11
- package/legacy/alpha.d.ts +0 -11
- package/legacy.d.ts +0 -11
- /package/api-extractor/{api-extractor.current.json → api-extractor-report.current.json} +0 -0
- /package/api-extractor/{api-extractor.legacy.json → api-extractor-report.legacy.json} +0 -0
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
generation,
|
|
8
|
+
defaultLayerCompatDetails,
|
|
8
9
|
LayerCompatibilityPolicyWindowMonths,
|
|
9
10
|
type ILayerCompatDetails,
|
|
10
11
|
type ILayerCompatSupportRequirements,
|
|
@@ -44,6 +45,18 @@ export const loaderCompatDetailsForRuntime: ILayerCompatDetails = {
|
|
|
44
45
|
supportedFeatures: new Set<string>(),
|
|
45
46
|
};
|
|
46
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Loader's compatibility details that is validated against the Driver layer's requirements.
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
export const loaderCompatDetailsForDriver: ILayerCompatDetails = {
|
|
53
|
+
...loaderCoreCompatDetails,
|
|
54
|
+
/**
|
|
55
|
+
* The features supported by the Loader layer across the Loader / Driver boundary.
|
|
56
|
+
*/
|
|
57
|
+
supportedFeatures: new Set<string>(),
|
|
58
|
+
};
|
|
59
|
+
|
|
47
60
|
/**
|
|
48
61
|
* The requirements that the Runtime layer must meet to be compatible with this Loader.
|
|
49
62
|
* @internal
|
|
@@ -51,13 +64,14 @@ export const loaderCompatDetailsForRuntime: ILayerCompatDetails = {
|
|
|
51
64
|
export const runtimeSupportRequirementsForLoader: ILayerCompatSupportRequirements = {
|
|
52
65
|
/**
|
|
53
66
|
* Minimum generation that Runtime must be at to be compatible with this Loader. This is calculated
|
|
54
|
-
* based on the LayerCompatibilityPolicyWindowMonths.
|
|
55
|
-
* the Runtime layer be compared to the Loader layer for them to still be considered compatible.
|
|
67
|
+
* based on the LayerCompatibilityPolicyWindowMonths.NewLoaderOldRuntime value which defines how many months
|
|
68
|
+
* old can the Runtime layer be compared to the Loader layer for them to still be considered compatible.
|
|
56
69
|
* The minimum valid generation value is 0.
|
|
57
70
|
*/
|
|
58
71
|
minSupportedGeneration: Math.max(
|
|
59
72
|
0,
|
|
60
|
-
loaderCoreCompatDetails.generation -
|
|
73
|
+
loaderCoreCompatDetails.generation -
|
|
74
|
+
LayerCompatibilityPolicyWindowMonths.NewLoaderOldRuntime,
|
|
61
75
|
),
|
|
62
76
|
/**
|
|
63
77
|
* The features that the Runtime must support to be compatible with Loader.
|
|
@@ -72,13 +86,14 @@ export const runtimeSupportRequirementsForLoader: ILayerCompatSupportRequirement
|
|
|
72
86
|
export const driverSupportRequirementsForLoader: ILayerCompatSupportRequirements = {
|
|
73
87
|
/**
|
|
74
88
|
* Minimum generation that Driver must be at to be compatible with this Loader. This is calculated
|
|
75
|
-
* based on the LayerCompatibilityPolicyWindowMonths.
|
|
76
|
-
* the Driver layer be compared to the Loader layer for them to still be considered compatible.
|
|
89
|
+
* based on the LayerCompatibilityPolicyWindowMonths.NewLoaderOldDriver value which defines how many months
|
|
90
|
+
* old can the Driver layer be compared to the Loader layer for them to still be considered compatible.
|
|
77
91
|
* The minimum valid generation value is 0.
|
|
78
92
|
*/
|
|
79
93
|
minSupportedGeneration: Math.max(
|
|
80
94
|
0,
|
|
81
|
-
loaderCoreCompatDetails.generation -
|
|
95
|
+
loaderCoreCompatDetails.generation -
|
|
96
|
+
LayerCompatibilityPolicyWindowMonths.NewLoaderOldDriver,
|
|
82
97
|
),
|
|
83
98
|
/**
|
|
84
99
|
* The features that the Driver must support to be compatible with Loader.
|
|
@@ -95,13 +110,19 @@ export function validateRuntimeCompatibility(
|
|
|
95
110
|
mc: MonitoringContext,
|
|
96
111
|
): void {
|
|
97
112
|
validateLayerCompatibility(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
113
|
+
/* validatingLayer */ {
|
|
114
|
+
layer: "loader",
|
|
115
|
+
packageInfo: loaderCoreCompatDetails,
|
|
116
|
+
compatSupportRequirements: runtimeSupportRequirementsForLoader,
|
|
117
|
+
},
|
|
118
|
+
/* targetLayer */ {
|
|
119
|
+
layer: "runtime",
|
|
120
|
+
compatDetails: maybeRuntimeCompatDetails,
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
disposeFn: () => {} /* no op. This will be handled by the caller */,
|
|
124
|
+
mc,
|
|
125
|
+
},
|
|
105
126
|
);
|
|
106
127
|
}
|
|
107
128
|
|
|
@@ -115,12 +136,56 @@ export function validateDriverCompatibility(
|
|
|
115
136
|
mc: MonitoringContext,
|
|
116
137
|
): void {
|
|
117
138
|
validateLayerCompatibility(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
139
|
+
/* validatingLayer */ {
|
|
140
|
+
layer: "loader",
|
|
141
|
+
packageInfo: loaderCoreCompatDetails,
|
|
142
|
+
compatSupportRequirements: driverSupportRequirementsForLoader,
|
|
143
|
+
},
|
|
144
|
+
/* targetLayer */ {
|
|
145
|
+
layer: "driver",
|
|
146
|
+
compatDetails: maybeDriverCompatDetails,
|
|
147
|
+
},
|
|
148
|
+
{ disposeFn, mc },
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Validates that the Loader layer is compatible with the Driver.
|
|
154
|
+
*
|
|
155
|
+
* @remarks
|
|
156
|
+
* This is the reverse of {@link validateDriverCompatibility} and is intentionally a separate function because it
|
|
157
|
+
* does not follow the standard layer-validation pattern. Normally each layer validates the layer it holds a
|
|
158
|
+
* reference to - the Loader validates the Driver, the Runtime validates the Loader, and so on. The Driver, however,
|
|
159
|
+
* has no reference to the Loader and therefore cannot run this validation itself. To still enforce compatibility in
|
|
160
|
+
* both directions across the Driver / Loader boundary, the Driver publishes the requirements it has for the Loader
|
|
161
|
+
* (via ILayerCompatSupportRequirements) and the Loader validates itself against them here, on the Driver's behalf.
|
|
162
|
+
*
|
|
163
|
+
* @param maybeDriverCompatDetails - The Driver's compatibility details, used only to attribute the version /
|
|
164
|
+
* generation of the Driver in telemetry if the Loader is found to be incompatible.
|
|
165
|
+
* @param maybeDriverCompatRequirements - The requirements the Driver has for the Loader. Older Drivers may not
|
|
166
|
+
* publish these, in which case there is nothing to validate in this direction.
|
|
167
|
+
*
|
|
168
|
+
* @internal
|
|
169
|
+
*/
|
|
170
|
+
export function validateLoaderCompatibilityWithDriver(
|
|
171
|
+
maybeDriverCompatDetails: ILayerCompatDetails | undefined,
|
|
172
|
+
maybeDriverCompatRequirements: ILayerCompatSupportRequirements | undefined,
|
|
173
|
+
disposeFn: (error?: ICriticalContainerError) => void,
|
|
174
|
+
mc: MonitoringContext,
|
|
175
|
+
): void {
|
|
176
|
+
if (maybeDriverCompatRequirements === undefined) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
validateLayerCompatibility(
|
|
180
|
+
/* validatingLayer */ {
|
|
181
|
+
layer: "driver",
|
|
182
|
+
packageInfo: maybeDriverCompatDetails ?? defaultLayerCompatDetails,
|
|
183
|
+
compatSupportRequirements: maybeDriverCompatRequirements,
|
|
184
|
+
},
|
|
185
|
+
/* targetLayer */ {
|
|
186
|
+
layer: "loader",
|
|
187
|
+
compatDetails: loaderCompatDetailsForDriver,
|
|
188
|
+
},
|
|
189
|
+
{ disposeFn, mc },
|
|
125
190
|
);
|
|
126
191
|
}
|
package/src/packageVersion.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import type { FluidIterableIterator } from "@fluidframework/core-interfaces";
|
|
6
7
|
import type { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
|
|
7
8
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
8
9
|
|
|
@@ -140,7 +141,7 @@ export class PendingLocalStateStore<TKey> {
|
|
|
140
141
|
/**
|
|
141
142
|
* Returns an iterator over [key, serializedState] pairs.
|
|
142
143
|
*/
|
|
143
|
-
entries():
|
|
144
|
+
entries(): FluidIterableIterator<[TKey, string]> {
|
|
144
145
|
const iterator = this.#pendingStates.entries();
|
|
145
146
|
return {
|
|
146
147
|
next: (): IteratorResult<[TKey, string]> => {
|
|
@@ -151,20 +152,23 @@ export class PendingLocalStateStore<TKey> {
|
|
|
151
152
|
}
|
|
152
153
|
return { done, value: [value[0], JSON.stringify(value[1])] };
|
|
153
154
|
},
|
|
155
|
+
[Symbol.iterator](): FluidIterableIterator<[TKey, string]> {
|
|
156
|
+
return this;
|
|
157
|
+
},
|
|
154
158
|
};
|
|
155
159
|
}
|
|
156
160
|
|
|
157
161
|
/**
|
|
158
162
|
* Returns an iterator over the stored keys.
|
|
159
163
|
*/
|
|
160
|
-
keys():
|
|
164
|
+
keys(): FluidIterableIterator<TKey> {
|
|
161
165
|
return this.#pendingStates.keys();
|
|
162
166
|
}
|
|
163
167
|
|
|
164
168
|
/**
|
|
165
169
|
* Makes the store iterable with `for...of` loops.
|
|
166
170
|
*/
|
|
167
|
-
[Symbol.iterator]():
|
|
171
|
+
[Symbol.iterator](): FluidIterableIterator<[TKey, string]> {
|
|
168
172
|
return this.entries();
|
|
169
173
|
}
|
|
170
174
|
}
|
package/src/pointInTime/DEV.md
CHANGED
|
@@ -9,12 +9,23 @@ This flow consumes a sequence number. It does not create or resolve version mark
|
|
|
9
9
|
The host calls:
|
|
10
10
|
|
|
11
11
|
```ts
|
|
12
|
+
import { createOdspDocumentServiceFactory } from "@fluidframework/odsp-driver/legacy";
|
|
13
|
+
import { createPointInTimeDocumentService } from "@fluidframework/odsp-driver/legacy/point-in-time";
|
|
14
|
+
|
|
15
|
+
const documentServiceFactory = createOdspDocumentServiceFactory({
|
|
16
|
+
getStorageToken,
|
|
17
|
+
getWebsocketToken,
|
|
18
|
+
persistedCache,
|
|
19
|
+
hostPolicy,
|
|
20
|
+
pointInTimeDocumentServiceImplementation: createPointInTimeDocumentService,
|
|
21
|
+
});
|
|
22
|
+
|
|
12
23
|
const historicalContainer = await loadContainerToSequenceNumber({
|
|
13
24
|
request,
|
|
14
25
|
loadToSequenceNumber,
|
|
15
26
|
codeLoader,
|
|
16
27
|
urlResolver,
|
|
17
|
-
|
|
28
|
+
documentServiceFactory,
|
|
18
29
|
logger,
|
|
19
30
|
signal,
|
|
20
31
|
});
|
|
@@ -76,6 +87,28 @@ That service must satisfy the following:
|
|
|
76
87
|
|
|
77
88
|
The loader detects this capability structurally so callers pass the driver's factory directly. The adapter is internal and cannot create new containers.
|
|
78
89
|
|
|
90
|
+
### Capability typing and validation boundary
|
|
91
|
+
|
|
92
|
+
The point-in-time capability is not part of the general `IDocumentServiceFactory` contract. Fluid
|
|
93
|
+
therefore owns both runtime checks needed to bridge the optional capability:
|
|
94
|
+
|
|
95
|
+
- The host imports `createPointInTimeDocumentService` from the dedicated ODSP point-in-time entrypoint
|
|
96
|
+
and injects it through `createOdspDocumentServiceFactory` options.
|
|
97
|
+
- `asPointInTimeCapableFactory` performs the cross-driver structural check at the loader boundary.
|
|
98
|
+
`loadContainerToSequenceNumber` uses this check before constructing its internal adapter.
|
|
99
|
+
|
|
100
|
+
A host should not repeat the capability check or cast a general factory. It passes the configured
|
|
101
|
+
ODSP factory directly to `loadContainerToSequenceNumber`. Keeping detection in Fluid also gives
|
|
102
|
+
non-ODSP drivers one generic loader boundary to satisfy without exposing their implementation details
|
|
103
|
+
to hosts.
|
|
104
|
+
|
|
105
|
+
If the host-facing orchestration moves to the proposed feature package, the private generic
|
|
106
|
+
capability interface, `asPointInTimeCapableFactory`, and
|
|
107
|
+
`PointInTimeDocumentServiceFactory` move with it. The ODSP public interface, construction helper,
|
|
108
|
+
and implementation remain in `@fluidframework/odsp-driver`. The capability should move into a
|
|
109
|
+
shared driver contract only if multiple drivers need a public compile-time type; structural
|
|
110
|
+
detection is sufficient for the current single-provider alpha API.
|
|
111
|
+
|
|
79
112
|
## Package ownership and planned extraction
|
|
80
113
|
|
|
81
114
|
The current placement in `@fluidframework/container-loader` was explicitly described as
|
|
@@ -118,7 +151,7 @@ be regenerated rather than edited by hand.
|
|
|
118
151
|
| Current owner | What remains | Why |
|
|
119
152
|
| --- | --- | --- |
|
|
120
153
|
| `@fluidframework/container-loader` | `loadContainerPaused` and its general loading machinery | This is the driver-agnostic loader primitive. It predates point-in-time loading and is also used by non-ODSP callers. The feature package should compose it rather than duplicate loader internals. |
|
|
121
|
-
| `@fluidframework/odsp-driver` | `
|
|
154
|
+
| `@fluidframework/odsp-driver` | The optional point-in-time capability on `OdspDocumentServiceFactoryCore`, `pointInTimeDriver/`, and `odspVersionManager/` | These components depend on ODSP file-version APIs, resolved URLs, caches, storage policies, and epoch tracking. Moving them would either leak ODSP internals into the feature package or duplicate driver construction logic. |
|
|
122
155
|
| `@fluidframework/container-runtime` | `versionMarks/` resolver implementation and runtime hooks | Capture and locator resolution are driver-agnostic but tightly coupled to outbound batching, pending state, inbound processing, and the runtime lifecycle. They produce the sequence number consumed by the feature package; they do not perform historical loading. |
|
|
123
156
|
|
|
124
157
|
The new package should not import ODSP directly. Its contract remains capability-based so another
|
|
@@ -150,7 +183,14 @@ must not make container-loader depend on ODSP or merge mark resolution into cont
|
|
|
150
183
|
|
|
151
184
|
## ODSP implementation
|
|
152
185
|
|
|
153
|
-
|
|
186
|
+
`OdspDocumentServiceFactoryCore` exposes the optional `createPointInTimeDocumentService` capability
|
|
187
|
+
only when the consumer supplies an implementation. ODSP owns that implementation in the dedicated
|
|
188
|
+
`@fluidframework/odsp-driver/legacy/point-in-time` entrypoint, while the consumer controls whether the
|
|
189
|
+
feature enters its dependency graph. The consumer injects the implementation through
|
|
190
|
+
`createOdspDocumentServiceFactory` options.
|
|
191
|
+
|
|
192
|
+
For each point-in-time request, ODSP resolves the closest recoverable driveItem version at or before
|
|
193
|
+
the target. It then composes:
|
|
154
194
|
|
|
155
195
|
- storage from that file version;
|
|
156
196
|
- bounded delta storage from the live document;
|
|
@@ -179,7 +219,10 @@ Like normal storage catch-up, retriable network failures may retry for an extend
|
|
|
179
219
|
| `loadContainerToSequenceNumber.ts` | Validates the target and driver capability, installs the adapter, and starts the paused load. |
|
|
180
220
|
| `pointInTimeServices.ts` | Defines the structural driver capability and adapts it to `IDocumentServiceFactory`. |
|
|
181
221
|
| `loadPaused.ts` | Loads read-only, replays to the exact target, pauses processing, disconnects, and handles cancellation. |
|
|
182
|
-
| `packages/drivers/odsp-driver/src/
|
|
222
|
+
| `packages/drivers/odsp-driver/src/odspDocumentServiceFactory.ts` | Accepts and installs a consumer-supplied PIT implementation and constructs a typed capable factory. |
|
|
223
|
+
| `packages/drivers/odsp-driver/src/odspDocumentServiceFactoryCore.ts` | Defines the injection contract and delegates to the implementation only when supplied. |
|
|
224
|
+
| `packages/drivers/odsp-driver/src/pointInTime.ts` | Dedicated consumer-imported feature entrypoint. |
|
|
225
|
+
| `packages/drivers/odsp-driver/src/pointInTimeDriver/createPointInTimeDocumentService.ts` | Owns ODSP base selection, shared epoch tracking, and historical/live service composition. |
|
|
183
226
|
| `packages/drivers/odsp-driver/src/pointInTimeDriver/odspPointInTimeDocumentService.ts` | Recombines historical storage with bounded live delta storage and enforces storage-only behavior. |
|
|
184
227
|
|
|
185
228
|
## Test map
|
|
@@ -75,6 +75,12 @@ export interface IPendingContainerState extends SnapshotWithBlobs {
|
|
|
75
75
|
* This container was attached (as opposed to IPendingDetachedContainerState.attached which is false)
|
|
76
76
|
*/
|
|
77
77
|
attached: true;
|
|
78
|
+
/**
|
|
79
|
+
* Indicates that blob payloads are omitted and must be read from live storage.
|
|
80
|
+
*
|
|
81
|
+
* Undefined for existing and self-contained pending state.
|
|
82
|
+
*/
|
|
83
|
+
blobContentsMode?: "reference";
|
|
78
84
|
/**
|
|
79
85
|
* Runtime-specific state that will be needed to properly rehydrate
|
|
80
86
|
* (it's included in ContainerContext passed to instantiateRuntime)
|
package/src/utils.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import {
|
|
7
7
|
bufferToString,
|
|
8
8
|
stringToBuffer,
|
|
9
|
-
|
|
9
|
+
AnyUint8ArrayToArrayBuffer,
|
|
10
10
|
} from "@fluid-internal/client-utils";
|
|
11
11
|
import { assert, compareArrays, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
12
12
|
import { type ISummaryTree, SummaryType } from "@fluidframework/driver-definitions";
|
|
@@ -75,7 +75,7 @@ export interface IParsedUrl {
|
|
|
75
75
|
* Utility api to parse the IResolvedUrl.url into specific parts like querystring, path to get
|
|
76
76
|
* deep link info etc.
|
|
77
77
|
* Warning - This function may not be compatible with any Url Resolver's resolved url. It works
|
|
78
|
-
* with urls of type: protocol
|
|
78
|
+
* with urls of type: `protocol://{host}/.../..?{queryString}`
|
|
79
79
|
* @param url - This is the IResolvedUrl.url part of the resolved url.
|
|
80
80
|
* @returns The IParsedUrl representing the input URL, or undefined if the format was not supported
|
|
81
81
|
* @legacy @beta
|
|
@@ -172,7 +172,7 @@ function convertSummaryToISnapshot(
|
|
|
172
172
|
blobContents.set(
|
|
173
173
|
blobId,
|
|
174
174
|
summaryObject.content instanceof Uint8Array
|
|
175
|
-
?
|
|
175
|
+
? AnyUint8ArrayToArrayBuffer(summaryObject.content)
|
|
176
176
|
: stringToBuffer(summaryObject.content, "utf8"),
|
|
177
177
|
);
|
|
178
178
|
|
package/tsconfig.json
CHANGED
package/internal.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outFileLegacyAlpha legacyAlpha --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export * from "./lib/index.js";
|
package/legacy/alpha.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outFileLegacyAlpha legacyAlpha --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export * from "../lib/legacyAlpha.js";
|
package/legacy.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outFileLegacyAlpha legacyAlpha --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export * from "./lib/legacy.js";
|
|
File without changes
|
|
File without changes
|