@fluidframework/map 2.0.0-rc.2.0.1 → 2.0.0-rc.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.
Files changed (129) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/api-report/map.api.md +17 -158
  3. package/dist/directory.d.ts +7 -51
  4. package/dist/directory.d.ts.map +1 -1
  5. package/dist/directory.js +39 -107
  6. package/dist/directory.js.map +1 -1
  7. package/dist/directoryFactory.d.ts +54 -0
  8. package/dist/directoryFactory.d.ts.map +1 -0
  9. package/dist/directoryFactory.js +91 -0
  10. package/dist/directoryFactory.js.map +1 -0
  11. package/dist/index.d.ts +3 -45
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +7 -55
  14. package/dist/index.js.map +1 -1
  15. package/dist/interfaces.d.ts +7 -57
  16. package/dist/interfaces.d.ts.map +1 -1
  17. package/dist/interfaces.js.map +1 -1
  18. package/dist/internalInterfaces.d.ts +50 -1
  19. package/dist/internalInterfaces.d.ts.map +1 -1
  20. package/dist/internalInterfaces.js.map +1 -1
  21. package/dist/legacy.d.ts +25 -0
  22. package/dist/localValues.d.ts +1 -1
  23. package/dist/localValues.d.ts.map +1 -1
  24. package/dist/localValues.js +6 -6
  25. package/dist/localValues.js.map +1 -1
  26. package/dist/map.d.ts +4 -36
  27. package/dist/map.d.ts.map +1 -1
  28. package/dist/map.js +9 -60
  29. package/dist/map.js.map +1 -1
  30. package/dist/mapFactory.d.ts +52 -0
  31. package/dist/mapFactory.d.ts.map +1 -0
  32. package/dist/mapFactory.js +71 -0
  33. package/dist/mapFactory.js.map +1 -0
  34. package/dist/mapKernel.d.ts +3 -3
  35. package/dist/mapKernel.d.ts.map +1 -1
  36. package/dist/mapKernel.js +14 -14
  37. package/dist/mapKernel.js.map +1 -1
  38. package/dist/packageVersion.d.ts +1 -1
  39. package/dist/packageVersion.js +1 -1
  40. package/dist/packageVersion.js.map +1 -1
  41. package/dist/public.d.ts +12 -0
  42. package/internal.d.ts +11 -0
  43. package/legacy.d.ts +11 -0
  44. package/lib/directory.d.ts +7 -51
  45. package/lib/directory.d.ts.map +1 -1
  46. package/lib/directory.js +6 -73
  47. package/lib/directory.js.map +1 -1
  48. package/lib/directoryFactory.d.ts +54 -0
  49. package/lib/directoryFactory.d.ts.map +1 -0
  50. package/lib/directoryFactory.js +87 -0
  51. package/lib/directoryFactory.js.map +1 -0
  52. package/lib/index.d.ts +3 -45
  53. package/lib/index.d.ts.map +1 -1
  54. package/lib/index.js +2 -50
  55. package/lib/index.js.map +1 -1
  56. package/lib/interfaces.d.ts +7 -57
  57. package/lib/interfaces.d.ts.map +1 -1
  58. package/lib/interfaces.js.map +1 -1
  59. package/lib/internalInterfaces.d.ts +50 -1
  60. package/lib/internalInterfaces.d.ts.map +1 -1
  61. package/lib/internalInterfaces.js.map +1 -1
  62. package/lib/legacy.d.ts +25 -0
  63. package/lib/localValues.d.ts +1 -1
  64. package/lib/localValues.d.ts.map +1 -1
  65. package/lib/localValues.js +1 -1
  66. package/lib/localValues.js.map +1 -1
  67. package/lib/map.d.ts +4 -36
  68. package/lib/map.d.ts.map +1 -1
  69. package/lib/map.js +4 -54
  70. package/lib/map.js.map +1 -1
  71. package/lib/mapFactory.d.ts +52 -0
  72. package/lib/mapFactory.d.ts.map +1 -0
  73. package/lib/mapFactory.js +67 -0
  74. package/lib/mapFactory.js.map +1 -0
  75. package/lib/mapKernel.d.ts +3 -3
  76. package/lib/mapKernel.d.ts.map +1 -1
  77. package/lib/mapKernel.js +2 -2
  78. package/lib/mapKernel.js.map +1 -1
  79. package/lib/packageVersion.d.ts +1 -1
  80. package/lib/packageVersion.js +1 -1
  81. package/lib/packageVersion.js.map +1 -1
  82. package/lib/public.d.ts +12 -0
  83. package/package.json +105 -59
  84. package/src/directory.ts +16 -100
  85. package/src/directoryFactory.ts +120 -0
  86. package/src/index.ts +2 -73
  87. package/src/interfaces.ts +7 -62
  88. package/src/internalInterfaces.ts +55 -2
  89. package/src/localValues.ts +6 -5
  90. package/src/map.ts +8 -71
  91. package/src/mapFactory.ts +101 -0
  92. package/src/mapKernel.ts +13 -9
  93. package/src/packageVersion.ts +1 -1
  94. package/api-extractor-cjs.json +0 -8
  95. package/dist/map-alpha.d.ts +0 -898
  96. package/dist/map-beta.d.ts +0 -195
  97. package/dist/map-public.d.ts +0 -195
  98. package/dist/map-untrimmed.d.ts +0 -912
  99. package/lib/map-alpha.d.ts +0 -898
  100. package/lib/map-beta.d.ts +0 -195
  101. package/lib/map-public.d.ts +0 -195
  102. package/lib/map-untrimmed.d.ts +0 -912
  103. package/lib/test/memory/directory.spec.js +0 -71
  104. package/lib/test/memory/directory.spec.js.map +0 -1
  105. package/lib/test/memory/map.spec.js +0 -71
  106. package/lib/test/memory/map.spec.js.map +0 -1
  107. package/lib/test/mocha/directory.order.spec.js +0 -422
  108. package/lib/test/mocha/directory.order.spec.js.map +0 -1
  109. package/lib/test/mocha/directory.snapshot.spec.js +0 -111
  110. package/lib/test/mocha/directory.snapshot.spec.js.map +0 -1
  111. package/lib/test/mocha/directory.spec.js +0 -1406
  112. package/lib/test/mocha/directory.spec.js.map +0 -1
  113. package/lib/test/mocha/directoryEquivalenceUtils.js +0 -36
  114. package/lib/test/mocha/directoryEquivalenceUtils.js.map +0 -1
  115. package/lib/test/mocha/directoryFuzzTests.spec.js +0 -337
  116. package/lib/test/mocha/directoryFuzzTests.spec.js.map +0 -1
  117. package/lib/test/mocha/dirname.cjs +0 -16
  118. package/lib/test/mocha/dirname.cjs.map +0 -1
  119. package/lib/test/mocha/map.fuzz.spec.js +0 -114
  120. package/lib/test/mocha/map.fuzz.spec.js.map +0 -1
  121. package/lib/test/mocha/map.spec.js +0 -685
  122. package/lib/test/mocha/map.spec.js.map +0 -1
  123. package/lib/test/mocha/rebasing.spec.js +0 -158
  124. package/lib/test/mocha/rebasing.spec.js.map +0 -1
  125. package/lib/test/mocha/reconnection.spec.js +0 -327
  126. package/lib/test/mocha/reconnection.spec.js.map +0 -1
  127. package/lib/test/types/validateMapPrevious.generated.js +0 -66
  128. package/lib/test/types/validateMapPrevious.generated.js.map +0 -1
  129. /package/{dist → lib}/tsdoc-metadata.json +0 -0
