@fluidframework/map 2.118.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 +44 -4
- package/README.md +53 -50
- package/{api-extractor.json → api-extractor/api-extractor-model.json} +1 -1
- package/api-report/map.legacy.beta.api.md +9 -9
- package/api-report/map.legacy.public.api.md +4 -2
- package/dist/directory.js +171 -165
- package/dist/directory.js.map +1 -1
- package/dist/directoryFactory.d.ts +1 -1
- package/dist/directoryFactory.d.ts.map +1 -1
- package/dist/directoryFactory.js +15 -15
- package/dist/directoryFactory.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +26 -15
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/legacy.d.ts +0 -1
- package/dist/localValues.d.ts.map +1 -1
- package/dist/map.js +9 -6
- package/dist/map.js.map +1 -1
- package/dist/mapFactory.d.ts +1 -1
- package/dist/mapFactory.d.ts.map +1 -1
- package/dist/mapFactory.js +15 -15
- package/dist/mapFactory.js.map +1 -1
- package/dist/mapKernel.js +109 -104
- package/dist/mapKernel.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/utils.d.ts.map +1 -1
- package/lib/directory.js +171 -165
- package/lib/directory.js.map +1 -1
- package/lib/directoryFactory.js +15 -15
- package/lib/directoryFactory.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/interfaces.d.ts +26 -15
- package/lib/interfaces.d.ts.map +1 -1
- package/lib/interfaces.js.map +1 -1
- package/lib/legacy.d.ts +1 -2
- package/lib/localValues.d.ts.map +1 -1
- package/lib/map.js +9 -6
- package/lib/map.js.map +1 -1
- package/lib/mapFactory.js +15 -15
- package/lib/mapFactory.js.map +1 -1
- package/lib/mapKernel.js +109 -104
- package/lib/mapKernel.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/public.d.ts +1 -1
- package/lib/utils.d.ts.map +1 -1
- package/package.json +44 -60
- package/src/index.ts +0 -1
- package/src/interfaces.ts +31 -17
- 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,12 +1,52 @@
|
|
|
1
1
|
# @fluidframework/map
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 3.0.0
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
### Minor Changes
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- Removal of direct CommonJS support ([#28124](https://github.com/microsoft/FluidFramework/pull/28124)) [0f84e3b8878](https://github.com/microsoft/FluidFramework/commit/0f84e3b8878a5e75b2253976d98fd963bbd9db88)
|
|
8
8
|
|
|
9
|
-
|
|
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
|
+
- Shared maps use Fluid-owned map types ([#27908](https://github.com/microsoft/FluidFramework/pull/27908)) [5035f7cfed4](https://github.com/microsoft/FluidFramework/commit/5035f7cfed4dedec8ded17b29be97f91f2a4b675)
|
|
38
|
+
|
|
39
|
+
[`IDirectory`](https://fluidframework.com/docs/api/map/idirectory-interface) and [`ISharedMap`](https://fluidframework.com/docs/api/map/isharedmap-interface) now extend the Fluid-owned [`FluidMap`](https://fluidframework.com/docs/api/core-interfaces/fluidmap-interface) interface instead of TypeScript's built-in `Map` interface.
|
|
40
|
+
[`IDirectoryBeta`](https://fluidframework.com/docs/api/map/idirectorybeta-interface) has been removed because `IDirectory` now provides the Fluid-owned map contract.
|
|
41
|
+
|
|
42
|
+
#### Migration
|
|
43
|
+
|
|
44
|
+
Consumers using `IDirectoryBeta` should use `IDirectory` instead.
|
|
45
|
+
Methods available only on newer built-in map types are not available on shared maps.
|
|
46
|
+
|
|
47
|
+
- Build with TypeScript 6 ([#28052](https://github.com/microsoft/FluidFramework/pull/28052)) [7ab015c49de](https://github.com/microsoft/FluidFramework/commit/7ab015c49deec84833cdfe1fb5e1606b901f6e81)
|
|
48
|
+
|
|
49
|
+
FluidFramework Client SDK is now built using TypeScript 6. Consumers should build with TypeScript v6 or v7 or compatible tooling.
|
|
10
50
|
|
|
11
51
|
## 2.116.0
|
|
12
52
|
|
package/README.md
CHANGED
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
|
|
8
8
|
## Using Fluid Framework libraries
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
library consumers should always prefer `^`.
|
|
10
|
+
For a dependency on a Fluid Framework library's public APIs, we recommend a `^` (caret) version range.
|
|
11
|
+
For example, use `^1.3.4`.
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
For a dependency on an unstable API, such as a `beta` API, we recommend a more restrictive version range.
|
|
14
|
+
For example, use a `~` version range.
|
|
15
15
|
|
|
16
16
|
## Installation
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
Run this command to install the package:
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
21
|
npm i @fluidframework/map
|
|
@@ -23,16 +23,16 @@ npm i @fluidframework/map
|
|
|
23
23
|
|
|
24
24
|
## Importing from this package
|
|
25
25
|
|
|
26
|
-
This package
|
|
27
|
-
For
|
|
26
|
+
This package uses [package.json exports](https://nodejs.org/api/packages.html#exports) to separate APIs by support level.
|
|
27
|
+
For information about the support guarantees, read [API Support Levels](https://fluidframework.com/docs/build/releases-and-apitags/#api-support-levels).
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Import the `public` APIs from `@fluidframework/map`.
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Import the `legacy` APIs from `@fluidframework/map/legacy`.
|
|
32
32
|
|
|
33
33
|
## API Documentation
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Read the **@fluidframework/map** API documentation at <https://fluidframework.com/docs/apis/map>.
|
|
36
36
|
|
|
37
37
|
<!-- prettier-ignore-end -->
|
|
38
38
|
|
|
@@ -95,62 +95,69 @@ To "navigate" the subdirectory structure, `IDirectory` provides a `getWorkingDir
|
|
|
95
95
|
|
|
96
96
|
## Minimum Client Requirements
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
These requirements
|
|
100
|
-
|
|
98
|
+
Fluid Framework client libraries support the platforms in this document.
|
|
99
|
+
These requirements are intentionally restrictive.
|
|
100
|
+
Within a major version series, we can relax these requirements, but we cannot make them stricter.
|
|
101
|
+
For a Long Term Support (LTS) version, we might need to support these platforms for several years.
|
|
101
102
|
|
|
102
|
-
|
|
103
|
-
If
|
|
104
|
-
|
|
103
|
+
Other configurations can work, but Fluid Framework does not support them.
|
|
104
|
+
If an unsupported configuration stops working, we do not classify this as a bug.
|
|
105
|
+
To request support for a configuration that is not listed, file an issue.
|
|
106
|
+
The product team will evaluate your request.
|
|
107
|
+
In the issue, specify the current status of the configuration:
|
|
108
|
+
|
|
109
|
+
- The configuration works but needs official support.
|
|
110
|
+
- The configuration does not work and requires changes.
|
|
105
111
|
|
|
106
112
|
### Supported Runtimes
|
|
107
113
|
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
114
|
+
- Fluid Framework supports Node.js versions 22 and 24 while they receive [upstream support](https://nodejs.org/en/about/previous-releases).
|
|
115
|
+
- Fluid Framework will stop support for version 22 [when upstream support ends on 2027-04-30](https://github.com/nodejs/release#release-schedule).
|
|
116
|
+
- Fluid Framework does not support Node.js with the `--no-experimental-fetch` flag.
|
|
117
|
+
- Fluid Framework supports modern browsers that support the ES2022 standard library.
|
|
111
118
|
|
|
112
119
|
### Supported Tools
|
|
113
120
|
|
|
114
|
-
- TypeScript
|
|
115
|
-
-
|
|
116
|
-
-
|
|
117
|
-
- [
|
|
118
|
-
-
|
|
119
|
-
|
|
121
|
+
- [TypeScript 6.0](https://typescriptdocs.com/release-notes/TypeScript%206.0):
|
|
122
|
+
- Fluid Framework supports all [`strict`](https://www.typescriptlang.org/tsconfig) options.
|
|
123
|
+
- Set the build targets (`lib`, `target`) to `ES2022` or later.
|
|
124
|
+
- Enable [`strictNullChecks`](https://www.typescriptlang.org/tsconfig).
|
|
125
|
+
- 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).
|
|
126
|
+
- Fluid Framework does not fully support `exactOptionalPropertyTypes`.
|
|
127
|
+
If you enable this option, do not use `in`, `Reflect.has`, `Object.hasOwn`, or `Object.prototype.hasOwnProperty` to narrow members of Fluid Framework types.
|
|
128
|
+
These methods can incorrectly exclude `undefined` from the possible values.
|
|
120
129
|
- [webpack](https://webpack.js.org/) 5
|
|
121
|
-
- We
|
|
122
|
-
Other bundlers
|
|
130
|
+
- We do not require a specific bundler.
|
|
131
|
+
Other bundlers that handle ES Modules can work, but we actively test only webpack.
|
|
123
132
|
|
|
124
133
|
### Module Resolution
|
|
125
134
|
|
|
126
|
-
[`Node16`, `NodeNext`, or `Bundler`](https://www.typescriptlang.org/tsconfig#moduleResolution)
|
|
127
|
-
|
|
135
|
+
In TypeScript `compilerOptions`, use [`Node16`, `Node20`, `NodeNext`, or `Bundler`](https://www.typescriptlang.org/tsconfig#moduleResolution) module resolution.
|
|
136
|
+
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).
|
|
137
|
+
|
|
138
|
+
Do not use `Node10` module resolution.
|
|
128
139
|
|
|
129
140
|
### Module Formats
|
|
130
141
|
|
|
131
142
|
- ES Modules:
|
|
132
|
-
ES Modules
|
|
133
|
-
-
|
|
134
|
-
|
|
135
|
-
This is done to accommodate some workflows without good ES Module support.
|
|
136
|
-
If you have a workflow you would like included in this list, file an issue.
|
|
137
|
-
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.
|
|
138
|
-
|
|
139
|
-
- 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))
|
|
143
|
+
Use ES Modules to consume Fluid Framework client packages, including in Node.js.
|
|
144
|
+
- CommonJS:
|
|
145
|
+
Fluid Framework does not officially support CommonJS in version 3.0 or later.
|
|
140
146
|
|
|
141
147
|
## Contribution Guidelines
|
|
142
148
|
|
|
143
|
-
|
|
149
|
+
You can [contribute](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md) to Fluid Framework in these ways:
|
|
144
150
|
|
|
145
|
-
-
|
|
146
|
-
- [Submit
|
|
147
|
-
- Review
|
|
151
|
+
- Answer questions in [GitHub Discussions](https://github.com/microsoft/FluidFramework/discussions).
|
|
152
|
+
- [Submit bug reports](https://github.com/microsoft/FluidFramework/issues) and help verify fixes.
|
|
153
|
+
- Review [source code changes](https://github.com/microsoft/FluidFramework/pulls).
|
|
148
154
|
- [Contribute bug fixes](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md).
|
|
149
155
|
|
|
150
|
-
|
|
156
|
+
For detailed instructions, read the [repo documentation](https://github.com/microsoft/FluidFramework/blob/main/docs/content/Home.md).
|
|
151
157
|
|
|
152
|
-
This project
|
|
153
|
-
For more information
|
|
158
|
+
This project follows the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
|
159
|
+
For more information, read the [Code of Conduct frequently asked questions](https://opensource.microsoft.com/codeofconduct/faq/).
|
|
160
|
+
For questions or comments, contact [opencode@microsoft.com](mailto:opencode@microsoft.com).
|
|
154
161
|
|
|
155
162
|
This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
|
|
156
163
|
Use of these trademarks or logos must follow Microsoft’s [Trademark & Brand Guidelines](https://www.microsoft.com/trademarks).
|
|
@@ -158,13 +165,9 @@ Use of Microsoft trademarks or logos in modified versions of this project must n
|
|
|
158
165
|
|
|
159
166
|
## Help
|
|
160
167
|
|
|
161
|
-
|
|
162
|
-
Check out [fluidframework.com](https://fluidframework.com/docs/).
|
|
163
|
-
|
|
164
|
-
Still not finding what you're looking for?
|
|
165
|
-
Please [file an issue](https://github.com/microsoft/FluidFramework/blob/main/docs/content/Contributing/Submitting-Bugs-and-Feature-Requests.md).
|
|
168
|
+
Read the [Fluid Framework documentation](https://fluidframework.com/docs/) for information about Fluid Framework concepts and APIs.
|
|
166
169
|
|
|
167
|
-
|
|
170
|
+
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).
|
|
168
171
|
|
|
169
172
|
## Trademark
|
|
170
173
|
|
|
@@ -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
|
}
|
|
@@ -29,21 +29,19 @@ export interface ICreateInfo {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
// @public @sealed @legacy
|
|
32
|
-
export interface IDirectory extends
|
|
32
|
+
export interface IDirectory extends FluidMap<string, any>, IEventProvider<IDirectoryEvents>, Partial<IDisposable> {
|
|
33
33
|
readonly absolutePath: string;
|
|
34
|
+
clear(): void;
|
|
34
35
|
countSubDirectory?(): number;
|
|
35
36
|
createSubDirectory(subdirName: string): IDirectory;
|
|
37
|
+
delete(key: string): boolean;
|
|
36
38
|
deleteSubDirectory(subdirName: string): boolean;
|
|
37
39
|
get<T = any>(key: string): T | undefined;
|
|
38
40
|
getSubDirectory(subdirName: string): IDirectory | undefined;
|
|
39
41
|
getWorkingDirectory(relativePath: string): IDirectory | undefined;
|
|
40
42
|
hasSubDirectory(subdirName: string): boolean;
|
|
41
43
|
set<T = unknown>(key: string, value: T): this;
|
|
42
|
-
subdirectories():
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// @beta @sealed @legacy
|
|
46
|
-
export interface IDirectoryBeta extends Omit<IDirectory, Exclude<keyof Map<string, unknown>, "get" | "set">>, FluidMapLegacy<string, any> {
|
|
44
|
+
subdirectories(): FluidIterableIterator<[string, IDirectory]>;
|
|
47
45
|
}
|
|
48
46
|
|
|
49
47
|
// @beta @deprecated @legacy
|
|
@@ -82,7 +80,7 @@ export interface ISerializableValue {
|
|
|
82
80
|
// @beta @sealed @legacy
|
|
83
81
|
export interface ISharedDirectory extends ISharedObject<ISharedDirectoryEvents & IDirectoryEvents>, Omit<IDirectory, "on" | "once" | "off"> {
|
|
84
82
|
// (undocumented)
|
|
85
|
-
[Symbol.iterator]():
|
|
83
|
+
[Symbol.iterator](): FluidIterableIterator<[string, any]>;
|
|
86
84
|
// (undocumented)
|
|
87
85
|
readonly [Symbol.toStringTag]: string;
|
|
88
86
|
}
|
|
@@ -98,13 +96,15 @@ export interface ISharedDirectoryEvents extends ISharedObjectEvents {
|
|
|
98
96
|
}
|
|
99
97
|
|
|
100
98
|
// @beta @sealed @legacy
|
|
101
|
-
export interface ISharedMap extends ISharedObject<ISharedMapEvents>,
|
|
99
|
+
export interface ISharedMap extends ISharedObject<ISharedMapEvents>, FluidMap<string, any> {
|
|
100
|
+
clear(): void;
|
|
101
|
+
delete(key: string): boolean;
|
|
102
102
|
get<T = any>(key: string): T | undefined;
|
|
103
103
|
set<T = unknown>(key: string, value: T): this;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
// @beta @sealed @legacy
|
|
107
|
-
export interface ISharedMapBeta extends Omit<ISharedMap, Exclude<keyof
|
|
107
|
+
export interface ISharedMapBeta extends Omit<ISharedMap, Exclude<keyof FluidMap<string, unknown>, "get" | "set">>, FluidMapLegacy<string, any> {
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
// @beta @sealed @legacy
|
|
@@ -5,17 +5,19 @@
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
7
|
// @public @sealed @legacy
|
|
8
|
-
export interface IDirectory extends
|
|
8
|
+
export interface IDirectory extends FluidMap<string, any>, IEventProvider<IDirectoryEvents>, Partial<IDisposable> {
|
|
9
9
|
readonly absolutePath: string;
|
|
10
|
+
clear(): void;
|
|
10
11
|
countSubDirectory?(): number;
|
|
11
12
|
createSubDirectory(subdirName: string): IDirectory;
|
|
13
|
+
delete(key: string): boolean;
|
|
12
14
|
deleteSubDirectory(subdirName: string): boolean;
|
|
13
15
|
get<T = any>(key: string): T | undefined;
|
|
14
16
|
getSubDirectory(subdirName: string): IDirectory | undefined;
|
|
15
17
|
getWorkingDirectory(relativePath: string): IDirectory | undefined;
|
|
16
18
|
hasSubDirectory(subdirName: string): boolean;
|
|
17
19
|
set<T = unknown>(key: string, value: T): this;
|
|
18
|
-
subdirectories():
|
|
20
|
+
subdirectories(): FluidIterableIterator<[string, IDirectory]>;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
// @public @sealed @legacy
|