@fluidframework/datastore 2.0.0-dev-rc.1.0.0.228517 → 2.0.0-dev-rc.2.0.0.245554

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.
Files changed (117) hide show
  1. package/{.eslintrc.js → .eslintrc.cjs} +4 -1
  2. package/{.mocharc.js → .mocharc.cjs} +1 -1
  3. package/CHANGELOG.md +42 -0
  4. package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
  5. package/api-extractor-lint.json +1 -1
  6. package/api-extractor.json +1 -1
  7. package/api-report/datastore.api.md +7 -11
  8. package/dist/channelContext.d.ts +5 -4
  9. package/dist/channelContext.d.ts.map +1 -1
  10. package/dist/channelContext.js +6 -5
  11. package/dist/channelContext.js.map +1 -1
  12. package/dist/channelDeltaConnection.d.ts +6 -3
  13. package/dist/channelDeltaConnection.d.ts.map +1 -1
  14. package/dist/channelDeltaConnection.js +46 -7
  15. package/dist/channelDeltaConnection.js.map +1 -1
  16. package/dist/dataStoreRuntime.d.ts +25 -6
  17. package/dist/dataStoreRuntime.d.ts.map +1 -1
  18. package/dist/dataStoreRuntime.js +145 -62
  19. package/dist/dataStoreRuntime.js.map +1 -1
  20. package/dist/datastore-alpha.d.ts +23 -6
  21. package/dist/datastore-beta.d.ts +1 -2
  22. package/dist/datastore-public.d.ts +1 -2
  23. package/dist/datastore-untrimmed.d.ts +23 -6
  24. package/dist/index.d.ts +2 -2
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +7 -7
  27. package/dist/index.js.map +1 -1
  28. package/dist/localChannelContext.d.ts +18 -3
  29. package/dist/localChannelContext.d.ts.map +1 -1
  30. package/dist/localChannelContext.js +32 -10
  31. package/dist/localChannelContext.js.map +1 -1
  32. package/dist/package.json +3 -0
  33. package/dist/remoteChannelContext.d.ts +2 -2
  34. package/dist/remoteChannelContext.d.ts.map +1 -1
  35. package/dist/remoteChannelContext.js +6 -5
  36. package/dist/remoteChannelContext.js.map +1 -1
  37. package/dist/tsdoc-metadata.json +1 -1
  38. package/lib/{channelContext.d.mts → channelContext.d.ts} +6 -5
  39. package/lib/channelContext.d.ts.map +1 -0
  40. package/lib/{channelContext.mjs → channelContext.js} +6 -5
  41. package/lib/channelContext.js.map +1 -0
  42. package/lib/{channelDeltaConnection.d.mts → channelDeltaConnection.d.ts} +7 -4
  43. package/lib/channelDeltaConnection.d.ts.map +1 -0
  44. package/lib/channelDeltaConnection.js +92 -0
  45. package/lib/channelDeltaConnection.js.map +1 -0
  46. package/lib/{channelStorageService.d.mts → channelStorageService.d.ts} +1 -1
  47. package/lib/channelStorageService.d.ts.map +1 -0
  48. package/lib/{channelStorageService.mjs → channelStorageService.js} +1 -1
  49. package/lib/channelStorageService.js.map +1 -0
  50. package/lib/{dataStoreRuntime.d.mts → dataStoreRuntime.d.ts} +26 -7
  51. package/lib/dataStoreRuntime.d.ts.map +1 -0
  52. package/lib/{dataStoreRuntime.mjs → dataStoreRuntime.js} +142 -59
  53. package/lib/dataStoreRuntime.js.map +1 -0
  54. package/lib/{datastore-alpha.d.mts → datastore-alpha.d.ts} +23 -6
  55. package/lib/{datastore-public.d.mts → datastore-beta.d.ts} +1 -2
  56. package/lib/{datastore-beta.d.mts → datastore-public.d.ts} +1 -2
  57. package/lib/{datastore-untrimmed.d.mts → datastore-untrimmed.d.ts} +23 -6
  58. package/lib/{fluidHandle.d.mts → fluidHandle.d.ts} +1 -1
  59. package/lib/fluidHandle.d.ts.map +1 -0
  60. package/lib/{fluidHandle.mjs → fluidHandle.js} +1 -1
  61. package/lib/fluidHandle.js.map +1 -0
  62. package/lib/{index.d.mts → index.d.ts} +3 -3
  63. package/lib/index.d.ts.map +1 -0
  64. package/lib/{index.mjs → index.js} +3 -3
  65. package/lib/index.js.map +1 -0
  66. package/lib/{localChannelContext.d.mts → localChannelContext.d.ts} +19 -4
  67. package/lib/localChannelContext.d.ts.map +1 -0
  68. package/lib/{localChannelContext.mjs → localChannelContext.js} +29 -7
  69. package/lib/localChannelContext.js.map +1 -0
  70. package/lib/{localChannelStorageService.d.mts → localChannelStorageService.d.ts} +1 -1
  71. package/lib/localChannelStorageService.d.ts.map +1 -0
  72. package/lib/{localChannelStorageService.mjs → localChannelStorageService.js} +1 -1
  73. package/lib/localChannelStorageService.js.map +1 -0
  74. package/lib/{remoteChannelContext.d.mts → remoteChannelContext.d.ts} +3 -3
  75. package/lib/remoteChannelContext.d.ts.map +1 -0
  76. package/lib/{remoteChannelContext.mjs → remoteChannelContext.js} +4 -3
  77. package/lib/remoteChannelContext.js.map +1 -0
  78. package/lib/test/channelStorageService.spec.js +70 -0
  79. package/lib/test/channelStorageService.spec.js.map +1 -0
  80. package/lib/test/dataStoreRuntime.spec.js +121 -0
  81. package/lib/test/dataStoreRuntime.spec.js.map +1 -0
  82. package/lib/test/localChannelContext.spec.js +41 -0
  83. package/lib/test/localChannelContext.spec.js.map +1 -0
  84. package/lib/test/localChannelStorageService.spec.js +72 -0
  85. package/lib/test/localChannelStorageService.spec.js.map +1 -0
  86. package/lib/test/remoteChannelContext.spec.js +33 -0
  87. package/lib/test/remoteChannelContext.spec.js.map +1 -0
  88. package/lib/test/types/validateDatastorePrevious.generated.js +16 -0
  89. package/lib/test/types/validateDatastorePrevious.generated.js.map +1 -0
  90. package/package.json +48 -50
  91. package/src/channelContext.ts +6 -3
  92. package/src/channelDeltaConnection.ts +69 -5
  93. package/src/dataStoreRuntime.ts +181 -81
  94. package/src/index.ts +2 -2
  95. package/src/localChannelContext.ts +38 -5
  96. package/src/remoteChannelContext.ts +4 -2
  97. package/tsconfig.cjs.json +7 -0
  98. package/tsconfig.json +2 -5
  99. package/lib/channelContext.d.mts.map +0 -1
  100. package/lib/channelContext.mjs.map +0 -1
  101. package/lib/channelDeltaConnection.d.mts.map +0 -1
  102. package/lib/channelDeltaConnection.mjs +0 -53
  103. package/lib/channelDeltaConnection.mjs.map +0 -1
  104. package/lib/channelStorageService.d.mts.map +0 -1
  105. package/lib/channelStorageService.mjs.map +0 -1
  106. package/lib/dataStoreRuntime.d.mts.map +0 -1
  107. package/lib/dataStoreRuntime.mjs.map +0 -1
  108. package/lib/fluidHandle.d.mts.map +0 -1
  109. package/lib/fluidHandle.mjs.map +0 -1
  110. package/lib/index.d.mts.map +0 -1
  111. package/lib/index.mjs.map +0 -1
  112. package/lib/localChannelContext.d.mts.map +0 -1
  113. package/lib/localChannelContext.mjs.map +0 -1
  114. package/lib/localChannelStorageService.d.mts.map +0 -1
  115. package/lib/localChannelStorageService.mjs.map +0 -1
  116. package/lib/remoteChannelContext.d.mts.map +0 -1
  117. package/lib/remoteChannelContext.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateDatastorePrevious.generated.js","sourceRoot":"","sources":["../../../src/test/types/validateDatastorePrevious.generated.ts"],"names":[],"mappings":"AAgCA,gDAAgD,CAC5C,4CAA4C,EAAE,CAAC,CAAC;AAWpD,4CAA4C,CACxC,gDAAgD,EAAE,CAAC,CAAC;AAWxD,kDAAkD;AAC9C,uDAAuD;AACvD,8CAA8C,EAAE,CAAC,CAAC;AAWtD,8CAA8C,CAC1C,kDAAkD,EAAE,CAAC,CAAC;AAW1D,8CAA8C,CAC1C,0CAA0C,EAAE,CAAC,CAAC;AAWlD,0CAA0C,CACtC,8CAA8C,EAAE,CAAC,CAAC;AAWtD,sDAAsD,CAClD,kDAAkD,EAAE,CAAC,CAAC;AAW1D,kDAAkD,CAC9C,sDAAsD,EAAE,CAAC,CAAC;AAW9D,mDAAmD,CAC/C,+CAA+C,EAAE,CAAC,CAAC;AAWvD,+CAA+C,CAC3C,mDAAmD,EAAE,CAAC,CAAC;AAW3D,mDAAmD,CAC/C,+CAA+C,EAAE,CAAC,CAAC;AAWvD,+CAA+C,CAC3C,mDAAmD,EAAE,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/*\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n * Generated by fluid-type-test-generator in @fluidframework/build-tools.\n */\nimport type * as old from \"@fluidframework/datastore-previous\";\nimport type * as current from \"../../index.js\";\n\n\n// See 'build-tools/src/type-test-generator/compatibility.ts' for more information.\ntype TypeOnly<T> = T extends number\n\t? number\n\t: T extends string\n\t? string\n\t: T extends boolean | bigint | symbol\n\t? T\n\t: {\n\t\t\t[P in keyof T]: TypeOnly<T[P]>;\n\t };\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"EnumDeclaration_DataStoreMessageType\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_EnumDeclaration_DataStoreMessageType():\n TypeOnly<old.DataStoreMessageType>;\ndeclare function use_current_EnumDeclaration_DataStoreMessageType(\n use: TypeOnly<current.DataStoreMessageType>): void;\nuse_current_EnumDeclaration_DataStoreMessageType(\n get_old_EnumDeclaration_DataStoreMessageType());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"EnumDeclaration_DataStoreMessageType\": {\"backCompat\": false}\n*/\ndeclare function get_current_EnumDeclaration_DataStoreMessageType():\n TypeOnly<current.DataStoreMessageType>;\ndeclare function use_old_EnumDeclaration_DataStoreMessageType(\n use: TypeOnly<old.DataStoreMessageType>): void;\nuse_old_EnumDeclaration_DataStoreMessageType(\n get_current_EnumDeclaration_DataStoreMessageType());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_FluidDataStoreRuntime\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_FluidDataStoreRuntime():\n TypeOnly<old.FluidDataStoreRuntime>;\ndeclare function use_current_ClassDeclaration_FluidDataStoreRuntime(\n use: TypeOnly<current.FluidDataStoreRuntime>): void;\nuse_current_ClassDeclaration_FluidDataStoreRuntime(\n // @ts-expect-error compatibility expected to be broken\n get_old_ClassDeclaration_FluidDataStoreRuntime());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_FluidDataStoreRuntime\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_FluidDataStoreRuntime():\n TypeOnly<current.FluidDataStoreRuntime>;\ndeclare function use_old_ClassDeclaration_FluidDataStoreRuntime(\n use: TypeOnly<old.FluidDataStoreRuntime>): void;\nuse_old_ClassDeclaration_FluidDataStoreRuntime(\n get_current_ClassDeclaration_FluidDataStoreRuntime());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_FluidObjectHandle\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_FluidObjectHandle():\n TypeOnly<old.FluidObjectHandle>;\ndeclare function use_current_ClassDeclaration_FluidObjectHandle(\n use: TypeOnly<current.FluidObjectHandle>): void;\nuse_current_ClassDeclaration_FluidObjectHandle(\n get_old_ClassDeclaration_FluidObjectHandle());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_FluidObjectHandle\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_FluidObjectHandle():\n TypeOnly<current.FluidObjectHandle>;\ndeclare function use_old_ClassDeclaration_FluidObjectHandle(\n use: TypeOnly<old.FluidObjectHandle>): void;\nuse_old_ClassDeclaration_FluidObjectHandle(\n get_current_ClassDeclaration_FluidObjectHandle());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_ISharedObjectRegistry\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_ISharedObjectRegistry():\n TypeOnly<old.ISharedObjectRegistry>;\ndeclare function use_current_InterfaceDeclaration_ISharedObjectRegistry(\n use: TypeOnly<current.ISharedObjectRegistry>): void;\nuse_current_InterfaceDeclaration_ISharedObjectRegistry(\n get_old_InterfaceDeclaration_ISharedObjectRegistry());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_ISharedObjectRegistry\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_ISharedObjectRegistry():\n TypeOnly<current.ISharedObjectRegistry>;\ndeclare function use_old_InterfaceDeclaration_ISharedObjectRegistry(\n use: TypeOnly<old.ISharedObjectRegistry>): void;\nuse_old_InterfaceDeclaration_ISharedObjectRegistry(\n get_current_InterfaceDeclaration_ISharedObjectRegistry());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_mixinRequestHandler\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_VariableDeclaration_mixinRequestHandler():\n TypeOnly<typeof old.mixinRequestHandler>;\ndeclare function use_current_VariableDeclaration_mixinRequestHandler(\n use: TypeOnly<typeof current.mixinRequestHandler>): void;\nuse_current_VariableDeclaration_mixinRequestHandler(\n get_old_VariableDeclaration_mixinRequestHandler());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_mixinRequestHandler\": {\"backCompat\": false}\n*/\ndeclare function get_current_VariableDeclaration_mixinRequestHandler():\n TypeOnly<typeof current.mixinRequestHandler>;\ndeclare function use_old_VariableDeclaration_mixinRequestHandler(\n use: TypeOnly<typeof old.mixinRequestHandler>): void;\nuse_old_VariableDeclaration_mixinRequestHandler(\n get_current_VariableDeclaration_mixinRequestHandler());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_mixinSummaryHandler\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_VariableDeclaration_mixinSummaryHandler():\n TypeOnly<typeof old.mixinSummaryHandler>;\ndeclare function use_current_VariableDeclaration_mixinSummaryHandler(\n use: TypeOnly<typeof current.mixinSummaryHandler>): void;\nuse_current_VariableDeclaration_mixinSummaryHandler(\n get_old_VariableDeclaration_mixinSummaryHandler());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_mixinSummaryHandler\": {\"backCompat\": false}\n*/\ndeclare function get_current_VariableDeclaration_mixinSummaryHandler():\n TypeOnly<typeof current.mixinSummaryHandler>;\ndeclare function use_old_VariableDeclaration_mixinSummaryHandler(\n use: TypeOnly<typeof old.mixinSummaryHandler>): void;\nuse_old_VariableDeclaration_mixinSummaryHandler(\n get_current_VariableDeclaration_mixinSummaryHandler());\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/datastore",