@@ -0,0 +1,101 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /* eslint-disable import/no-deprecated */
7
+
8
+ import type {
9
+ IChannelAttributes,
10
+ IChannelFactory,
11
+ IChannelServices,
12
+ IFluidDataStoreRuntime,
13
+ } from "@fluidframework/datastore-definitions";
14
+ import type { ISharedObjectKind } from "@fluidframework/shared-object-base";
15
+
16
+ import type { ISharedMap } from "./interfaces.js";
17
+ import { SharedMap as SharedMapInternal } from "./map.js";
18
+ import { pkgVersion } from "./packageVersion.js";
19
+
20
+ /**
21
+ * {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link ISharedMap}.
22
+ *
23
+ * @sealed
24
+ * @alpha
25
+ */
26
+ export class MapFactory implements IChannelFactory<ISharedMap> {
27
+ /**
28
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
29
+ */
30
+ public static readonly Type = "https://graph.microsoft.com/types/map";
31
+
32
+ /**
33
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
34
+ */
35
+ public static readonly Attributes: IChannelAttributes = {
36
+ type: MapFactory.Type,
37
+ snapshotFormatVersion: "0.2",
38
+ packageVersion: pkgVersion,
39
+ };
40
+
41
+ /**
42
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
43
+ */
44
+ public get type(): string {
45
+ return MapFactory.Type;
46
+ }
47
+
48
+ /**
49
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
50
+ */
51
+ public get attributes(): IChannelAttributes {
52
+ return MapFactory.Attributes;
53
+ }
54
+
55
+ /**
56
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
57
+ */
58
+ public async load(
59
+ runtime: IFluidDataStoreRuntime,
60
+ id: string,
61
+ services: IChannelServices,
62
+ attributes: IChannelAttributes,
63
+ ): Promise<ISharedMap> {
64
+ const map = new SharedMapInternal(id, runtime, attributes);
65
+ await map.load(services);
66
+
67
+ return map;
68
+ }
69
+
70
+ /**
71
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}
72
+ */
73
+ public create(runtime: IFluidDataStoreRuntime, id: string): ISharedMap {
74
+ const map = new SharedMapInternal(id, runtime, MapFactory.Attributes);
75
+ map.initializeLocal();
76
+
77
+ return map;
78
+ }
79
+ }
80
+
81
+ /**
82
+ * Entrypoint for {@link ISharedMap} creation.
83
+ * @alpha
84
+ */
85
+ export const SharedMap: ISharedObjectKind<ISharedMap> = {
86
+ getFactory(): IChannelFactory<ISharedMap> {
87
+ return new MapFactory();
88
+ },
89
+
90
+ create(runtime: IFluidDataStoreRuntime, id?: string): ISharedMap {
91
+ return runtime.createChannel(id, MapFactory.Type) as ISharedMap;
92
+ },
93
+ };
94
+
95
+ /**
96
+ * Entrypoint for {@link ISharedMap} creation.
97
+ * @alpha
98
+ * @privateRemarks
99
+ * This alias is for legacy compat from when the SharedMap class was exported as public.
100
+ */
101
+ export type SharedMap = ISharedMap;
package/src/mapKernel.ts CHANGED
@@ -3,19 +3,23 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { IFluidHandle } from "@fluidframework/core-interfaces";
7
- import { IFluidSerializer, ValueType, bindHandles } from "@fluidframework/shared-object-base";
8
- import { assert, unreachableCase } from "@fluidframework/core-utils";
9
6
  import { TypedEventEmitter } from "@fluid-internal/client-utils";
