@fluidframework/datastore 2.70.0-361788 → 2.71.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/datastore",
3
- "version": "2.70.0-361788",
3
+ "version": "2.71.0",
4
4
  "description": "Fluid data store implementation",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -69,29 +69,29 @@
69
69
  "temp-directory": "nyc/.nyc_output"
70
70
  },
71
71
  "dependencies": {
72
- "@fluid-internal/client-utils": "2.70.0-361788",
73
- "@fluidframework/container-definitions": "2.70.0-361788",
74
- "@fluidframework/core-interfaces": "2.70.0-361788",
75
- "@fluidframework/core-utils": "2.70.0-361788",
76
- "@fluidframework/datastore-definitions": "2.70.0-361788",
77
- "@fluidframework/driver-definitions": "2.70.0-361788",
78
- "@fluidframework/driver-utils": "2.70.0-361788",
79
- "@fluidframework/id-compressor": "2.70.0-361788",
80
- "@fluidframework/runtime-definitions": "2.70.0-361788",
81
- "@fluidframework/runtime-utils": "2.70.0-361788",
82
- "@fluidframework/telemetry-utils": "2.70.0-361788",
72
+ "@fluid-internal/client-utils": "~2.71.0",
73
+ "@fluidframework/container-definitions": "~2.71.0",
74
+ "@fluidframework/core-interfaces": "~2.71.0",
75
+ "@fluidframework/core-utils": "~2.71.0",
76
+ "@fluidframework/datastore-definitions": "~2.71.0",
77
+ "@fluidframework/driver-definitions": "~2.71.0",
78
+ "@fluidframework/driver-utils": "~2.71.0",
79
+ "@fluidframework/id-compressor": "~2.71.0",
80
+ "@fluidframework/runtime-definitions": "~2.71.0",
81
+ "@fluidframework/runtime-utils": "~2.71.0",
82
+ "@fluidframework/telemetry-utils": "~2.71.0",
83
83
  "uuid": "^11.1.0"
84
84
  },
85
85
  "devDependencies": {
86
86
  "@arethetypeswrong/cli": "^0.17.1",
87
87
  "@biomejs/biome": "~1.9.3",
88
- "@fluid-internal/mocha-test-setup": "2.70.0-361788",
88
+ "@fluid-internal/mocha-test-setup": "~2.71.0",
89
89
  "@fluid-tools/build-cli": "^0.58.3",
90
90
  "@fluidframework/build-common": "^2.0.3",
91
91
  "@fluidframework/build-tools": "^0.58.3",
92
- "@fluidframework/datastore-previous": "npm:@fluidframework/datastore@2.63.0",
93
- "@fluidframework/eslint-config-fluid": "^6.1.0",
94
- "@fluidframework/test-runtime-utils": "2.70.0-361788",
92
+ "@fluidframework/datastore-previous": "npm:@fluidframework/datastore@2.70.0",
93
+ "@fluidframework/eslint-config-fluid": "^7.0.0",
94
+ "@fluidframework/test-runtime-utils": "~2.71.0",
95
95
  "@microsoft/api-extractor": "7.52.11",
96
96
  "@types/lodash": "^4.14.118",
97
97
  "@types/mocha": "^10.0.10",
@@ -109,14 +109,7 @@
109
109
  "typescript": "~5.4.5"
110
110
  },
111
111
  "typeValidation": {
112
- "broken": {
113
- "Class_FluidDataStoreRuntime": {
114
- "backCompat": false
115
- },
116
- "ClassStatics_FluidDataStoreRuntime": {
117
- "backCompat": false
118
- }
119
- },
112
+ "broken": {},
120
113
  "entrypoint": "legacy"
121
114
  },
