@fluidframework/matrix 2.117.0 → 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.
- package/CHANGELOG.md +36 -2
- package/README.md +53 -50
- package/{api-extractor.json → api-extractor/api-extractor-model.json} +1 -1
- package/dist/handlecache.js +3 -2
- package/dist/handlecache.js.map +1 -1
- package/dist/handletable.d.ts.map +1 -1
- package/dist/handletable.js +1 -0
- package/dist/handletable.js.map +1 -1
- package/dist/matrix.js +57 -53
- package/dist/matrix.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/permutationvector.js +86 -83
- package/dist/permutationvector.js.map +1 -1
- package/dist/range.js +1 -2
- package/dist/range.js.map +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +9 -9
- package/dist/runtime.js.map +1 -1
- package/dist/serialization.d.ts.map +1 -1
- package/dist/serialization.js +2 -2
- package/dist/serialization.js.map +1 -1
- package/dist/sparsearray2d.js +3 -2
- package/dist/sparsearray2d.js.map +1 -1
- package/dist/undoprovider.js +12 -0
- package/dist/undoprovider.js.map +1 -1
- package/lib/handlecache.js +3 -2
- package/lib/handlecache.js.map +1 -1
- package/lib/handletable.d.ts.map +1 -1
- package/lib/handletable.js +1 -0
- package/lib/handletable.js.map +1 -1
- package/lib/legacy.d.ts +1 -1
- package/lib/matrix.js +57 -53
- package/lib/matrix.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/permutationvector.js +84 -81
- package/lib/permutationvector.js.map +1 -1
- package/lib/public.d.ts +1 -1
- package/lib/runtime.js +9 -9
- package/lib/runtime.js.map +1 -1
- package/lib/serialization.d.ts.map +1 -1
- package/lib/sparsearray2d.js +3 -2
- package/lib/sparsearray2d.js.map +1 -1
- package/lib/undoprovider.js +12 -0
- package/lib/undoprovider.js.map +1 -1
- package/package.json +40 -60
- package/src/packageVersion.ts +1 -1
- package/tsconfig.json +1 -1
- package/internal.d.ts +0 -11
- package/legacy.d.ts +0 -11
- /package/api-extractor/{api-extractor.current.json → api-extractor-report.current.json} +0 -0
- /package/api-extractor/{api-extractor.legacy.json → api-extractor-report.legacy.json} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,42 @@
|
|
|
1
1
|
# @fluidframework/matrix
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 3.0.0
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Removal of direct CommonJS support ([#28124](https://github.com/microsoft/FluidFramework/pull/28124)) [0f84e3b8878](https://github.com/microsoft/FluidFramework/commit/0f84e3b8878a5e75b2253976d98fd963bbd9db88)
|
|
8
|
+
|
|
9
|
+
Direct `require()` import is no longer directly supported.
|
|
10
|
+
Package is transpiled as ECMAScript Module.
|
|
11
|
+
|
|
12
|
+
See [Removal of direct CommonJS support in v3.0](https://github.com/microsoft/FluidFramework/issues/27444) for more information.
|
|
13
|
+
|
|
14
|
+
- Require modern TypeScript module resolution ([#27970](https://github.com/microsoft/FluidFramework/pull/27970)) [325e2016ca9](https://github.com/microsoft/FluidFramework/commit/325e2016ca9978d4a1f7552c97ba34feac9df41f)
|
|
15
|
+
|
|
16
|
+
Fluid Framework Client packages no longer include type declaration compatibility entrypoints for TypeScript's legacy Node10 resolution mode (`"moduleResolution": "node"` or `"node10"`).
|
|
17
|
+
Applications upgrading to Fluid Framework 3.0 must use one of the following supported configurations:
|
|
18
|
+
- `"module": "Node16"` with `"moduleResolution": "Node16"`
|
|
19
|
+
- `"module": "NodeNext"` with `"moduleResolution": "NodeNext"`
|
|
20
|
+
- `"module": "ESNext"` with `"moduleResolution": "Bundler"`
|
|
21
|
+
|
|
22
|
+
Existing public package entrypoints exposed through `package.json` exports, including `/alpha`, `/beta`, and `/legacy`, remain available under supported module resolution modes.
|
|
23
|
+
|
|
24
|
+
See [Removal of Node10 resolutions in v3.0](https://github.com/microsoft/FluidFramework/issues/27457) for more information.
|
|
25
|
+
|
|
26
|
+
- Client packages now target ES2022 ([#27846](https://github.com/microsoft/FluidFramework/pull/27846)) [91c78541bdd](https://github.com/microsoft/FluidFramework/commit/91c78541bddcbca5d6c5f357b023eeaee617d885)
|
|
27
|
+
|
|
28
|
+
The TypeScript compilation `target` and `lib` for the Fluid Framework client packages have been raised from ES2021/ES2020 to **ES2022**.
|
|
29
|
+
The published JavaScript now uses ES2022 language features (with correspondingly less down-leveling), so consuming these packages requires a runtime that supports ES2022.
|
|
30
|
+
All actively supported Node.js versions and evergreen browsers already meet this requirement.
|
|
31
|
+
|
|
32
|
+
Note that Fluid Framework has not officially supported targets older than ES2022 since before 2.0: this is documented in [ClientRequirements.md](https://github.com/microsoft/FluidFramework/blob/main/ClientRequirements.md) as well as the README for every client package.
|
|
33
|
+
|
|
34
|
+
It is possible this change could impact users of less up to date JavaScript runtimes.
|
|
35
|
+
Impacted users can use a tool like [babel](https://babeljs.io/) to transpile out unsupported language features.
|
|
36
|
+
|
|
37
|
+
- Build with TypeScript 6 ([#28052](https://github.com/microsoft/FluidFramework/pull/28052)) [7ab015c49de](https://github.com/microsoft/FluidFramework/commit/7ab015c49deec84833cdfe1fb5e1606b901f6e81)
|
|
38
|
+
|
|
39
|
+
FluidFramework Client SDK is now built using TypeScript 6. Consumers should build with TypeScript v6 or v7 or compatible tooling.
|
|
6
40
|
|
|
7
41
|
## 2.116.0
|
|
8
42
|
|
package/README.md
CHANGED
|
@@ -9,15 +9,15 @@ SharedMatrix is a rectangular 2D array of values. Matrix values are a superset o
|
|
|
9
9
|
|
|
10
10
|
## Using Fluid Framework libraries
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
library consumers should always prefer `^`.
|
|
12
|
+
For a dependency on a Fluid Framework library's public APIs, we recommend a `^` (caret) version range.
|
|
13
|
+
For example, use `^1.3.4`.
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
For a dependency on an unstable API, such as a `beta` API, we recommend a more restrictive version range.
|
|
16
|
+
For example, use a `~` version range.
|
|
17
17
|
|
|
18
18
|
## Installation
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Run this command to install the package:
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
23
|
npm i @fluidframework/matrix
|
|
@@ -25,16 +25,16 @@ npm i @fluidframework/matrix
|
|
|
25
25
|
|
|
26
26
|
## Importing from this package
|
|
27
27
|
|
|
28
|
-
This package
|
|
29
|
-
For
|
|
28
|
+
This package uses [package.json exports](https://nodejs.org/api/packages.html#exports) to separate APIs by support level.
|
|
29
|
+
For information about the support guarantees, read [API Support Levels](https://fluidframework.com/docs/build/releases-and-apitags/#api-support-levels).
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Import the `public` APIs from `@fluidframework/matrix`.
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
Import the `legacy` APIs from `@fluidframework/matrix/legacy`.
|
|
34
34
|
|
|
35
35
|
## API Documentation
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
Read the **@fluidframework/matrix** API documentation at <https://fluidframework.com/docs/apis/matrix>.
|
|
38
38
|
|
|
39
39
|
<!-- prettier-ignore-end -->
|
|
40
40
|
|
|
@@ -183,62 +183,69 @@ ops for C1.
|
|
|
183
183
|
|
|
184
184
|
## Minimum Client Requirements
|
|
185
185
|
|
|
186
|
-
|
|
187
|
-
These requirements
|
|
188
|
-
|
|
186
|
+
Fluid Framework client libraries support the platforms in this document.
|
|
187
|
+
These requirements are intentionally restrictive.
|
|
188
|
+
Within a major version series, we can relax these requirements, but we cannot make them stricter.
|
|
189
|
+
For a Long Term Support (LTS) version, we might need to support these platforms for several years.
|
|
189
190
|
|
|
190
|
-
|
|
191
|
-
If
|
|
192
|
-
|
|
191
|
+
Other configurations can work, but Fluid Framework does not support them.
|
|
192
|
+
If an unsupported configuration stops working, we do not classify this as a bug.
|
|
193
|
+
To request support for a configuration that is not listed, file an issue.
|
|
194
|
+
The product team will evaluate your request.
|
|
195
|
+
In the issue, specify the current status of the configuration:
|
|
196
|
+
|
|
197
|
+
- The configuration works but needs official support.
|
|
198
|
+
- The configuration does not work and requires changes.
|
|
193
199
|
|
|
194
200
|
### Supported Runtimes
|
|
195
201
|
|
|
196
|
-
-
|
|
197
|
-
-
|
|
198
|
-
-
|
|
202
|
+
- Fluid Framework supports Node.js versions 22 and 24 while they receive [upstream support](https://nodejs.org/en/about/previous-releases).
|
|
203
|
+
- Fluid Framework will stop support for version 22 [when upstream support ends on 2027-04-30](https://github.com/nodejs/release#release-schedule).
|
|
204
|
+
- Fluid Framework does not support Node.js with the `--no-experimental-fetch` flag.
|
|
205
|
+
- Fluid Framework supports modern browsers that support the ES2022 standard library.
|
|
199
206
|
|
|
200
207
|
### Supported Tools
|
|
201
208
|
|
|
202
|
-
- TypeScript
|
|
203
|
-
-
|
|
204
|
-
-
|
|
205
|
-
- [
|
|
206
|
-
-
|
|
207
|
-
|
|
209
|
+
- [TypeScript 6.0](https://typescriptdocs.com/release-notes/TypeScript%206.0):
|
|
210
|
+
- Fluid Framework supports all [`strict`](https://www.typescriptlang.org/tsconfig) options.
|
|
211
|
+
- Set the build targets (`lib`, `target`) to `ES2022` or later.
|
|
212
|
+
- Enable [`strictNullChecks`](https://www.typescriptlang.org/tsconfig).
|
|
213
|
+
- Fluid Framework does not support [configuration options deprecated in TypeScript 6.0](https://typescriptdocs.com/release-notes/TypeScript%206.0#breaking-changes-and-deprecations-in-typescript-6-0).
|
|
214
|
+
- Fluid Framework does not fully support `exactOptionalPropertyTypes`.
|
|
215
|
+
If you enable this option, do not use `in`, `Reflect.has`, `Object.hasOwn`, or `Object.prototype.hasOwnProperty` to narrow members of Fluid Framework types.
|
|
216
|
+
These methods can incorrectly exclude `undefined` from the possible values.
|
|
208
217
|
- [webpack](https://webpack.js.org/) 5
|
|
209
|
-
- We
|
|
210
|
-
Other bundlers
|
|
218
|
+
- We do not require a specific bundler.
|
|
219
|
+
Other bundlers that handle ES Modules can work, but we actively test only webpack.
|
|
211
220
|
|
|
212
221
|
### Module Resolution
|
|
213
222
|
|
|
214
|
-
[`Node16`, `NodeNext`, or `Bundler`](https://www.typescriptlang.org/tsconfig#moduleResolution)
|
|
215
|
-
|
|
223
|
+
In TypeScript `compilerOptions`, use [`Node16`, `Node20`, `NodeNext`, or `Bundler`](https://www.typescriptlang.org/tsconfig#moduleResolution) module resolution.
|
|
224
|
+
These settings follow the [Node.js v12+ ESM Resolution and Loading algorithm](https://nodejs.github.io/nodejs.dev/en/api/v20/esm/#resolution-and-loading-algorithm).
|
|
225
|
+
|
|
226
|
+
Do not use `Node10` module resolution.
|
|
216
227
|
|
|
217
228
|
### Module Formats
|
|
218
229
|
|
|
219
230
|
- ES Modules:
|
|
220
|
-
ES Modules
|
|
221
|
-
-
|
|
222
|
-
|
|
223
|
-
This is done to accommodate some workflows without good ES Module support.
|
|
224
|
-
If you have a workflow you would like included in this list, file an issue.
|
|
225
|
-
Once this list of workflows motivating CommonJS support is empty, we may drop support for CommonJS one year after notice of the change is posted here.
|
|
226
|
-
|
|
227
|
-
- Testing with Jest (which lacks [stable ESM support](https://jestjs.io/docs/ecmascript-modules) due to [unstable APIs in NodeJs](https://github.com/nodejs/node/issues/37648))
|
|
231
|
+
Use ES Modules to consume Fluid Framework client packages, including in Node.js.
|
|
232
|
+
- CommonJS:
|
|
233
|
+
Fluid Framework does not officially support CommonJS in version 3.0 or later.
|
|
228
234
|
|
|
229
235
|
## Contribution Guidelines
|
|
230
236
|
|
|
231
|
-
|
|
237
|
+
You can [contribute](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md) to Fluid Framework in these ways:
|
|
232
238
|
|
|
233
|
-
-
|
|
234
|
-
- [Submit
|
|
235
|
-
- Review
|
|
239
|
+
- Answer questions in [GitHub Discussions](https://github.com/microsoft/FluidFramework/discussions).
|
|
240
|
+
- [Submit bug reports](https://github.com/microsoft/FluidFramework/issues) and help verify fixes.
|
|
241
|
+
- Review [source code changes](https://github.com/microsoft/FluidFramework/pulls).
|
|
236
242
|
- [Contribute bug fixes](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md).
|
|
237
243
|
|
|
238
|
-
|
|
244
|
+
For detailed instructions, read the [repo documentation](https://github.com/microsoft/FluidFramework/blob/main/docs/content/Home.md).
|
|
239
245
|
|
|
240
|
-
This project
|
|
241
|
-
For more information
|
|
246
|
+
This project follows the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
|
247
|
+
For more information, read the [Code of Conduct frequently asked questions](https://opensource.microsoft.com/codeofconduct/faq/).
|
|
248
|
+
For questions or comments, contact [opencode@microsoft.com](mailto:opencode@microsoft.com).
|
|
242
249
|
|
|
243
250
|
This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
|
|
244
251
|
Use of these trademarks or logos must follow Microsoft’s [Trademark & Brand Guidelines](https://www.microsoft.com/trademarks).
|
|
@@ -246,13 +253,9 @@ Use of Microsoft trademarks or logos in modified versions of this project must n
|
|
|
246
253
|
|
|
247
254
|
## Help
|
|
248
255
|
|
|
249
|
-
|
|
250
|
-
Check out [fluidframework.com](https://fluidframework.com/docs/).
|
|
251
|
-
|
|
252
|
-
Still not finding what you're looking for?
|
|
253
|
-
Please [file an issue](https://github.com/microsoft/FluidFramework/blob/main/docs/content/Contributing/Submitting-Bugs-and-Feature-Requests.md).
|
|
256
|
+
Read the [Fluid Framework documentation](https://fluidframework.com/docs/) for information about Fluid Framework concepts and APIs.
|
|
254
257
|
|
|
255
|
-
|
|
258
|
+
To request information that the documentation does not contain, [create an issue](https://github.com/microsoft/FluidFramework/blob/main/docs/content/Contributing/Submitting-Bugs-and-Feature-Requests.md).
|
|
256
259
|
|
|
257
260
|
## Trademark
|
|
258
261
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-model.esm.json"
|
|
4
4
|
}
|
package/dist/handlecache.js
CHANGED
|
@@ -16,10 +16,11 @@ const range_js_1 = require("./range.js");
|
|
|
16
16
|
* so far there's no measurable perf penalty for being a separate object (node 12 x64)
|
|
17
17
|
*/
|
|
18
18
|
class HandleCache {
|
|
19
|
+
vector;
|
|
20
|
+
handles = [];
|
|
21
|
+
start = 0;
|
|
19
22
|
constructor(vector) {
|
|
20
23
|
this.vector = vector;
|
|
21
|
-
this.handles = [];
|
|
22
|
-
this.start = 0;
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* Returns the index of the given position in the 'handles' array as a Uint32.
|
package/dist/handlecache.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlecache.js","sourceRoot":"","sources":["../src/handlecache.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAA+B;AAE/B,kEAA6D;AAG7D,qDAA8D;AAE9D,yCAAyC;AAEzC;;;;;GAKG;AACH,MAAa,WAAW;
|
|
1
|
+
{"version":3,"file":"handlecache.js","sourceRoot":"","sources":["../src/handlecache.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAA+B;AAE/B,kEAA6D;AAG7D,qDAA8D;AAE9D,yCAAyC;AAEzC;;;;;GAKG;AACH,MAAa,WAAW;IAIK;IAHpB,OAAO,GAAa,EAAE,CAAC;IACvB,KAAK,GAAG,CAAC,CAAC;IAElB,YAA4B,MAAyB;QAAzB,WAAM,GAAN,MAAM,CAAmB;IAAG,CAAC;IAEzD;;;OAGG;IACK,QAAQ,CAAC,QAAgB;QAChC,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;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AA2E;QAC3E,EAAE;QACF,gFAAgF;QAEhF,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACnC,IAAI,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YACjC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC;QAC7B,CAAC;IACF,CAAC;CAGD;AAvHD,kCAuHC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable no-bitwise */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IVectorConsumer } from \"@tiny-calc/nano\";\n\nimport { type Handle, isHandleValid } from \"./handletable.js\";\nimport type { PermutationSegment, PermutationVector } from \"./permutationvector.js\";\nimport { ensureRange } from \"./range.js\";\n\n/**\n * Used by PermutationVector to cache position -\\> handle lookups.\n *\n * Perf: Possibly, this should eventually be inlined into PermutationVector itself, but\n * so far there's no measurable perf penalty for being a separate object (node 12 x64)\n */\nexport class HandleCache implements IVectorConsumer<Handle> {\n\tprivate handles: Handle[] = [];\n\tprivate start = 0;\n\n\tconstructor(public readonly vector: PermutationVector) {}\n\n\t/**\n\t * Returns the index of the given position in the 'handles' array as a Uint32.\n\t * (If the position is not in the array, returns an integer greater than 'handles.length').\n\t */\n\tprivate getIndex(position: number): number {\n\t\treturn (position - this.start) >>> 0;\n\t}\n\n\t/**\n\t * Returns the handle currently assigned to the given 'position' (if any). Check\n\t * the result with 'isValidHandle(..)' to see if a handle has been allocated for\n\t * the given position.\n\t *\n\t * @throws A 'RangeError' if the provided 'position' is out-of-bounds with regards to the\n\t * PermutationVector's length.\n\t */\n\tpublic getHandle(position: number): Handle {\n\t\tconst index = this.getIndex(position);\n\n\t\t// Perf: To encourage inlining, handling of the 'cacheMiss(..)' case has been extracted\n\t\t// to a separate method.\n\n\t\t// Perf: A cache hit implies that 'position' was in bounds. Therefore, we can defer\n\t\t// checking that 'position' is in bounds until 'cacheMiss(..)'. This yields an\n\t\t// ~40% speedup when the position is in the cache (node v12 x64).\n\n\t\treturn index < this.handles.length ? this.handles[index] : this.cacheMiss(position);\n\t}\n\n\t/**\n\t * Update the cache when a handle has been allocated for a given position.\n\t */\n\tpublic addHandle(position: number, handle: Handle): void {\n\t\tassert(isHandleValid(handle), 0x017 /* \"Trying to add invalid handle!\" */);\n\n\t\tconst index = this.getIndex(position);\n\t\tif (index < this.handles.length) {\n\t\t\tassert(\n\t\t\t\t!isHandleValid(this.handles[index]),\n\t\t\t\t0x018 /* \"Trying to insert handle into position with already valid handle!\" */,\n\t\t\t);\n\t\t\tthis.handles[index] = handle;\n\t\t}\n\t}\n\n\t/**\n\t * Used by {@link HandleCache.cacheMiss} to retrieve handles for a range of positions.\n\t * @param start - The start position (inclusive).\n\t * @param end - The end position (exclusive).\n\t * @param handles - The array to populate with handles. Note that it is mutated in place.\n\t */\n\tprivate getHandles(start: number, end: number, handles: Handle[]): void {\n\t\t// TODO: This can be accelerated substantially using 'walkSegments()'. The only catch\n\t\t// is that\n\n\t\tconst { vector } = this;\n\n\t\tfor (let pos = start; pos < end; pos++) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst { segment, offset } = vector.getContainingSegment(pos)!;\n\t\t\tconst asPerm = segment as PermutationSegment;\n\t\t\thandles.push(asPerm.start + offset);\n\t\t}\n\t}\n\n\tprivate cacheMiss(position: number): Handle {\n\t\t// Coercing 'position' to an Uint32 allows us to handle a negative 'position' value\n\t\t// with the same logic that handles 'position' >= length.\n\t\tconst _position = position >>> 0;\n\n\t\t// TODO: To bound memory usage, there should be a limit on the maximum size of\n\t\t// handle[].\n\n\t\t// TODO: To reduce MergeTree lookups, this code should opportunistically grow\n\t\t// the cache to the next MergeTree segment boundary (within the limits of\n\t\t// the handle cache).\n\n\t\tif (_position < this.start) {\n\t\t\tconst handles: Handle[] = [];\n\t\t\tthis.getHandles(_position, this.start, handles);\n\t\t\thandles.push(...this.handles);\n\t\t\tthis.handles = handles;\n\t\t\tthis.start = _position;\n\t\t\treturn this.handles[0];\n\t\t} else {\n\t\t\tensureRange(_position, this.vector.getLength());\n\t\t\tthis.getHandles(this.start + this.handles.length, _position + 1, this.handles);\n\t\t\treturn this.handles[this.handles.length - 1];\n\t\t}\n\t}\n\n\t// #region IVectorConsumer\n\n\titemsChanged(start: number, removedCount: number, insertedCount: number): void {\n\t\t// If positions were inserted/removed, our current policy is to trim the array\n\t\t// at the beginning of the invalidate range and lazily repopulate the handles\n\t\t// on demand.\n\t\t//\n\t\t// Some alternatives to consider that preserve the previously cached handles\n\t\t// that are still valid:\n\t\t//\n\t\t// * Eagerly populate the 'handles[]' with the newly insert values (currently guaranteed\n\t\t// to be Handle.unallocated, so we don't even need to look them up.)\n\t\t//\n\t\t// * Use a sentinel value or other mechanism to allow \"holes\" in the cache.\n\n\t\tconst index = this.getIndex(start);\n\t\tif (index < this.handles.length) {\n\t\t\tthis.handles.length = index;\n\t\t}\n\t}\n\n\t// #endregion IVectorConsumer\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handletable.d.ts","sourceRoot":"","sources":["../src/handletable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,0BAAkB,MAAM;IACvB;;OAEG;IACH,IAAI,IAAI;IAER;;OAEG;IACH,KAAK,IAAI;IAET;;;OAGG;IACH,WAAW,cAAc;CACzB;AAED,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"handletable.d.ts","sourceRoot":"","sources":["../src/handletable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,0BAAkB,MAAM;IACvB;;OAEG;IACH,IAAI,IAAI;IAER;;OAEG;IACH,KAAK,IAAI;IAET;;;OAGG;IACH,WAAW,cAAc;CACzB;AAED,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,KAAG,OAAiC,CAAC;AAEjF;;GAEG;AACH,qBAAa,WAAW,CAAC,CAAC;IAIN,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,GAAE,CAAC,MAAM,GAAG,CAAC,CAAC,EAAQ;IAE1D,KAAK,IAAI,IAAI;IAOpB;;OAEG;IACI,QAAQ,IAAI,MAAM;IAmBzB;;OAEG;IACI,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW;IAQ/C;;OAEG;IACI,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAKjC;;OAEG;IACI,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC;IAI7B;;OAEG;IACI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAM1C,OAAO,KAAK,IAAI,GAEf;IACD,OAAO,KAAK,IAAI,QAEf;IAEM,iBAAiB,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE;WAI5B,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC;CAG3D"}
|
package/dist/handletable.js
CHANGED
|
@@ -11,6 +11,7 @@ exports.isHandleValid = isHandleValid;
|
|
|
11
11
|
* A handle table provides a fast mapping from an integer `handle` to a value `T`.
|
|
12
12
|
*/
|
|
13
13
|
class HandleTable {
|
|
14
|
+
handles;
|
|
14
15
|
// Note: the first slot of the 'handles' array is reserved to store the pointer to the first
|
|
15
16
|
// free handle. We initialize this slot with a pointer to slot '1', which will cause
|
|
16
17
|
// us to delay allocate the following slot in the array on the first allocation.
|
package/dist/handletable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handletable.js","sourceRoot":"","sources":["../src/handletable.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAoBI,MAAM,aAAa,GAAG,CAAC,MAAc,EAAW,EAAE,CAAC,MAAM,wBAAgB,CAAC;AAApE,QAAA,aAAa,iBAAuD;AAEjF;;GAEG;AACH,MAA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CAAC;IAED;;OAEG;IACI,IAAI,CAAC,MAAc;QACzB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC;IACpB,CAAC;IAED;;OAEG;IACI,GAAG,CAAC,MAAc;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAM,CAAC;IAClC,CAAC;IAED;;OAEG;IACI,GAAG,CAAC,MAAc,EAAE,KAAQ;QAClC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;IAC9B,CAAC;IAED,wFAAwF;IACxF,uBAAuB;IACvB,IAAY,IAAI;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAW,CAAC;IAClC,CAAC;IACD,IAAY,IAAI,CAAC,MAAc;QAC9B,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;IAC1B,CAAC;IAEM,iBAAiB;QACvB,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAEM,MAAM,CAAC,IAAI,CAAI,IAAoB;QACzC,OAAO,IAAI,WAAW,CAAI,IAAI,CAAC,CAAC;IACjC,CAAC;CACD;AApFD,kCAoFC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport const enum Handle {\n\t/**\n\t * Sentinel representing the absence of a valid handle.\n\t */\n\tnone = 0,\n\n\t/**\n\t * Minimum valid handle.\n\t */\n\tvalid = 1,\n\n\t/**\n\t * Sentinel representing an unallocated Handle. Used by PermutationVector\n\t * to delay allocate handles when previously empty row/cols become populated.\n\t */\n\tunallocated = -0x80000000,\n}\n\nexport const isHandleValid = (handle: Handle): boolean => handle >= Handle.valid;\n\n/**\n * A handle table provides a fast mapping from an integer `handle` to a value `T`.\n */\nexport class HandleTable<T> {\n\t// Note: the first slot of the 'handles' array is reserved to store the pointer to the first\n\t// free handle. We initialize this slot with a pointer to slot '1', which will cause\n\t// us to delay allocate the following slot in the array on the first allocation.\n\tpublic constructor(private readonly handles: (Handle | T)[] = [1]) {}\n\n\tpublic clear(): void {\n\t\t// Restore the HandleTable's initial state by deleting all items in the handles array\n\t\t// and then re-inserting the value '1' in the 0th slot. (See comment at `handles` decl\n\t\t// for explanation.)\n\t\tthis.handles.splice(0, this.handles.length, 1);\n\t}\n\n\t/**\n\t * Allocates and returns the next available handle. Note that freed handles are recycled.\n\t */\n\tpublic allocate(): Handle {\n\t\t// Get the handle to the next free slot.\n\t\tconst free = this.next;\n\n\t\t// Update 'next' to point to the new head of the free list. We use the contents of\n\t\t// recycled slots to store the free list. The contents of the handles[free] will point\n\t\t// to the next available slot. If there are no free slots (i.e., 'handles' is full),\n\t\t// the slot will point to 'handles.length'. In this case, the handles array will grow\n\t\t// and we update 'next' to point to the new end of the array.\n\t\tthis.next = (this.handles[free] as Handle) ?? free + 1;\n\n\t\t// Out of paranoia, overwrite the contents of the newly allocated free slot with an\n\t\t// invalid handle value. This may help catch/diagnose bugs in the event the free list\n\t\t// becomes corrupted.\n\t\tthis.handles[free] = Handle.none;\n\n\t\treturn free;\n\t}\n\n\t/**\n\t * Allocates and returns the next available `count` handles.\n\t */\n\tpublic allocateMany(count: Handle): Uint32Array {\n\t\tconst handles = new Uint32Array(count);\n\t\tfor (let i = 0; i < count; i++) {\n\t\t\thandles[i] = this.allocate();\n\t\t}\n\t\treturn handles;\n\t}\n\n\t/**\n\t * Returns the given handle to the free list.\n\t */\n\tpublic free(handle: Handle): void {\n\t\tthis.handles[handle] = this.next;\n\t\tthis.next = handle;\n\t}\n\n\t/**\n\t * Get the value `T` associated with the given handle, if any.\n\t */\n\tpublic get(handle: Handle): T {\n\t\treturn this.handles[handle] as T;\n\t}\n\n\t/**\n\t * Set the value `T` associated with the given handle.\n\t */\n\tpublic set(handle: Handle, value: T): void {\n\t\tthis.handles[handle] = value;\n\t}\n\n\t// Private helpers to get/set the head of the free list, which is stored in the 0th slot\n\t// of the handle array.\n\tprivate get next(): Handle {\n\t\treturn this.handles[0] as Handle;\n\t}\n\tprivate set next(handle: Handle) {\n\t\tthis.handles[0] = handle;\n\t}\n\n\tpublic getSummaryContent(): (Handle | T)[] {\n\t\treturn this.handles;\n\t}\n\n\tpublic static load<T>(data: (Handle | T)[]): HandleTable<T> {\n\t\treturn new HandleTable<T>(data);\n\t}\n}\n"]}
|
package/dist/matrix.js
CHANGED
|
@@ -38,6 +38,28 @@ const undoprovider_js_1 = require("./undoprovider.js");
|
|
|
38
38
|
// TODO: if possible, transition SharedMatrix to not use `any`.
|
|
39
39
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
40
|
class SharedMatrix extends internal_4.SharedObject {
|
|
41
|
+
id;
|
|
42
|
+
consumers = new Set();
|
|
43
|
+
/**
|
|
44
|
+
* Note: this field only provides a lower-bound on the reference sequence numbers for in-flight ops.
|
|
45
|
+
* The exact reason isn't understood, but some e2e tests suggest that the runtime may sometimes process
|
|
46
|
+
* incoming leave/join ops before putting an op that this DDS submits over the wire.
|
|
47
|
+
*
|
|
48
|
+
* E.g. SharedMatrix submits an op while deltaManager has lastSequenceNumber = 10, but before the runtime
|
|
49
|
+
* puts this op over the wire, it processes a client join/leave op with sequence number 11, so the referenceSequenceNumber
|
|
50
|
+
* on the SharedMatrix op is 11.
|
|
51
|
+
*/
|
|
52
|
+
inFlightRefSeqs = new double_ended_queue_1.default();
|
|
53
|
+
getMinInFlightRefSeq = () => this.inFlightRefSeqs.get(0);
|
|
54
|
+
rows; // Map logical row to storage handle (if any)
|
|
55
|
+
cols; // Map logical col to storage handle (if any)
|
|
56
|
+
cells = new sparsearray2d_js_1.SparseArray2D(); // Stores cell values.
|
|
57
|
+
pending = new sparsearray2d_js_1.SparseArray2D(); // Tracks pending writes.
|
|
58
|
+
fwwPolicy = {
|
|
59
|
+
state: "off",
|
|
60
|
+
};
|
|
61
|
+
// Used to track if there is any reentrancy in setCell code.
|
|
62
|
+
reentrantCount = 0;
|
|
41
63
|
/**
|
|
42
64
|
* Constructor for the Shared Matrix
|
|
43
65
|
* @param runtime - DataStore runtime.
|
|
@@ -49,62 +71,10 @@ class SharedMatrix extends internal_4.SharedObject {
|
|
|
49
71
|
constructor(runtime, id, attributes) {
|
|
50
72
|
super(id, runtime, attributes, "fluid_matrix_");
|
|
51
73
|
this.id = id;
|
|
52
|
-
this.consumers = new Set();
|
|
53
|
-
/**
|
|
54
|
-
* Note: this field only provides a lower-bound on the reference sequence numbers for in-flight ops.
|
|
55
|
-
* The exact reason isn't understood, but some e2e tests suggest that the runtime may sometimes process
|
|
56
|
-
* incoming leave/join ops before putting an op that this DDS submits over the wire.
|
|
57
|
-
*
|
|
58
|
-
* E.g. SharedMatrix submits an op while deltaManager has lastSequenceNumber = 10, but before the runtime
|
|
59
|
-
* puts this op over the wire, it processes a client join/leave op with sequence number 11, so the referenceSequenceNumber
|
|
60
|
-
* on the SharedMatrix op is 11.
|
|
61
|
-
*/
|
|
62
|
-
this.inFlightRefSeqs = new double_ended_queue_1.default();
|
|
63
|
-
this.getMinInFlightRefSeq = () => this.inFlightRefSeqs.get(0);
|
|
64
|
-
this.cells = new sparsearray2d_js_1.SparseArray2D(); // Stores cell values.
|
|
65
|
-
this.pending = new sparsearray2d_js_1.SparseArray2D(); // Tracks pending writes.
|
|
66
|
-
this.fwwPolicy = {
|
|
67
|
-
state: "off",
|
|
68
|
-
};
|
|
69
|
-
// Used to track if there is any reentrancy in setCell code.
|
|
70
|
-
this.reentrantCount = 0;
|
|
71
|
-
// Invoked by PermutationVector to notify IMatrixConsumers of row insertion/deletions.
|
|
72
|
-
this.onRowDelta = (position, removedCount, insertedCount) => {
|
|
73
|
-
for (const consumer of this.consumers) {
|
|
74
|
-
consumer.rowsChanged(position, removedCount, insertedCount, this);
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
// Invoked by PermutationVector to notify IMatrixConsumers of col insertion/deletions.
|
|
78
|
-
this.onColDelta = (position, removedCount, insertedCount) => {
|
|
79
|
-
for (const consumer of this.consumers) {
|
|
80
|
-
consumer.colsChanged(position, removedCount, insertedCount, this);
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
this.onRowHandlesRecycled = (rowHandles) => {
|
|
84
|
-
for (const rowHandle of rowHandles) {
|
|
85
|
-
this.cells.clearRows(/* rowStart: */ rowHandle, /* rowCount: */ 1);
|
|
86
|
-
this.pending.clearRows(/* rowStart: */ rowHandle, /* rowCount: */ 1);
|
|
87
|
-
if (this.fwwPolicy.state === "on") {
|
|
88
|
-
this.fwwPolicy.cellLastWriteTracker?.clearRows(
|
|
89
|
-
/* rowStart: */ rowHandle,
|
|
90
|
-
/* rowCount: */ 1);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
this.onColHandlesRecycled = (colHandles) => {
|
|
95
|
-
for (const colHandle of colHandles) {
|
|
96
|
-
this.cells.clearCols(/* colStart: */ colHandle, /* colCount: */ 1);
|
|
97
|
-
this.pending.clearCols(/* colStart: */ colHandle, /* colCount: */ 1);
|
|
98
|
-
if (this.fwwPolicy.state === "on") {
|
|
99
|
-
this.fwwPolicy.cellLastWriteTracker?.clearCols(
|
|
100
|
-
/* colStart: */ colHandle,
|
|
101
|
-
/* colCount: */ 1);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
74
|
this.rows = new permutationvector_js_1.PermutationVector(ops_js_1.SnapshotPath.rows, this.logger, runtime, this.onRowDelta, this.onRowHandlesRecycled, this.getMinInFlightRefSeq);
|
|
106
75
|
this.cols = new permutationvector_js_1.PermutationVector(ops_js_1.SnapshotPath.cols, this.logger, runtime, this.onColDelta, this.onColHandlesRecycled, this.getMinInFlightRefSeq);
|
|
107
76
|
}
|
|
77
|
+
undo;
|
|
108
78
|
/**
|
|
109
79
|
* Subscribes the given IUndoConsumer to the matrix.
|
|
110
80
|
*/
|
|
@@ -705,6 +675,40 @@ class SharedMatrix extends internal_4.SharedObject {
|
|
|
705
675
|
}
|
|
706
676
|
}
|
|
707
677
|
}
|
|
678
|
+
// Invoked by PermutationVector to notify IMatrixConsumers of row insertion/deletions.
|
|
679
|
+
onRowDelta = (position, removedCount, insertedCount) => {
|
|
680
|
+
for (const consumer of this.consumers) {
|
|
681
|
+
consumer.rowsChanged(position, removedCount, insertedCount, this);
|
|
682
|
+
}
|
|
683
|
+
};
|
|
684
|
+
// Invoked by PermutationVector to notify IMatrixConsumers of col insertion/deletions.
|
|
685
|
+
onColDelta = (position, removedCount, insertedCount) => {
|
|
686
|
+
for (const consumer of this.consumers) {
|
|
687
|
+
consumer.colsChanged(position, removedCount, insertedCount, this);
|
|
688
|
+
}
|
|
689
|
+
};
|
|
690
|
+
onRowHandlesRecycled = (rowHandles) => {
|
|
691
|
+
for (const rowHandle of rowHandles) {
|
|
692
|
+
this.cells.clearRows(/* rowStart: */ rowHandle, /* rowCount: */ 1);
|
|
693
|
+
this.pending.clearRows(/* rowStart: */ rowHandle, /* rowCount: */ 1);
|
|
694
|
+
if (this.fwwPolicy.state === "on") {
|
|
695
|
+
this.fwwPolicy.cellLastWriteTracker?.clearRows(
|
|
696
|
+
/* rowStart: */ rowHandle,
|
|
697
|
+
/* rowCount: */ 1);
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
};
|
|
701
|
+
onColHandlesRecycled = (colHandles) => {
|
|
702
|
+
for (const colHandle of colHandles) {
|
|
703
|
+
this.cells.clearCols(/* colStart: */ colHandle, /* colCount: */ 1);
|
|
704
|
+
this.pending.clearCols(/* colStart: */ colHandle, /* colCount: */ 1);
|
|
705
|
+
if (this.fwwPolicy.state === "on") {
|
|
706
|
+
this.fwwPolicy.cellLastWriteTracker?.clearCols(
|
|
707
|
+
/* colStart: */ colHandle,
|
|
708
|
+
/* colCount: */ 1);
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
};
|
|
708
712
|
switchSetCellPolicy() {
|
|
709
713
|
if (this.fwwPolicy.state === "off") {
|
|
710
714
|
this.fwwPolicy = this.isAttached()
|