@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.
- package/{.eslintrc.js → .eslintrc.cjs} +4 -1
- package/{.mocharc.js → .mocharc.cjs} +1 -1
- package/CHANGELOG.md +42 -0
- package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
- package/api-extractor-lint.json +1 -1
- package/api-extractor.json +1 -1
- package/api-report/datastore.api.md +7 -11
- package/dist/channelContext.d.ts +5 -4
- package/dist/channelContext.d.ts.map +1 -1
- package/dist/channelContext.js +6 -5
- package/dist/channelContext.js.map +1 -1
- package/dist/channelDeltaConnection.d.ts +6 -3
- package/dist/channelDeltaConnection.d.ts.map +1 -1
- package/dist/channelDeltaConnection.js +46 -7
- package/dist/channelDeltaConnection.js.map +1 -1
- package/dist/dataStoreRuntime.d.ts +25 -6
- package/dist/dataStoreRuntime.d.ts.map +1 -1
- package/dist/dataStoreRuntime.js +145 -62
- package/dist/dataStoreRuntime.js.map +1 -1
- package/dist/datastore-alpha.d.ts +23 -6
- package/dist/datastore-beta.d.ts +1 -2
- package/dist/datastore-public.d.ts +1 -2
- package/dist/datastore-untrimmed.d.ts +23 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/localChannelContext.d.ts +18 -3
- package/dist/localChannelContext.d.ts.map +1 -1
- package/dist/localChannelContext.js +32 -10
- package/dist/localChannelContext.js.map +1 -1
- package/dist/package.json +3 -0
- package/dist/remoteChannelContext.d.ts +2 -2
- package/dist/remoteChannelContext.d.ts.map +1 -1
- package/dist/remoteChannelContext.js +6 -5
- package/dist/remoteChannelContext.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/{channelContext.d.mts → channelContext.d.ts} +6 -5
- package/lib/channelContext.d.ts.map +1 -0
- package/lib/{channelContext.mjs → channelContext.js} +6 -5
- package/lib/channelContext.js.map +1 -0
- package/lib/{channelDeltaConnection.d.mts → channelDeltaConnection.d.ts} +7 -4
- package/lib/channelDeltaConnection.d.ts.map +1 -0
- package/lib/channelDeltaConnection.js +92 -0
- package/lib/channelDeltaConnection.js.map +1 -0
- package/lib/{channelStorageService.d.mts → channelStorageService.d.ts} +1 -1
- package/lib/channelStorageService.d.ts.map +1 -0
- package/lib/{channelStorageService.mjs → channelStorageService.js} +1 -1
- package/lib/channelStorageService.js.map +1 -0
- package/lib/{dataStoreRuntime.d.mts → dataStoreRuntime.d.ts} +26 -7
- package/lib/dataStoreRuntime.d.ts.map +1 -0
- package/lib/{dataStoreRuntime.mjs → dataStoreRuntime.js} +142 -59
- package/lib/dataStoreRuntime.js.map +1 -0
- package/lib/{datastore-alpha.d.mts → datastore-alpha.d.ts} +23 -6
- package/lib/{datastore-public.d.mts → datastore-beta.d.ts} +1 -2
- package/lib/{datastore-beta.d.mts → datastore-public.d.ts} +1 -2
- package/lib/{datastore-untrimmed.d.mts → datastore-untrimmed.d.ts} +23 -6
- package/lib/{fluidHandle.d.mts → fluidHandle.d.ts} +1 -1
- package/lib/fluidHandle.d.ts.map +1 -0
- package/lib/{fluidHandle.mjs → fluidHandle.js} +1 -1
- package/lib/fluidHandle.js.map +1 -0
- package/lib/{index.d.mts → index.d.ts} +3 -3
- package/lib/index.d.ts.map +1 -0
- package/lib/{index.mjs → index.js} +3 -3
- package/lib/index.js.map +1 -0
- package/lib/{localChannelContext.d.mts → localChannelContext.d.ts} +19 -4
- package/lib/localChannelContext.d.ts.map +1 -0
- package/lib/{localChannelContext.mjs → localChannelContext.js} +29 -7
- package/lib/localChannelContext.js.map +1 -0
- package/lib/{localChannelStorageService.d.mts → localChannelStorageService.d.ts} +1 -1
- package/lib/localChannelStorageService.d.ts.map +1 -0
- package/lib/{localChannelStorageService.mjs → localChannelStorageService.js} +1 -1
- package/lib/localChannelStorageService.js.map +1 -0
- package/lib/{remoteChannelContext.d.mts → remoteChannelContext.d.ts} +3 -3
- package/lib/remoteChannelContext.d.ts.map +1 -0
- package/lib/{remoteChannelContext.mjs → remoteChannelContext.js} +4 -3
- package/lib/remoteChannelContext.js.map +1 -0
- package/lib/test/channelStorageService.spec.js +70 -0
- package/lib/test/channelStorageService.spec.js.map +1 -0
- package/lib/test/dataStoreRuntime.spec.js +121 -0
- package/lib/test/dataStoreRuntime.spec.js.map +1 -0
- package/lib/test/localChannelContext.spec.js +41 -0
- package/lib/test/localChannelContext.spec.js.map +1 -0
- package/lib/test/localChannelStorageService.spec.js +72 -0
- package/lib/test/localChannelStorageService.spec.js.map +1 -0
- package/lib/test/remoteChannelContext.spec.js +33 -0
- package/lib/test/remoteChannelContext.spec.js.map +1 -0
- package/lib/test/types/validateDatastorePrevious.generated.js +16 -0
- package/lib/test/types/validateDatastorePrevious.generated.js.map +1 -0
- package/package.json +48 -50
- package/src/channelContext.ts +6 -3
- package/src/channelDeltaConnection.ts +69 -5
- package/src/dataStoreRuntime.ts +181 -81
- package/src/index.ts +2 -2
- package/src/localChannelContext.ts +38 -5
- package/src/remoteChannelContext.ts +4 -2
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +2 -5
- package/lib/channelContext.d.mts.map +0 -1
- package/lib/channelContext.mjs.map +0 -1
- package/lib/channelDeltaConnection.d.mts.map +0 -1
- package/lib/channelDeltaConnection.mjs +0 -53
- package/lib/channelDeltaConnection.mjs.map +0 -1
- package/lib/channelStorageService.d.mts.map +0 -1
- package/lib/channelStorageService.mjs.map +0 -1
- package/lib/dataStoreRuntime.d.mts.map +0 -1
- package/lib/dataStoreRuntime.mjs.map +0 -1
- package/lib/fluidHandle.d.mts.map +0 -1
- package/lib/fluidHandle.mjs.map +0 -1
- package/lib/index.d.mts.map +0 -1
- package/lib/index.mjs.map +0 -1
- package/lib/localChannelContext.d.mts.map +0 -1
- package/lib/localChannelContext.mjs.map +0 -1
- package/lib/localChannelStorageService.d.mts.map +0 -1
- package/lib/localChannelStorageService.mjs.map +0 -1
- package/lib/remoteChannelContext.d.mts.map +0 -1
- 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.
|
|
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.
|
|
18
|
-
"default": "./lib/index.
|
|
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
|
-
"./
|
|
26
|
+
"./public": {
|
|
26
27
|
"import": {
|
|
27
|
-
"types": "./lib/datastore-
|
|
28
|
-
"default": "./lib/index.
|
|
28
|
+
"types": "./lib/datastore-public.d.ts",
|
|
29
|
+
"default": "./lib/index.js"
|
|
29
30
|
},
|
|
30
31
|
"require": {
|
|
31
|
-
"types": "./dist/datastore-
|
|
32
|
+
"types": "./dist/datastore-public.d.ts",
|
|
32
33
|
"default": "./dist/index.js"
|
|
33
34
|
}
|
|
34
35
|
},
|
|
35
|
-
"./
|
|
36
|
+
"./alpha": {
|
|
36
37
|
"import": {
|
|
37
|
-
"types": "./lib/datastore-
|
|
38
|
-
"default": "./lib/index.
|
|
38
|
+
"types": "./lib/datastore-alpha.d.ts",
|
|
39
|
+
"default": "./lib/index.js"
|
|
39
40
|
},
|
|
40
41
|
"require": {
|
|
41
|
-
"types": "./dist/datastore-
|
|
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.
|
|
48
|
-
"default": "./lib/index.
|
|
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.
|
|
91
|
-
"@fluidframework/container-definitions": "2.0.0-dev-rc.
|
|
92
|
-
"@fluidframework/core-interfaces": "2.0.0-dev-rc.
|
|
93
|
-
"@fluidframework/core-utils": "2.0.0-dev-rc.
|
|
94
|
-
"@fluidframework/datastore-definitions": "2.0.0-dev-rc.
|
|
95
|
-
"@fluidframework/driver-definitions": "2.0.0-dev-rc.
|
|
96
|
-
"@fluidframework/driver-utils": "2.0.0-dev-rc.
|
|
97
|
-
"@fluidframework/
|
|
98
|
-
"@fluidframework/
|
|
99
|
-
"@fluidframework/runtime-
|
|
100
|
-
"@fluidframework/
|
|
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-
|
|
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.
|
|
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": "^
|
|
111
|
-
"@fluidframework/
|
|
112
|
-
"@
|
|
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.
|
|
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 --
|
|
149
|
-
"api-extractor:esnext": "api-extractor run --
|
|
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
|
|
155
|
-
"build:test": "
|
|
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": "
|
|
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"
|
package/src/channelContext.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
}
|