122
115
  "scripts": {
@@ -149,8 +142,8 @@
149
142
  "ci:build:api-reports:legacy": "api-extractor run --config api-extractor/api-extractor.legacy.json",
150
143
  "ci:build:docs": "api-extractor run",
151
144
  "clean": "rimraf --glob dist lib {alpha,beta,internal,legacy}.d.ts \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
152
- "eslint": "eslint --format stylish src",
153
- "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
145
+ "eslint": "eslint --quiet --format stylish src",
146
+ "eslint:fix": "eslint --quiet --format stylish src --fix --fix-type problem,suggestion,layout",
154
147
  "format": "npm run format:biome",
155
148
  "format:biome": "biome check . --write",
156
149
  "lint": "fluid-build . --task lint",
@@ -29,8 +29,7 @@ import type {
29
29
  IFluidDataStoreRuntime,
30
30
  IFluidDataStoreRuntimeEvents,
31
31
  IDeltaManagerErased,
32
- // eslint-disable-next-line import/no-deprecated
33
- IFluidDataStoreRuntimeExperimental,
32
+ IFluidDataStoreRuntimeAlpha,
34
33
  } from "@fluidframework/datastore-definitions/internal";
35
34
  import {
36
35
  type IClientDetails,
@@ -61,12 +60,11 @@ import {
61
60
  type IInboundSignalMessage,
62
61
  type IRuntimeMessageCollection,
63
62
  type IRuntimeMessagesContent,
64
- // eslint-disable-next-line import/no-deprecated
65
- type IContainerRuntimeBaseExperimental,
66
63
  notifiesReadOnlyState,
67
64
  encodeHandlesInContainerRuntime,
68
65
  type IFluidDataStorePolicies,
69
66
  type MinimumVersionForCollab,
67
+ asLegacyAlpha,
70
68
  } from "@fluidframework/runtime-definitions/internal";
71
69
  import {
72
70
  GCDataBuilder,
@@ -137,6 +135,17 @@ export enum DataStoreMessageType {
137
135
  ChannelOp = "op",
138
136
  }
139
137
 
138
+ /**
139
+ * Outgoing {@link FluidDataStoreRuntime} message structures.
140
+ * @internal
141
+ *
142
+ * @privateRemarks
143
+ * The types here are required to satisfy {@link @fluidframework/runtime-definitions#FluidDataStoreMessage} interface.
144
+ */
145
+ export type LocalFluidDataStoreRuntimeMessage =
146
+ | { type: DataStoreMessageType.ChannelOp; content: IEnvelope }
147
+ | { type: DataStoreMessageType.Attach; content: IAttachMessage };
148
+
140
149
  /**
141
150
  * @legacy @beta
142
151
  */
@@ -328,6 +337,7 @@ export class FluidDataStoreRuntime
328
337
  namespace: "FluidDataStoreRuntime",
329
338
  properties: {
330
339
  all: { dataStoreId: uuid(), dataStoreVersion: pkgVersion },
340
+ error: { inStagingMode: () => this.inStagingMode, isDirty: () => this.isDirty },
331
341
  },
332
342
  });
333
343
 
@@ -447,31 +457,20 @@ export class FluidDataStoreRuntime
447
457
  this.localChangesTelemetryCount =
448
458
  this.mc.config.getNumber("Fluid.Telemetry.LocalChangesTelemetryCount") ?? 10;
449
459
 
450
- // Reference these properties to avoid unused private member errors.
451
- // They're accessed via IFluidDataStoreRuntimeExperimental interface.
452
- // eslint-disable-next-line no-void
453
- void [this.inStagingMode, this.isDirty];
454
-
455
460
  this.minVersionForCollab = this.dataStoreContext.minVersionForCollab;
456
461
  }
457
462
 
458
463
  /**
459
- * Implementation of IFluidDataStoreRuntimeExperimental.inStagingMode
464
+ * Implementation of IFluidDataStoreRuntimeAlpha.inStagingMode
460
465
  */
