@fluidframework/merge-tree 2.1.0-281041 → 2.1.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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @fluidframework/merge-tree
2
2
 
3
+ ## 2.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - The Marker.fromJSONObject and TextSegment.fromJSONObject argument types have been corrected ([#21684](https://github.com/microsoft/FluidFramework/pull/21684)) [d2d472bd88](https://github.com/microsoft/FluidFramework/commit/d2d472bd88d8360bb77303079eebef16d5a69131)
8
+
9
+ Previously, the arguments of `Marker.fromJSONObject` and `TextSegment.fromJSONObject` were of type `any`. However, at
10
+ runtime only certain types were expected and using other types would cause errors.
11
+
12
+ Now, the argument for the Marker implementation is of type `IJSONSegment` and the argument for the TextSegment
13
+ implementation is of type `string | IJSONSegment`. This reflects actual runtime support.
14
+
15
+ This change should have no impact on existing code unless the code is using incorrect types. Such code already does not
16
+ function and should be corrected.
17
+
3
18
  ## 2.0.0-rc.5.0.0
4
19
 
5
20
  ### Minor Changes
package/README.md CHANGED
@@ -35,6 +35,10 @@ To access the `public` ([SemVer](https://semver.org/)) APIs, import via `@fluidf
35
35
 
36
36
  To access the `legacy` APIs, import via `@fluidframework/merge-tree/legacy`.
37
37
 
38
+ ## API Documentation
39
+
40
+ API documentation for **@fluidframework/merge-tree** is available at <https://fluidframework.com/docs/apis/merge-tree>.
41
+
38
42
  <!-- prettier-ignore-end -->
39
43
 
40
44
  <!-- AUTO-GENERATED-CONTENT:END -->
@@ -137,10 +141,6 @@ remote clients and should be ignored when processing remote ops.
137
141
  <!-- prettier-ignore-start -->
138
142
  <!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
139
143
 
140
- ## API Documentation
141
-
142
- API documentation for **@fluidframework/merge-tree** is available at <https://fluidframework.com/docs/apis/merge-tree>.
143
-
144
144
  ## Minimum Client Requirements
145
145
 
146
146
  These are the platform requirements for the current version of Fluid Framework Client Packages.
package/dist/ordinal.js CHANGED
@@ -21,7 +21,7 @@ function computeHierarchicalOrdinal(maxCount, actualCount, parentOrdinal, previo
21
21
  else {
22
22
  // eslint-disable-next-line unicorn/prefer-code-point
23
23
  const prevOrdCode = previousOrdinal.charCodeAt(previousOrdinal.length - 1);
24
- (0, internal_1.assert)(prevOrdCode !== undefined, "previous ordinal should not be empty");
24
+ (0, internal_1.assert)(prevOrdCode !== undefined, 0x9ad /* previous ordinal should not be empty */);
25
25
  const localOrdinal = prevOrdCode + ordinalWidth;
26
26
  // eslint-disable-next-line unicorn/prefer-code-point
27
27
  ordinal = parentOrdinal + String.fromCharCode(localOrdinal);
@@ -1 +1 @@
1
- {"version":3,"file":"ordinal.js","sourceRoot":"","sources":["../src/ordinal.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAA+B;AAC/B,kEAA6D;AAE7D,SAAgB,0BAA0B,CACzC,QAAgB,EAChB,WAAmB,EACnB,aAAqB,EACrB,eAAmC;IAEnC,IAAA,iBAAM,EACL,QAAQ,IAAI,EAAE,IAAI,WAAW,IAAI,QAAQ,EACzC,KAAK,CAAC,6DAA6D,CACnE,CAAC;IAEF,MAAM,YAAY,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,CAAC;IACnD,IAAI,OAAe,CAAC;IACpB,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;QACnC,qHAAqH;QACrH,iGAAiG;QACjG,kEAAkE;QAClE,qDAAqD;QACrD,OAAO,GAAG,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;IACjE,CAAC;SAAM,CAAC;QACP,qDAAqD;QACrD,MAAM,WAAW,GAAG,eAAe,CAAC,UAAU,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC3E,IAAA,iBAAM,EAAC,WAAW,KAAK,SAAS,EAAE,sCAAsC,CAAC,CAAC;QAC1E,MAAM,YAAY,GAAG,WAAW,GAAG,YAAY,CAAC;QAChD,qDAAqD;QACrD,OAAO,GAAG,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,OAAO,CAAC;AAChB,CAAC;AA7BD,gEA6BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable no-bitwise */\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nexport function computeHierarchicalOrdinal(\n\tmaxCount: number,\n\tactualCount: number,\n\tparentOrdinal: string,\n\tpreviousOrdinal: string | undefined,\n): string {\n\tassert(\n\t\tmaxCount <= 16 && actualCount <= maxCount,\n\t\t0x3f0 /* count must be less than max, and max must be 16 or less */,\n\t);\n\n\tconst ordinalWidth = 1 << (maxCount - actualCount);\n\tlet ordinal: string;\n\tif (previousOrdinal === undefined) {\n\t\t// Ordinals exist purely for lexicographical sort order and use a small set of valid bytes for each string character.\n\t\t// The extra handling fromCodePoint has for things like surrogate pairs is therefore unnecessary.\n\t\t// disable the rule to use code points when dealing with ordinals.\n\t\t// eslint-disable-next-line unicorn/prefer-code-point\n\t\tordinal = parentOrdinal + String.fromCharCode(ordinalWidth - 1);\n\t} else {\n\t\t// eslint-disable-next-line unicorn/prefer-code-point\n\t\tconst prevOrdCode = previousOrdinal.charCodeAt(previousOrdinal.length - 1);\n\t\tassert(prevOrdCode !== undefined, \"previous ordinal should not be empty\");\n\t\tconst localOrdinal = prevOrdCode + ordinalWidth;\n\t\t// eslint-disable-next-line unicorn/prefer-code-point\n\t\tordinal = parentOrdinal + String.fromCharCode(localOrdinal);\n\t}\n\n\treturn ordinal;\n}\n"]}
1
+ {"version":3,"file":"ordinal.js","sourceRoot":"","sources":["../src/ordinal.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAA+B;AAC/B,kEAA6D;AAE7D,SAAgB,0BAA0B,CACzC,QAAgB,EAChB,WAAmB,EACnB,aAAqB,EACrB,eAAmC;IAEnC,IAAA,iBAAM,EACL,QAAQ,IAAI,EAAE,IAAI,WAAW,IAAI,QAAQ,EACzC,KAAK,CAAC,6DAA6D,CACnE,CAAC;IAEF,MAAM,YAAY,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,CAAC;IACnD,IAAI,OAAe,CAAC;IACpB,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;QACnC,qHAAqH;QACrH,iGAAiG;QACjG,kEAAkE;QAClE,qDAAqD;QACrD,OAAO,GAAG,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;IACjE,CAAC;SAAM,CAAC;QACP,qDAAqD;QACrD,MAAM,WAAW,GAAG,eAAe,CAAC,UAAU,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC3E,IAAA,iBAAM,EAAC,WAAW,KAAK,SAAS,EAAE,KAAK,CAAC,0CAA0C,CAAC,CAAC;QACpF,MAAM,YAAY,GAAG,WAAW,GAAG,YAAY,CAAC;QAChD,qDAAqD;QACrD,OAAO,GAAG,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,OAAO,CAAC;AAChB,CAAC;AA7BD,gEA6BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable no-bitwise */\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nexport function computeHierarchicalOrdinal(\n\tmaxCount: number,\n\tactualCount: number,\n\tparentOrdinal: string,\n\tpreviousOrdinal: string | undefined,\n): string {\n\tassert(\n\t\tmaxCount <= 16 && actualCount <= maxCount,\n\t\t0x3f0 /* count must be less than max, and max must be 16 or less */,\n\t);\n\n\tconst ordinalWidth = 1 << (maxCount - actualCount);\n\tlet ordinal: string;\n\tif (previousOrdinal === undefined) {\n\t\t// Ordinals exist purely for lexicographical sort order and use a small set of valid bytes for each string character.\n\t\t// The extra handling fromCodePoint has for things like surrogate pairs is therefore unnecessary.\n\t\t// disable the rule to use code points when dealing with ordinals.\n\t\t// eslint-disable-next-line unicorn/prefer-code-point\n\t\tordinal = parentOrdinal + String.fromCharCode(ordinalWidth - 1);\n\t} else {\n\t\t// eslint-disable-next-line unicorn/prefer-code-point\n\t\tconst prevOrdCode = previousOrdinal.charCodeAt(previousOrdinal.length - 1);\n\t\tassert(prevOrdCode !== undefined, 0x9ad /* previous ordinal should not be empty */);\n\t\tconst localOrdinal = prevOrdCode + ordinalWidth;\n\t\t// eslint-disable-next-line unicorn/prefer-code-point\n\t\tordinal = parentOrdinal + String.fromCharCode(localOrdinal);\n\t}\n\n\treturn ordinal;\n}\n"]}
package/lib/ordinal.js CHANGED
@@ -18,7 +18,7 @@ export function computeHierarchicalOrdinal(maxCount, actualCount, parentOrdinal,
18
18
  else {
19
19
  // eslint-disable-next-line unicorn/prefer-code-point
20
20
  const prevOrdCode = previousOrdinal.charCodeAt(previousOrdinal.length - 1);
21
- assert(prevOrdCode !== undefined, "previous ordinal should not be empty");
21
+ assert(prevOrdCode !== undefined, 0x9ad /* previous ordinal should not be empty */);
22
22
  const localOrdinal = prevOrdCode + ordinalWidth;
23
23
  // eslint-disable-next-line unicorn/prefer-code-point
24
24
  ordinal = parentOrdinal + String.fromCharCode(localOrdinal);
@@ -1 +1 @@
1
- {"version":3,"file":"ordinal.js","sourceRoot":"","sources":["../src/ordinal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,+BAA+B;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,MAAM,UAAU,0BAA0B,CACzC,QAAgB,EAChB,WAAmB,EACnB,aAAqB,EACrB,eAAmC;IAEnC,MAAM,CACL,QAAQ,IAAI,EAAE,IAAI,WAAW,IAAI,QAAQ,EACzC,KAAK,CAAC,6DAA6D,CACnE,CAAC;IAEF,MAAM,YAAY,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,CAAC;IACnD,IAAI,OAAe,CAAC;IACpB,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;QACnC,qHAAqH;QACrH,iGAAiG;QACjG,kEAAkE;QAClE,qDAAqD;QACrD,OAAO,GAAG,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;IACjE,CAAC;SAAM,CAAC;QACP,qDAAqD;QACrD,MAAM,WAAW,GAAG,eAAe,CAAC,UAAU,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC3E,MAAM,CAAC,WAAW,KAAK,SAAS,EAAE,sCAAsC,CAAC,CAAC;QAC1E,MAAM,YAAY,GAAG,WAAW,GAAG,YAAY,CAAC;QAChD,qDAAqD;QACrD,OAAO,GAAG,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,OAAO,CAAC;AAChB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable no-bitwise */\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nexport function computeHierarchicalOrdinal(\n\tmaxCount: number,\n\tactualCount: number,\n\tparentOrdinal: string,\n\tpreviousOrdinal: string | undefined,\n): string {\n\tassert(\n\t\tmaxCount <= 16 && actualCount <= maxCount,\n\t\t0x3f0 /* count must be less than max, and max must be 16 or less */,\n\t);\n\n\tconst ordinalWidth = 1 << (maxCount - actualCount);\n\tlet ordinal: string;\n\tif (previousOrdinal === undefined) {\n\t\t// Ordinals exist purely for lexicographical sort order and use a small set of valid bytes for each string character.\n\t\t// The extra handling fromCodePoint has for things like surrogate pairs is therefore unnecessary.\n\t\t// disable the rule to use code points when dealing with ordinals.\n\t\t// eslint-disable-next-line unicorn/prefer-code-point\n\t\tordinal = parentOrdinal + String.fromCharCode(ordinalWidth - 1);\n\t} else {\n\t\t// eslint-disable-next-line unicorn/prefer-code-point\n\t\tconst prevOrdCode = previousOrdinal.charCodeAt(previousOrdinal.length - 1);\n\t\tassert(prevOrdCode !== undefined, \"previous ordinal should not be empty\");\n\t\tconst localOrdinal = prevOrdCode + ordinalWidth;\n\t\t// eslint-disable-next-line unicorn/prefer-code-point\n\t\tordinal = parentOrdinal + String.fromCharCode(localOrdinal);\n\t}\n\n\treturn ordinal;\n}\n"]}
1
+ {"version":3,"file":"ordinal.js","sourceRoot":"","sources":["../src/ordinal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,+BAA+B;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,MAAM,UAAU,0BAA0B,CACzC,QAAgB,EAChB,WAAmB,EACnB,aAAqB,EACrB,eAAmC;IAEnC,MAAM,CACL,QAAQ,IAAI,EAAE,IAAI,WAAW,IAAI,QAAQ,EACzC,KAAK,CAAC,6DAA6D,CACnE,CAAC;IAEF,MAAM,YAAY,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,CAAC;IACnD,IAAI,OAAe,CAAC;IACpB,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;QACnC,qHAAqH;QACrH,iGAAiG;QACjG,kEAAkE;QAClE,qDAAqD;QACrD,OAAO,GAAG,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;IACjE,CAAC;SAAM,CAAC;QACP,qDAAqD;QACrD,MAAM,WAAW,GAAG,eAAe,CAAC,UAAU,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC3E,MAAM,CAAC,WAAW,KAAK,SAAS,EAAE,KAAK,CAAC,0CAA0C,CAAC,CAAC;QACpF,MAAM,YAAY,GAAG,WAAW,GAAG,YAAY,CAAC;QAChD,qDAAqD;QACrD,OAAO,GAAG,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,OAAO,CAAC;AAChB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable no-bitwise */\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nexport function computeHierarchicalOrdinal(\n\tmaxCount: number,\n\tactualCount: number,\n\tparentOrdinal: string,\n\tpreviousOrdinal: string | undefined,\n): string {\n\tassert(\n\t\tmaxCount <= 16 && actualCount <= maxCount,\n\t\t0x3f0 /* count must be less than max, and max must be 16 or less */,\n\t);\n\n\tconst ordinalWidth = 1 << (maxCount - actualCount);\n\tlet ordinal: string;\n\tif (previousOrdinal === undefined) {\n\t\t// Ordinals exist purely for lexicographical sort order and use a small set of valid bytes for each string character.\n\t\t// The extra handling fromCodePoint has for things like surrogate pairs is therefore unnecessary.\n\t\t// disable the rule to use code points when dealing with ordinals.\n\t\t// eslint-disable-next-line unicorn/prefer-code-point\n\t\tordinal = parentOrdinal + String.fromCharCode(ordinalWidth - 1);\n\t} else {\n\t\t// eslint-disable-next-line unicorn/prefer-code-point\n\t\tconst prevOrdCode = previousOrdinal.charCodeAt(previousOrdinal.length - 1);\n\t\tassert(prevOrdCode !== undefined, 0x9ad /* previous ordinal should not be empty */);\n\t\tconst localOrdinal = prevOrdCode + ordinalWidth;\n\t\t// eslint-disable-next-line unicorn/prefer-code-point\n\t\tordinal = parentOrdinal + String.fromCharCode(localOrdinal);\n\t}\n\n\treturn ordinal;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/merge-tree",
3
- "version": "2.1.0-281041",
3
+ "version": "2.1.0",
4
4
  "description": "Merge tree",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -79,30 +79,30 @@
79
79
  "temp-directory": "nyc/.nyc_output"
80
80
  },
81
81
  "dependencies": {
82
- "@fluid-internal/client-utils": "2.1.0-281041",
83
- "@fluidframework/container-definitions": "2.1.0-281041",
84
- "@fluidframework/core-interfaces": "2.1.0-281041",
85
- "@fluidframework/core-utils": "2.1.0-281041",
86
- "@fluidframework/datastore-definitions": "2.1.0-281041",
87
- "@fluidframework/driver-definitions": "2.1.0-281041",
88
- "@fluidframework/runtime-definitions": "2.1.0-281041",
89
- "@fluidframework/runtime-utils": "2.1.0-281041",
90
- "@fluidframework/shared-object-base": "2.1.0-281041",
91
- "@fluidframework/telemetry-utils": "2.1.0-281041"
82
+ "@fluid-internal/client-utils": "~2.1.0",
83
+ "@fluidframework/container-definitions": "~2.1.0",
84
+ "@fluidframework/core-interfaces": "~2.1.0",
85
+ "@fluidframework/core-utils": "~2.1.0",
86
+ "@fluidframework/datastore-definitions": "~2.1.0",
87
+ "@fluidframework/driver-definitions": "~2.1.0",
88
+ "@fluidframework/runtime-definitions": "~2.1.0",
89
+ "@fluidframework/runtime-utils": "~2.1.0",
90
+ "@fluidframework/shared-object-base": "~2.1.0",
91
+ "@fluidframework/telemetry-utils": "~2.1.0"
92
92
  },
93
93
  "devDependencies": {
94
94
  "@arethetypeswrong/cli": "^0.15.2",
95
95
  "@biomejs/biome": "~1.8.3",
96
- "@fluid-internal/mocha-test-setup": "2.1.0-281041",
97
- "@fluid-private/stochastic-test-utils": "2.1.0-281041",
98
- "@fluid-private/test-pairwise-generator": "2.1.0-281041",
96
+ "@fluid-internal/mocha-test-setup": "~2.1.0",
97
+ "@fluid-private/stochastic-test-utils": "~2.1.0",
98
+ "@fluid-private/test-pairwise-generator": "~2.1.0",
99
99
  "@fluid-tools/benchmark": "^0.48.0",
100
- "@fluid-tools/build-cli": "^0.40.0",
100
+ "@fluid-tools/build-cli": "^0.41.0",
101
101
  "@fluidframework/build-common": "^2.0.3",
102
- "@fluidframework/build-tools": "^0.40.0",
102
+ "@fluidframework/build-tools": "^0.41.0",
103
103
  "@fluidframework/eslint-config-fluid": "^5.3.0",
104
104
  "@fluidframework/merge-tree-previous": "npm:@fluidframework/merge-tree@2.0.0",
105
- "@fluidframework/test-runtime-utils": "2.1.0-281041",
105
+ "@fluidframework/test-runtime-utils": "~2.1.0",
106
106
  "@microsoft/api-extractor": "^7.45.1",
107
107
  "@types/diff": "^3.5.1",
108
108
  "@types/mocha": "^9.1.1",
package/src/ordinal.ts CHANGED
@@ -28,7 +28,7 @@ export function computeHierarchicalOrdinal(
28
28
  } else {
29
29
  // eslint-disable-next-line unicorn/prefer-code-point
30
30
  const prevOrdCode = previousOrdinal.charCodeAt(previousOrdinal.length - 1);
31
- assert(prevOrdCode !== undefined, "previous ordinal should not be empty");
31
+ assert(prevOrdCode !== undefined, 0x9ad /* previous ordinal should not be empty */);
32
32
  const localOrdinal = prevOrdCode + ordinalWidth;
33
33
  // eslint-disable-next-line unicorn/prefer-code-point
34
34
  ordinal = parentOrdinal + String.fromCharCode(localOrdinal);