3
- "version": "2.0.0-dev-rc.1.0.0.228517",
3
+ "version": "2.0.0-dev-rc.2.0.0.245554",
4
4
  "description": "Fluid data store implementation",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -11,60 +11,50 @@
11
11
  "license": "MIT",
12
12
  "author": "Microsoft and contributors",
13
13
  "sideEffects": false,
14
+ "type": "module",
14
15
  "exports": {
15
16
  ".": {
16
17
  "import": {
17
- "types": "./lib/index.d.mts",
18
- "default": "./lib/index.mjs"
18
+ "types": "./lib/index.d.ts",
19
+ "default": "./lib/index.js"
19
20
  },
20
21
  "require": {
21
22
  "types": "./dist/index.d.ts",
22
23
  "default": "./dist/index.js"
23
24
  }
24
25
  },
25
- "./alpha": {
26
+ "./public": {
26
27
  "import": {
27
- "types": "./lib/datastore-alpha.d.mts",
28
- "default": "./lib/index.mjs"
28
+ "types": "./lib/datastore-public.d.ts",
29
+ "default": "./lib/index.js"
29
30
  },
30
31
  "require": {
31
- "types": "./dist/datastore-alpha.d.ts",
32
+ "types": "./dist/datastore-public.d.ts",
32
33
  "default": "./dist/index.js"
33
34
  }
34
35
  },
35
- "./beta": {
36
+ "./alpha": {
36
37
  "import": {
37
- "types": "./lib/datastore-beta.d.mts",
38
- "default": "./lib/index.mjs"
38
+ "types": "./lib/datastore-alpha.d.ts",
39
+ "default": "./lib/index.js"
39
40
  },
40
41
  "require": {
41
- "types": "./dist/datastore-beta.d.ts",
42
+ "types": "./dist/datastore-alpha.d.ts",
42
43
  "default": "./dist/index.js"
43
44
  }
44
45
  },
45
46
  "./internal": {
46
47
  "import": {
47
- "types": "./lib/index.d.mts",
48
- "default": "./lib/index.mjs"
48
+ "types": "./lib/index.d.ts",
49
+ "default": "./lib/index.js"
49
50
  },
50
51
  "require": {
51
52
  "types": "./dist/index.d.ts",
52
53
  "default": "./dist/index.js"
53
54
  }
54
- },
55
- "./public": {
56
- "import": {
57
- "types": "./lib/datastore-public.d.mts",
58
- "default": "./lib/index.mjs"
59
- },
60
- "require": {
61
- "types": "./dist/datastore-public.d.ts",
62
- "default": "./dist/index.js"
63
- }
64
55
  }
65
56
  },
66
57
  "main": "dist/index.js",
67
- "module": "lib/index.mjs",
68
58
  "types": "dist/index.d.ts",
69
59
  "c8": {
70
60
  "all": true,
@@ -87,30 +77,31 @@
87
77
  "temp-directory": "nyc/.nyc_output"
88
78
  },
89
79
  "dependencies": {
90
- "@fluid-internal/client-utils": "2.0.0-dev-rc.1.0.0.228517",
91
- "@fluidframework/container-definitions": "2.0.0-dev-rc.1.0.0.228517",
92
- "@fluidframework/core-interfaces": "2.0.0-dev-rc.1.0.0.228517",
93
- "@fluidframework/core-utils": "2.0.0-dev-rc.1.0.0.228517",
94
- "@fluidframework/datastore-definitions": "2.0.0-dev-rc.1.0.0.228517",
95
- "@fluidframework/driver-definitions": "2.0.0-dev-rc.1.0.0.228517",
96
- "@fluidframework/driver-utils": "2.0.0-dev-rc.1.0.0.228517",
97
- "@fluidframework/protocol-definitions": "^3.1.0",
98
- "@fluidframework/runtime-definitions": "2.0.0-dev-rc.1.0.0.228517",
99
- "@fluidframework/runtime-utils": "2.0.0-dev-rc.1.0.0.228517",
100
- "@fluidframework/telemetry-utils": "2.0.0-dev-rc.1.0.0.228517",
80
+ "@fluid-internal/client-utils": "2.0.0-dev-rc.2.0.0.245554",
81
+ "@fluidframework/container-definitions": "2.0.0-dev-rc.2.0.0.245554",
82
+ "@fluidframework/core-interfaces": "2.0.0-dev-rc.2.0.0.245554",
83
+ "@fluidframework/core-utils": "2.0.0-dev-rc.2.0.0.245554",
84
+ "@fluidframework/datastore-definitions": "2.0.0-dev-rc.2.0.0.245554",
85
+ "@fluidframework/driver-definitions": "2.0.0-dev-rc.2.0.0.245554",
86
+ "@fluidframework/driver-utils": "2.0.0-dev-rc.2.0.0.245554",
87
+ "@fluidframework/id-compressor": "2.0.0-dev-rc.2.0.0.245554",
88
+ "@fluidframework/protocol-definitions": "^3.2.0",
89
+ "@fluidframework/runtime-definitions": "2.0.0-dev-rc.2.0.0.245554",
90
+ "@fluidframework/runtime-utils": "2.0.0-dev-rc.2.0.0.245554",
91
+ "@fluidframework/telemetry-utils": "2.0.0-dev-rc.2.0.0.245554",
101
92
  "lodash": "^4.17.21",
102
93
  "uuid": "^9.0.0"
103
94
  },
104
95
  "devDependencies": {
105
96
  "@arethetypeswrong/cli": "^0.13.3",
106
- "@fluid-tools/build-cli": "^0.29.0",
97
+ "@fluid-internal/mocha-test-setup": "2.0.0-dev-rc.2.0.0.245554",
98
+ "@fluid-tools/build-cli": "^0.34.0",
107
99
  "@fluidframework/build-common": "^2.0.3",
108
- "@fluidframework/build-tools": "^0.29.0",
100
+ "@fluidframework/build-tools": "^0.34.0",
109
101
  "@fluidframework/datastore-previous": "npm:@fluidframework/datastore@2.0.0-internal.8.0.0",
110
- "@fluidframework/eslint-config-fluid": "^3.2.0",
111
- "@fluidframework/mocha-test-setup": "2.0.0-dev-rc.1.0.0.228517",
112
- "@fluidframework/test-runtime-utils": "2.0.0-dev-rc.1.0.0.228517",
113
- "@microsoft/api-extractor": "^7.38.3",
102
+ "@fluidframework/eslint-config-fluid": "^5.1.0",
103
+ "@fluidframework/test-runtime-utils": "2.0.0-dev-rc.2.0.0.245554",
104
+ "@microsoft/api-extractor": "^7.42.3",
114
105
  "@types/lodash": "^4.14.118",
115
106
  "@types/mocha": "^9.1.1",
116
107
  "@types/node": "^18.19.0",
@@ -118,14 +109,13 @@
118
109
  "c8": "^8.0.1",
119
110
  "copyfiles": "^2.4.1",
120
111
  "cross-env": "^7.0.3",
121
- "eslint": "~8.50.0",
112
+ "eslint": "~8.55.0",
122
113
  "mocha": "^10.2.0",
123
114
  "mocha-json-output-reporter": "^2.0.1",
124
115
  "mocha-multi-reporters": "^1.5.1",
125
116
  "moment": "^2.21.0",
126
117
  "prettier": "~3.0.3",
127
118
  "rimraf": "^4.4.0",
128
- "tsc-multi": "^1.1.0",
129
119
  "typescript": "~5.1.6"
130
120
  },
131
121
  "fluidBuild": {
@@ -141,18 +131,24 @@
141
131
  }
142
132
  },
143
133
  "typeValidation": {
144
- "broken": {}
134
+ "broken": {
135
+ "ClassDeclaration_FluidDataStoreRuntime": {
136
+ "forwardCompat": false
137
+ }
138
+ }
145
139
  },
146
140
  "scripts": {
147
141
  "api": "fluid-build . --task api",
148
- "api-extractor:commonjs": "api-extractor run --local",
149
- "api-extractor:esnext": "api-extractor run --config ./api-extractor-esm.json",
142
+ "api-extractor:commonjs": "api-extractor run --config ./api-extractor-cjs.json",
143
+ "api-extractor:esnext": "api-extractor run --local",
150
144
  "build": "fluid-build . --task build",
151
145
  "build:commonjs": "fluid-build . --task commonjs",
152
146
  "build:compile": "fluid-build . --task compile",
153
147
  "build:docs": "fluid-build . --task api",
154
- "build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
155
- "build:test": "tsc --project ./src/test/tsconfig.json",
148
+ "build:esnext": "tsc --project ./tsconfig.json",
149
+ "build:test": "npm run build:test:esm && npm run build:test:cjs",
150
+ "build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
151
+ "build:test:esm": "tsc --project ./src/test/tsconfig.json",
156
152
  "check:are-the-types-wrong": "attw --pack . --entrypoints .",
157
153
  "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
158
154
  "ci:build:docs": "api-extractor run",
@@ -166,9 +162,11 @@
166
162
  "prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
167
163
  "test": "npm run test:mocha",
168
164
  "test:coverage": "c8 npm test",
169
- "test:mocha": "mocha --ignore \"dist/test/types/*\" --recursive dist/test --exit -r node_modules/@fluidframework/mocha-test-setup",
165
+ "test:mocha": "npm run test:mocha:esm && echo skipping cjs to avoid overhead - npm run test:mocha:cjs",
166
+ "test:mocha:cjs": "mocha --recursive \"dist/test/**/*.spec.*js\" --exit",
167
+ "test:mocha:esm": "mocha --recursive \"lib/test/**/*.spec.*js\" --exit",
170
168
  "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
171
- "tsc": "tsc",
169
+ "tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
172
170
  "tsc:watch": "tsc --watch",
173
171
  "typetests:gen": "fluid-type-test-generator",
174
172
  "typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
@@ -27,9 +27,9 @@ import {
27
27
  } from "@fluidframework/runtime-definitions";
28
28
  import { addBlobToSummary } from "@fluidframework/runtime-utils";
29
29
  import { readAndParse } from "@fluidframework/driver-utils";
30
- import { ChannelStorageService } from "./channelStorageService";
31
- import { ChannelDeltaConnection } from "./channelDeltaConnection";
32
- import { ISharedObjectRegistry } from "./dataStoreRuntime";
30
+ import { ChannelStorageService } from "./channelStorageService.js";
31
+ import { ChannelDeltaConnection } from "./channelDeltaConnection.js";
32
+ import { ISharedObjectRegistry } from "./dataStoreRuntime.js";
33
33
 
34
34
  export const attributesBlobKey = ".attributes";
35
35
 
@@ -78,6 +78,7 @@ export function createChannelServiceEndpoints(
78
78
  submitFn: (content: any, localOpMetadata: unknown) => void,
79
79
  dirtyFn: () => void,
80
80
  addedGCOutboundReferenceFn: (srcHandle: IFluidHandle, outboundHandle: IFluidHandle) => void,
81
+ isAttachedAndVisible: () => boolean,
81
82
  storageService: IDocumentStorageService,
82
83
  logger: ITelemetryLoggerExt,
83
84
  tree?: ISnapshotTree,
@@ -88,6 +89,7 @@ export function createChannelServiceEndpoints(
88
89
  (message, localOpMetadata) => submitFn(message, localOpMetadata),
89
90
  dirtyFn,
90
91
  addedGCOutboundReferenceFn,
92
+ isAttachedAndVisible,
91
93
  );
92
94
  const objectStorage = new ChannelStorageService(tree, storageService, logger, extraBlobs);
93
95
 
@@ -97,6 +99,7 @@ export function createChannelServiceEndpoints(
97
99
  };
98
100
  }
99
101
 
102
+ /** Used to get the channel's summary for the DDS or DataStore attach op */
100
103
  export function summarizeChannel(
101
104
  channel: IChannel,
102
105
  fullTree: boolean = false,
@@ -9,8 +9,44 @@ import { IDeltaConnection, IDeltaHandler } from "@fluidframework/datastore-defin
9
9
  import { DataProcessingError } from "@fluidframework/telemetry-utils";
10
10
  import { IFluidHandle } from "@fluidframework/core-interfaces";
11
11
 
12
+ const stashedOpMetadataMark = Symbol();
13
+
14
+ type StashedOpMetadata = { contents: any; metadata: unknown }[] &
15
+ Record<typeof stashedOpMetadataMark, typeof stashedOpMetadataMark>;
16
+
17
+ function createStashedOpMetadata(): StashedOpMetadata {
18
+ const arr = [];
19
+ Object.defineProperty(arr, stashedOpMetadataMark, {
20
+ value: stashedOpMetadataMark,
21
+ writable: false,
22
+ enumerable: true,
23
+ });
24
+ return arr as any as StashedOpMetadata;
25
+ }
26
+
27
+ function isStashedOpMetadata(md: unknown): md is StashedOpMetadata {
28
+ return (
29
+ Array.isArray(md) &&
30
+ stashedOpMetadataMark in md &&
31
+ md[stashedOpMetadataMark] === stashedOpMetadataMark
32
+ );
33
+ }
34
+
35
+ function processWithStashedOpMetadataHandling(
36
+ content: any,
37
+ localOpMetaData: unknown,
38
+ func: (contents: any, metadata: unknown) => void,
39
+ ) {
40
+ if (isStashedOpMetadata(localOpMetaData)) {
41
+ localOpMetaData.forEach(({ contents, metadata }) => func(contents, metadata));
42
+ } else {
43
+ func(content, localOpMetaData);
44
+ }
45
+ }
46
+
12
47
  export class ChannelDeltaConnection implements IDeltaConnection {
13
48
  private _handler: IDeltaHandler | undefined;
49
+ private stashedOpMd: StashedOpMetadata | undefined;
14
50
 
15
51
  private get handler(): IDeltaHandler {
16
52
  assert(!!this._handler, 0x177 /* "Missing delta handler" */);
@@ -22,13 +58,14 @@ export class ChannelDeltaConnection implements IDeltaConnection {
22
58
 
23
59
  constructor(
24
60
  private _connected: boolean,
25
- public readonly submit: (content: any, localOpMetadata: unknown) => void,
61
+ private readonly submitFn: (content: any, localOpMetadata: unknown) => void,
26
62
  public readonly dirty: () => void,
27
63
  /** @deprecated There is no replacement for this, its functionality is no longer needed at this layer. */
28
64
  public readonly addedGCOutboundReference: (
29
65
  srcHandle: IFluidHandle,
30
66
  outboundHandle: IFluidHandle,
31
67
  ) => void,
68
+ private readonly isAttachedAndVisible: () => boolean,
32
69
  ) {}
33
70
 
34
71
  public attach(handler: IDeltaHandler) {
@@ -44,7 +81,12 @@ export class ChannelDeltaConnection implements IDeltaConnection {
44
81
  public process(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown) {
45
82
  try {
46
83
  // catches as data processing error whether or not they come from async pending queues
47
- this.handler.process(message, local, localOpMetadata);
84
+ processWithStashedOpMetadataHandling(
85
+ message.contents,
86
+ localOpMetadata,
87
+ (contents, metadata) =>
88
+ this.handler.process({ ...message, contents }, local, metadata),
89
+ );
48
90
  } catch (error) {
49
91
  throw DataProcessingError.wrapIfUnrecognized(
50
92
  error,
@@ -55,17 +97,39 @@ export class ChannelDeltaConnection implements IDeltaConnection {
55
97
  }
56
98
 
57
99
  public reSubmit(content: any, localOpMetadata: unknown) {
58
- this.handler.reSubmit(content, localOpMetadata);
100
+ processWithStashedOpMetadataHandling(
101
+ content,
102
+ localOpMetadata,
103
+ this.handler.reSubmit.bind(this.handler),
104
+ );
59
105
  }
60
106
 
61
107
  public rollback(content: any, localOpMetadata: unknown) {
62
108
  if (this.handler.rollback === undefined) {
63
109
  throw new Error("Handler doesn't support rollback");
64
110
  }
65
- this.handler.rollback(content, localOpMetadata);
111
+ processWithStashedOpMetadataHandling(
112
+ content,
113
+ localOpMetadata,
114
+ this.handler.rollback.bind(this.handler),
115
+ );
66
116
  }
67
117
 
68
118
  public applyStashedOp(content: any): unknown {
69
- return this.handler.applyStashedOp(content);
119
+ try {
120
+ this.stashedOpMd = this.isAttachedAndVisible() ? createStashedOpMetadata() : undefined;
121
+ this.handler.applyStashedOp(content);
122
+ return this.stashedOpMd;
123
+ } finally {
124
+ this.stashedOpMd = undefined;
125
+ }
126
+ }
127
+
128
+ public submit(contents: any, metadata: unknown): void {
129
+ if (this.stashedOpMd !== undefined) {
130
+ this.stashedOpMd.push({ contents, metadata });
131
+ } else {
132
+ this.submitFn(contents, metadata);
133
+ }
70
134
  }
71
135
  }