461
- // eslint-disable-next-line import/no-deprecated
462
- private get inStagingMode(): IFluidDataStoreRuntimeExperimental["inStagingMode"] {
463
- return (
464
- // eslint-disable-next-line import/no-deprecated
465
- (this.dataStoreContext.containerRuntime as IContainerRuntimeBaseExperimental)
466
- ?.inStagingMode
467
- );
466
+ private get inStagingMode(): IFluidDataStoreRuntimeAlpha["inStagingMode"] {
467
+ return asLegacyAlpha(this.dataStoreContext.containerRuntime)?.inStagingMode;
468
468
  }
469
469
 
470
470
  /**
471
- * Implementation of IFluidDataStoreRuntimeExperimental.isDirty
471
+ * Implementation of IFluidDataStoreRuntimeAlpha.isDirty
472
472
  */
473
- // eslint-disable-next-line import/no-deprecated
474
- private get isDirty(): IFluidDataStoreRuntimeExperimental["isDirty"] {
473
+ private get isDirty(): IFluidDataStoreRuntimeAlpha["isDirty"] {
475
474
  return this.pendingOpCount.value > 0;
476
475
  }
477
476
 
@@ -1229,7 +1228,7 @@ export class FluidDataStoreRuntime
1229
1228
  type: channel.attributes.type,
1230
1229
  };
1231
1230
  this.pendingAttach.add(channel.id);
1232
- this.submit(DataStoreMessageType.Attach, message);
1231
+ this.submit({ type: DataStoreMessageType.Attach, content: message });
1233
1232
 
1234
1233
  const context = this.contexts.get(channel.id) as LocalChannelContextBase;
1235
1234
  context.makeVisible();
@@ -1237,7 +1236,8 @@ export class FluidDataStoreRuntime
1237
1236
 
1238
1237
  private submitChannelOp(address: string, contents: unknown, localOpMetadata: unknown): void {
1239
1238
  const envelope: IEnvelope = { address, contents };
1240
- this.submit(DataStoreMessageType.ChannelOp, envelope, localOpMetadata);
1239
+ this.verifyNotClosed();
1240
+ this.submit({ type: DataStoreMessageType.ChannelOp, content: envelope }, localOpMetadata);
1241
1241
  }
1242
1242
 
1243
1243
  /**
@@ -1247,12 +1247,10 @@ export class FluidDataStoreRuntime
1247
1247
  private readonly pendingOpCount: { value: number } = initializePendingOpCount();
1248
1248
 
1249
1249
  private submit(
1250
- type: DataStoreMessageType,
1251
- content: unknown,
1250
+ message: LocalFluidDataStoreRuntimeMessage,
1252
1251
  localOpMetadata: unknown = undefined,
1253
1252
  ): void {
1254
- this.verifyNotClosed();
1255
- this.dataStoreContext.submitMessage(type, content, localOpMetadata);
1253
+ this.dataStoreContext.submitMessage(message.type, message.content, localOpMetadata);
1256
1254
  ++this.pendingOpCount.value;
1257
1255
  }
1258
1256
 
@@ -1262,6 +1260,14 @@ export class FluidDataStoreRuntime
1262
1260
  * This typically happens when we reconnect and there are unacked messages.
1263
1261
  * @param content - The content of the original message.
1264
1262
  * @param localOpMetadata - The local metadata associated with the original message.
1263
+ *
1264
+ * @privateRemarks
1265
+ * `type` parameter's type of `DataStoreMessageType` is a covariance exception
1266
+ * over `string` that `IFluidDataStoreChannel` specifies. So long as local
1267
+ * submissions conform to this type all is well. (`unreachableCase` might be
1268
+ * reachable over time without better typing in this area if a mistake is made.)
1269
+ * See {@link @fluidframework/runtime-definitions#FluidDataStoreMessage} comment
1270
+ * for opportunity to resolve this.
1265
1271
  */
1266
1272
  public reSubmit(
1267
1273
  type: DataStoreMessageType,
@@ -1289,7 +1295,8 @@ export class FluidDataStoreRuntime
1289
1295
  }
1290
1296
  case DataStoreMessageType.Attach: {
1291
1297
  // For Attach messages, just submit them again.
1292
- this.submit(type, content, localOpMetadata);
1298
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- `content` needs typed better than `any`
1299
+ this.submit({ type, content }, localOpMetadata);
1293
1300
  break;
1294
1301
  }
1295
1302
  default: {
@@ -1302,6 +1309,14 @@ export class FluidDataStoreRuntime
1302
1309
  * Revert a local op.
1303
1310
  * @param content - The content of the original message.
1304
1311
  * @param localOpMetadata - The local metadata associated with the original message.
1312
+ *
1313
+ * @privateRemarks
1314
+ * `type` parameter's type of `DataStoreMessageType` is a covariance exception
1315
+ * over `string` that `IFluidDataStoreChannel` specifies. So long as local
1316
+ * submissions conform to this type all is well. (`unreachableCase` might be
1317
+ * reachable over time without better typing in this area if a mistake is made.)
1318
+ * See {@link @fluidframework/runtime-definitions#FluidDataStoreMessage} comment
1319
+ * for opportunity to resolve this.
1305
1320
  */
1306
1321
  public rollback?(
1307
1322
  type: DataStoreMessageType,
package/src/index.ts CHANGED
@@ -8,6 +8,7 @@ export {
8
8
  DataStoreMessageType,
9
9
  FluidDataStoreRuntime,
10
10
  type ISharedObjectRegistry,
11
+ type LocalFluidDataStoreRuntimeMessage,
11
12
  mixinRequestHandler,
12
13
  mixinSummaryHandler,
13
14
  } from "./dataStoreRuntime.js";
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/datastore";
9
- export const pkgVersion = "2.70.0-361788";
9
+ export const pkgVersion = "2.71.0";