10
- // eslint-disable-next-line import/no-deprecated
11
- import { ISerializableValue, ISerializedValue, ISharedMapEvents } from "./interfaces.js";
7
+ import { IFluidHandle } from "@fluidframework/core-interfaces";
8
+ import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
9
+ import { IFluidSerializer } from "@fluidframework/shared-object-base";
10
+ import { ValueType, bindHandles } from "@fluidframework/shared-object-base/internal";
11
+
12
+ import { ISharedMapEvents } from "./interfaces.js";
12
13
  import {
13
- IMapSetOperation,
14
- IMapDeleteOperation,
14
+ IMapClearLocalOpMetadata,
15
15
  IMapClearOperation,
16
- IMapKeyEditLocalOpMetadata,
16
+ IMapDeleteOperation,
17
17
  IMapKeyAddLocalOpMetadata,
18
- IMapClearLocalOpMetadata,
18
+ IMapKeyEditLocalOpMetadata,
19
+ IMapSetOperation,
20
+ // eslint-disable-next-line import/no-deprecated
21
+ ISerializableValue,
22
+ ISerializedValue,
19
23
  } from "./internalInterfaces.js";
20
24
  import { ILocalValue, LocalValueMaker, makeSerializable } from "./localValues.js";
21
25
 
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/map";
9
- export const pkgVersion = "2.0.0-rc.2.0.1";
9
+ export const pkgVersion = "2.0.0-rc.3.0.0";
@@ -1,8 +0,0 @@
1
- {
2
- "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-base.cjs.primary.json",
4
- // CJS is actually secondary; so, no report.
5
- "apiReport": {
6
- "enabled": false
7
- }
8
- }