@fluidframework/core-interfaces 1.4.0-115997 → 2.0.0-dev-rc.1.0.0.224419
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 +5 -13
- package/CHANGELOG.md +172 -0
- package/README.md +21 -0
- package/Removing-IFluidRouter.md +153 -0
- package/api-extractor-lint.json +4 -0
- package/api-extractor.json +2 -2
- package/api-report/core-interfaces.api.md +507 -0
- package/dist/config.d.ts +35 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/{fluidObject.js → config.js} +1 -1
- package/dist/config.js.map +1 -0
- package/dist/core-interfaces-alpha.d.ts +889 -0
- package/dist/core-interfaces-beta.d.ts +758 -0
- package/dist/core-interfaces-public.d.ts +758 -0
- package/dist/core-interfaces-untrimmed.d.ts +1000 -0
- package/dist/disposable.d.ts +22 -0
- package/dist/disposable.d.ts.map +1 -0
- package/dist/disposable.js +7 -0
- package/dist/disposable.js.map +1 -0
- package/dist/error.d.ts +113 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +34 -0
- package/dist/error.js.map +1 -0
- package/dist/events.d.ts +258 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +7 -0
- package/dist/events.js.map +1 -0
- package/dist/fluidLoadable.d.ts +16 -0
- package/dist/fluidLoadable.d.ts.map +1 -1
- package/dist/fluidLoadable.js +6 -0
- package/dist/fluidLoadable.js.map +1 -1
- package/dist/fluidPackage.d.ts +47 -28
- package/dist/fluidPackage.d.ts.map +1 -1
- package/dist/fluidPackage.js +21 -14
- package/dist/fluidPackage.js.map +1 -1
- package/dist/fluidRouter.d.ts +9 -10
- package/dist/fluidRouter.d.ts.map +1 -1
- package/dist/fluidRouter.js +0 -2
- package/dist/fluidRouter.js.map +1 -1
- package/dist/handles.d.ts +21 -3
- package/dist/handles.d.ts.map +1 -1
- package/dist/handles.js +6 -0
- package/dist/handles.js.map +1 -1
- package/dist/index.d.ts +18 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -20
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +180 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +17 -0
- package/dist/logger.js.map +1 -0
- package/dist/provider.d.ts +17 -10
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js.map +1 -1
- package/dist/tsdoc-metadata.json +11 -0
- package/lib/config.d.ts +35 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +7 -0
- package/lib/config.js.map +1 -0
- package/lib/core-interfaces-alpha.d.ts +889 -0
- package/lib/core-interfaces-beta.d.ts +758 -0
- package/lib/core-interfaces-public.d.ts +758 -0
- package/lib/core-interfaces-untrimmed.d.ts +1000 -0
- package/lib/disposable.d.ts +22 -0
- package/lib/disposable.d.ts.map +1 -0
- package/lib/disposable.js +7 -0
- package/lib/disposable.js.map +1 -0
- package/lib/error.d.ts +113 -0
- package/lib/error.d.ts.map +1 -0
- package/lib/error.js +34 -0
- package/lib/error.js.map +1 -0
- package/lib/events.d.ts +258 -0
- package/lib/events.d.ts.map +1 -0
- package/lib/events.js +7 -0
- package/lib/events.js.map +1 -0
- package/lib/fluidLoadable.d.ts +16 -0
- package/lib/fluidLoadable.d.ts.map +1 -1
- package/lib/fluidLoadable.js +11 -2
- package/lib/fluidLoadable.js.map +1 -1
- package/lib/fluidPackage.d.ts +47 -28
- package/lib/fluidPackage.d.ts.map +1 -1
- package/lib/fluidPackage.js +28 -16
- package/lib/fluidPackage.js.map +1 -1
- package/lib/fluidRouter.d.ts +9 -10
- package/lib/fluidRouter.d.ts.map +1 -1
- package/lib/fluidRouter.js +2 -1
- package/lib/fluidRouter.js.map +1 -1
- package/lib/handles.d.ts +21 -3
- package/lib/handles.d.ts.map +1 -1
- package/lib/handles.js +11 -2
- package/lib/handles.js.map +1 -1
- package/lib/index.d.ts +18 -6
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +17 -8
- package/lib/index.js.map +1 -1
- package/lib/logger.d.ts +180 -0
- package/lib/logger.d.ts.map +1 -0
- package/lib/logger.js +17 -0
- package/lib/logger.js.map +1 -0
- package/lib/provider.d.ts +17 -10
- package/lib/provider.d.ts.map +1 -1
- package/lib/provider.js +2 -1
- package/lib/provider.js.map +1 -1
- package/package.json +63 -37
- package/{lib/fluidObject.js → prettier.config.cjs} +4 -2
- package/src/config.ts +36 -0
- package/src/disposable.ts +23 -0
- package/src/error.ts +130 -0
- package/src/events.ts +439 -0
- package/src/fluidLoadable.ts +24 -6
- package/src/fluidPackage.ts +126 -103
- package/src/fluidRouter.ts +22 -19
- package/src/handles.ts +74 -57
- package/src/index.ts +66 -14
- package/src/logger.ts +212 -0
- package/src/provider.ts +24 -15
- package/tsconfig.esnext.json +5 -6
- package/tsconfig.json +10 -13
- package/dist/fluidObject.d.ts +0 -10
- package/dist/fluidObject.d.ts.map +0 -1
- package/dist/fluidObject.js.map +0 -1
- package/lib/fluidObject.d.ts +0 -10
- package/lib/fluidObject.d.ts.map +0 -1
- package/lib/fluidObject.js.map +0 -1
- package/lib/test/types/fluidObjectTypes.d.ts +0 -2
- package/lib/test/types/fluidObjectTypes.d.ts.map +0 -1
- package/lib/test/types/fluidObjectTypes.js +0 -108
- package/lib/test/types/fluidObjectTypes.js.map +0 -1
- package/lib/test/types/validateCoreInterfacesPrevious.d.ts +0 -2
- package/lib/test/types/validateCoreInterfacesPrevious.d.ts.map +0 -1
- package/lib/test/types/validateCoreInterfacesPrevious.js +0 -64
- package/lib/test/types/validateCoreInterfacesPrevious.js.map +0 -1
- package/src/fluidObject.ts +0 -12
package/.eslintrc.js
CHANGED
|
@@ -4,16 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
// Rules only for type validation files
|
|
13
|
-
files: ["**/types/*validate*Previous*.ts"],
|
|
14
|
-
rules: {
|
|
15
|
-
"@typescript-eslint/comma-spacing": "off",
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
}
|
|
7
|
+
extends: [require.resolve("@fluidframework/eslint-config-fluid"), "prettier"],
|
|
8
|
+
parserOptions: {
|
|
9
|
+
project: ["./tsconfig.json", "./src/test/tsconfig.json"],
|
|
10
|
+
},
|
|
11
|
+
};
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# @fluidframework/core-interfaces
|
|
2
|
+
|
|
3
|
+
## 2.0.0-internal.8.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- container-runtime-definitions: Removed getRootDataStore [9a451d4946](https://github.com/microsoft/FluidFramework/commits/9a451d4946b5c51a52e4d1ab5bf51e7b285b0d74)
|
|
8
|
+
|
|
9
|
+
The `getRootDataStore` method has been removed from `IContainerRuntime` and `ContainerRuntime`. Please migrate all usage to the new `getAliasedDataStoreEntryPoint` method. This method returns the data store's entry point which is its `IFluidHandle`.
|
|
10
|
+
|
|
11
|
+
See [Removing-IFluidRouter.md](https://github.com/microsoft/FluidFramework/blob/main/packages/common/core-interfaces/Removing-IFluidRouter.md) for more details.
|
|
12
|
+
|
|
13
|
+
- core-interfaces: Removed IFluidRouter and IProvideFluidRouter [9a451d4946](https://github.com/microsoft/FluidFramework/commits/9a451d4946b5c51a52e4d1ab5bf51e7b285b0d74)
|
|
14
|
+
|
|
15
|
+
The `IFluidRouter` and `IProvideFluidRouter` interfaces have been removed. Please migrate all usage to the new `entryPoint` pattern.
|
|
16
|
+
|
|
17
|
+
See [Removing-IFluidRouter.md](https://github.com/microsoft/FluidFramework/blob/main/packages/common/core-interfaces/Removing-IFluidRouter.md) for more details.
|
|
18
|
+
|
|
19
|
+
## 2.0.0-internal.7.4.0
|
|
20
|
+
|
|
21
|
+
### Minor Changes
|
|
22
|
+
|
|
23
|
+
- telemetry-utils: Deprecate ConfigTypes and IConfigProviderBase ([#18597](https://github.com/microsoft/FluidFramework/issues/18597)) [39b9ff57c0](https://github.com/microsoft/FluidFramework/commits/39b9ff57c0184b72f0e3f9425922dda944995265)
|
|
24
|
+
|
|
25
|
+
The types `ConfigTypes` and `IConfigProviderBase` have been deprecated in the @fluidframework/telemetry-utils package.
|
|
26
|
+
The types can now be found in the @fluidframework/core-interfaces package. Please replace any uses with the types from
|
|
27
|
+
@fluidframework/core-interfaces.
|
|
28
|
+
|
|
29
|
+
## 2.0.0-internal.7.3.0
|
|
30
|
+
|
|
31
|
+
Dependency updates only.
|
|
32
|
+
|
|
33
|
+
## 2.0.0-internal.7.2.0
|
|
34
|
+
|
|
35
|
+
Dependency updates only.
|
|
36
|
+
|
|
37
|
+
## 2.0.0-internal.7.1.0
|
|
38
|
+
|
|
39
|
+
Dependency updates only.
|
|
40
|
+
|
|
41
|
+
## 2.0.0-internal.7.0.0
|
|
42
|
+
|
|
43
|
+
### Major Changes
|
|
44
|
+
|
|
45
|
+
- test-utils: provideEntryPoint is required [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
46
|
+
|
|
47
|
+
The optional `provideEntryPoint` method has become required on a number of constructors. A value will need to be provided to the following classes:
|
|
48
|
+
|
|
49
|
+
- `BaseContainerRuntimeFactory`
|
|
50
|
+
- `RuntimeFactory`
|
|
51
|
+
- `ContainerRuntime` (constructor and `loadRuntime`)
|
|
52
|
+
- `FluidDataStoreRuntime`
|
|
53
|
+
|
|
54
|
+
See [testContainerRuntimeFactoryWithDefaultDataStore.ts](https://github.com/microsoft/FluidFramework/tree/main/packages/test/test-utils/src/testContainerRuntimeFactoryWithDefaultDataStore.ts) for an example implemtation of `provideEntryPoint` for ContainerRuntime.
|
|
55
|
+
See [pureDataObjectFactory.ts](https://github.com/microsoft/FluidFramework/tree/main/packages/framework/aqueduct/src/data-object-factories/pureDataObjectFactory.ts#L83) for an example implementation of `provideEntryPoint` for DataStoreRuntime.
|
|
56
|
+
|
|
57
|
+
Subsequently, various `entryPoint` and `getEntryPoint()` endpoints have become required. Please see [containerRuntime.ts](https://github.com/microsoft/FluidFramework/tree/main/packages/runtime/container-runtime/src/containerRuntime.ts) for example implementations of these APIs.
|
|
58
|
+
|
|
59
|
+
For more details, see [Removing-IFluidRouter.md](https://github.com/microsoft/FluidFramework/blob/main/packages/common/core-interfaces/Removing-IFluidRouter.md)
|
|
60
|
+
|
|
61
|
+
- DEPRECATED: core-interfaces: IFluidRouter and IProvideFluidRouter deprecated [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
62
|
+
|
|
63
|
+
`IFluidRouter` and `IProvideFluidRouter` have been deprecated. Please remove all usages of these interfaces and migrate to the new `entryPoint` pattern.
|
|
64
|
+
|
|
65
|
+
See [Removing-IFluidRouter.md](https://github.com/microsoft/FluidFramework/blob/main/packages/common/core-interfaces/Removing-IFluidRouter.md) for more details.
|
|
66
|
+
|
|
67
|
+
- Minimum TypeScript version now 5.1.6 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
68
|
+
|
|
69
|
+
The minimum supported TypeScript version for Fluid 2.0 clients is now 5.1.6.
|
|
70
|
+
|
|
71
|
+
## 2.0.0-internal.6.4.0
|
|
72
|
+
|
|
73
|
+
Dependency updates only.
|
|
74
|
+
|
|
75
|
+
## 2.0.0-internal.6.3.0
|
|
76
|
+
|
|
77
|
+
### Minor Changes
|
|
78
|
+
|
|
79
|
+
- Cleaning up duplicate or misnamed telemetry types ([#17149](https://github.com/microsoft/FluidFramework/issues/17149)) [f9236942fa](https://github.com/microsoft/FluidFramework/commits/f9236942faf03cde860bfcbc7c28f8fbd81d3868)
|
|
80
|
+
|
|
81
|
+
We have two sets of telemetry-related interfaces:
|
|
82
|
+
|
|
83
|
+
- The "Base" ones
|
|
84
|
+
- These have a very bare API surface
|
|
85
|
+
- They are used on public API surfaces to transmit logs across layers
|
|
86
|
+
- The internal ones
|
|
87
|
+
- These have a richer API surface (multiple log functions with different categories,
|
|
88
|
+
support for logging flat arrays and objects)
|
|
89
|
+
- They are used for instrumenting our code, and then normalize and pass off the logs via the Base interface
|
|
90
|
+
|
|
91
|
+
There are two problems with the given state of the world:
|
|
92
|
+
|
|
93
|
+
1. The "Base" ones were not named consistently, so the distinction was not as apparent as it could be
|
|
94
|
+
2. The internal ones were copied to `@fluidframework/telemetry-utils` and futher extended, but the original duplicates remain.
|
|
95
|
+
|
|
96
|
+
This change addresses these by adding "Base" to the name of each base type, and deprecating the old duplicate internal types.
|
|
97
|
+
|
|
98
|
+
Additionally, the following types were adjusted:
|
|
99
|
+
|
|
100
|
+
- `TelemetryEventCategory` is moving from `@fluidframework/core-interfaces` to `@fluidframework/telemetry-utils`
|
|
101
|
+
- Several types modeling "tagged" telemetry properties are deprecated in favor of a generic type `Tagged<V>`
|
|
102
|
+
|
|
103
|
+
## 2.0.0-internal.6.2.0
|
|
104
|
+
|
|
105
|
+
### Minor Changes
|
|
106
|
+
|
|
107
|
+
- Remove use of @fluidframework/common-definitions ([#16638](https://github.com/microsoft/FluidFramework/issues/16638)) [a8c81509c9](https://github.com/microsoft/FluidFramework/commits/a8c81509c9bf09cfb2092ebcf7265205f9eb6dbf)
|
|
108
|
+
|
|
109
|
+
The **@fluidframework/common-definitions** package is being deprecated, so the following interfaces and types are now
|
|
110
|
+
imported from the **@fluidframework/core-interfaces** package:
|
|
111
|
+
|
|
112
|
+
- interface IDisposable
|
|
113
|
+
- interface IErrorEvent
|
|
114
|
+
- interface IErrorEvent
|
|
115
|
+
- interface IEvent
|
|
116
|
+
- interface IEventProvider
|
|
117
|
+
- interface ILoggingError
|
|
118
|
+
- interface ITaggedTelemetryPropertyType
|
|
119
|
+
- interface ITelemetryBaseEvent
|
|
120
|
+
- interface ITelemetryBaseLogger
|
|
121
|
+
- interface ITelemetryErrorEvent
|
|
122
|
+
- interface ITelemetryGenericEvent
|
|
123
|
+
- interface ITelemetryLogger
|
|
124
|
+
- interface ITelemetryPerformanceEvent
|
|
125
|
+
- interface ITelemetryProperties
|
|
126
|
+
- type ExtendEventProvider
|
|
127
|
+
- type IEventThisPlaceHolder
|
|
128
|
+
- type IEventTransformer
|
|
129
|
+
- type ReplaceIEventThisPlaceHolder
|
|
130
|
+
- type ReplaceIEventThisPlaceHolder
|
|
131
|
+
- type TelemetryEventCategory
|
|
132
|
+
- type TelemetryEventPropertyType
|
|
133
|
+
|
|
134
|
+
## 2.0.0-internal.6.1.0
|
|
135
|
+
|
|
136
|
+
Dependency updates only.
|
|
137
|
+
|
|
138
|
+
## 2.0.0-internal.6.0.0
|
|
139
|
+
|
|
140
|
+
### Major Changes
|
|
141
|
+
|
|
142
|
+
- Upgraded typescript transpilation target to ES2020 [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
|
|
143
|
+
|
|
144
|
+
Upgraded typescript transpilation target to ES2020. This is done in order to decrease the bundle sizes of Fluid Framework packages. This has provided size improvements across the board for ex. Loader, Driver, Runtime etc. Reduced bundle sizes helps to load lesser code in apps and hence also helps to improve the perf.If any app wants to target any older versions of browsers with which this target version is not compatible, then they can use packages like babel to transpile to a older target.
|
|
145
|
+
|
|
146
|
+
## 2.0.0-internal.5.4.0
|
|
147
|
+
|
|
148
|
+
Dependency updates only.
|
|
149
|
+
|
|
150
|
+
## 2.0.0-internal.5.3.0
|
|
151
|
+
|
|
152
|
+
Dependency updates only.
|
|
153
|
+
|
|
154
|
+
## 2.0.0-internal.5.2.0
|
|
155
|
+
|
|
156
|
+
Dependency updates only.
|
|
157
|
+
|
|
158
|
+
## 2.0.0-internal.5.1.0
|
|
159
|
+
|
|
160
|
+
Dependency updates only.
|
|
161
|
+
|
|
162
|
+
## 2.0.0-internal.5.0.0
|
|
163
|
+
|
|
164
|
+
Dependency updates only.
|
|
165
|
+
|
|
166
|
+
## 2.0.0-internal.4.4.0
|
|
167
|
+
|
|
168
|
+
Dependency updates only.
|
|
169
|
+
|
|
170
|
+
## 2.0.0-internal.4.1.0
|
|
171
|
+
|
|
172
|
+
Dependency updates only.
|
package/README.md
CHANGED
|
@@ -3,3 +3,24 @@
|
|
|
3
3
|
Core interfaces describing the contracts the Fluid Loader supports or consumes.
|
|
4
4
|
|
|
5
5
|
See also: [The Fluid Loader README](../README.md).
|
|
6
|
+
|
|
7
|
+
<!-- AUTO-GENERATED-CONTENT:START (README_DEPENDENCY_GUIDELINES_SECTION:includeHeading=TRUE) -->
|
|
8
|
+
|
|
9
|
+
<!-- prettier-ignore-start -->
|
|
10
|
+
<!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
|
|
11
|
+
|
|
12
|
+
## Using Fluid Framework libraries
|
|
13
|
+
|
|
14
|
+
When taking a dependency on a Fluid Framework library, we recommend using a `^` (caret) version range, such as `^1.3.4`.
|
|
15
|
+
While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
|
|
16
|
+
library consumers should always prefer `^`.
|
|
17
|
+
|
|
18
|
+
Note that when depending on a library version of the form `2.0.0-internal.x.y.z`, called the Fluid internal version scheme,
|
|
19
|
+
you must use a `>= <` dependency range (such as `>=2.0.0-internal.x.y.z <2.0.0-internal.w.0.0` where `w` is `x+1`).
|
|
20
|
+
Standard `^` and `~` ranges will not work as expected.
|
|
21
|
+
See the [@fluid-tools/version-tools](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/version-tools/README.md)
|
|
22
|
+
package for more information including tools to convert between version schemes.
|
|
23
|
+
|
|
24
|
+
<!-- prettier-ignore-end -->
|
|
25
|
+
|
|
26
|
+
<!-- AUTO-GENERATED-CONTENT:END -->
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Removing IFluidRouter
|
|
2
|
+
|
|
3
|
+
The interface `IFluidRouter` is being deprecated and removed over the next several internal releases.
|
|
4
|
+
It exposes a `request` function and is implemented across Fluid Framework's layers to light up the "request pattern"
|
|
5
|
+
for accessing objects out of a Fluid Container.
|
|
6
|
+
The request pattern is incompatible with [Garbage Collection](../../runtime/container-runtime/src/gc/garbageCollection.md),
|
|
7
|
+
so any code that previously accessed an object via request should migrate to using handles instead.
|
|
8
|
+
|
|
9
|
+
This document serves as a "how-to" guide for this migration, and will also include the latest status of the work.
|
|
10
|
+
|
|
11
|
+
## Key Concepts
|
|
12
|
+
|
|
13
|
+
### `IFluidRouter` and `absolutePath`
|
|
14
|
+
|
|
15
|
+
Here's what [`IFluidRouter`](src/fluidRouter.ts) looks like:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
export interface IProvideFluidRouter {
|
|
19
|
+
readonly IFluidRouter: IFluidRouter;
|
|
20
|
+
}
|
|
21
|
+
export interface IFluidRouter extends IProvideFluidRouter {
|
|
22
|
+
request(request: IRequest): Promise<IResponse>;
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
It uses the Provider pattern so any Fluid Object may be queried for `IFluidRouter` to call `request` on if present.
|
|
27
|
+
|
|
28
|
+
Here's the **deprecated** flow for referencing and accessing an object:
|
|
29
|
+
|
|
30
|
+
1. Store the object's `absolutePath` (a container-relative URL path) in some DDS
|
|
31
|
+
2. Later, load the object via `request({ url: absolutePath })`
|
|
32
|
+
|
|
33
|
+
### `IFluidLoadable` and `IFluidHandle`
|
|
34
|
+
|
|
35
|
+
The new way to reference an object within a Fluid Container is via its `handle`:
|
|
36
|
+
|
|
37
|
+
1. Store the object's `handle` in some DDS
|
|
38
|
+
2. Later, load the object via `handle.get()`
|
|
39
|
+
|
|
40
|
+
### Entry Point
|
|
41
|
+
|
|
42
|
+
`request` has also been used as the way to get at the application-specific Container and DataStore implementations
|
|
43
|
+
starting from native Fluid types like `IContainer` and `IDataStore` - both of which have extended `IFluidRouter`.
|
|
44
|
+
The new way to do this is via the object's "entry point".
|
|
45
|
+
|
|
46
|
+
Here it is on `IContainer`, returning an anonymous `FluidObject` - the application-specified root object:
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
getEntryPoint(): Promise<FluidObject | undefined>;
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
And here it is on `IDataStore`, returning an `IFluidHandle` to an anonymous `FluidObject` - the DataStore's root object:
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
readonly entryPoint: IFluidHandle<FluidObject>;
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
So how does an application specify what the Container or DataStore's entry point is?
|
|
59
|
+
Via a parameter `provideEntryPoint` that's found on `ContainerRuntime.loadRuntime` and `FluidDataStoreRuntime`'s constructor.
|
|
60
|
+
|
|
61
|
+
See [testContainerRuntimeFactoryWithDefaultDataStore.ts](https://github.com/microsoft/FluidFramework/tree/main/packages/test/test-utils/src/testContainerRuntimeFactoryWithDefaultDataStore.ts) for an example implemtation of `provideEntryPoint` for ContainerRuntime.
|
|
62
|
+
See [pureDataObjectFactory.ts](https://github.com/microsoft/FluidFramework/tree/main/packages/framework/aqueduct/src/data-object-factories/pureDataObjectFactory.ts#L83) for an example implementation of `provideEntryPoint` for DataStoreRuntime.
|
|
63
|
+
|
|
64
|
+
### ILoader request pattern
|
|
65
|
+
|
|
66
|
+
The `request` API (associated with the `IFluidRouter` interface) has been deprecated on `ILoader` and `Loader`.
|
|
67
|
+
|
|
68
|
+
After calling `ILoader.resolve(...)`, call the `getEntryPoint()` method on the returned `IContainer`.
|
|
69
|
+
The following is an example of what this change may look like:
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
// OLD
|
|
73
|
+
const request: IRequest;
|
|
74
|
+
const urlResolver = new YourUrlResolver();
|
|
75
|
+
const loader = new Loader({ urlResolver, ... });
|
|
76
|
+
|
|
77
|
+
await loader.resolve(request);
|
|
78
|
+
const response = loader.request(request);
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
// NEW
|
|
83
|
+
const request: IRequest;
|
|
84
|
+
const urlResolver = new YourUrlResolver();
|
|
85
|
+
const loader = new Loader({ urlResolver, ... });
|
|
86
|
+
|
|
87
|
+
const container = await loader.resolve(request);
|
|
88
|
+
const entryPoint = await container.getEntryPoint();
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Aliased DataStores
|
|
92
|
+
|
|
93
|
+
The `getRootDataStore` API has been deprecated on `IContainerRuntime` and `ContainerRuntime`. Migrate to usage of the new `IContainerRuntime.getAliasedDataStoreEntryPoint(...)` endpoint.
|
|
94
|
+
The following is an example of that this change may look like:
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
// OLD
|
|
98
|
+
const alias = "alias";
|
|
99
|
+
const dataStore = await containerRuntime.createDataStore(TestDataObjectType);
|
|
100
|
+
await dataStore.trySetAlias(alias);
|
|
101
|
+
|
|
102
|
+
const retrievedDataStore = await containerRuntime.getRootDataStore(alias);
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
// NEW
|
|
107
|
+
const alias = "alias";
|
|
108
|
+
const dataStore = await containerRuntime.createDataStore(TestDataObjectType);
|
|
109
|
+
await dataStore.trySetAlias(alias);
|
|
110
|
+
|
|
111
|
+
const entryPoint: IFluidHandle<ITestDataObject> | undefined =
|
|
112
|
+
await containerRuntime.getRootDataStore(alias);
|
|
113
|
+
const retrievedDataStore = await entryPoint?.get();
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Sub-object routing
|
|
117
|
+
|
|
118
|
+
Sub-object routing and requesting will continue to work as-is for the most part. The `FluidDataStoreRuntime` class has a dedicated `request(...)` method, separate from the `IFluidRouter` concept.
|
|
119
|
+
|
|
120
|
+
There is only one key thing to keep in mind. If you are using your own `IFluidDataStoreFactory` implementation, you will need to wrap the created `FluidDataStoreRuntime` (in `IFluidDataStoreFactory.instantiateDataStore`) with a `mixinRequestHandler`. This `mixinRequestHandler` should handle default cases like requesting `""`, `"/"`, or `"/?"`.
|
|
121
|
+
|
|
122
|
+
For an example of this in action, please see [pureDataObjectFactory.ts](https://github.com/microsoft/FluidFramework/blob/main/packages/framework/aqueduct/src/data-object-factories/pureDataObjectFactory.ts) and [pureDataObject.ts](https://github.com/microsoft/FluidFramework/blob/main/packages/framework/aqueduct/src/data-objects/pureDataObject.ts).
|
|
123
|
+
|
|
124
|
+
## Status
|
|
125
|
+
|
|
126
|
+
<!-- prettier-ignore-start -->
|
|
127
|
+
| API | Deprecated in | Removed in |
|
|
128
|
+
| -------------------------------------------------------------------------------------------- | -------------------- | -------------------- |
|
|
129
|
+
| `IContainer.request` (except calling with "/") | 2.0.0-internal.6.0.0 | 2.0.0-internal.8.0.0 |
|
|
130
|
+
| `IDataStore.request` (except calling with "/") | 2.0.0-internal.6.0.0 | 2.0.0-internal.8.0.0 |
|
|
131
|
+
| `IContainer.IFluidRouter` | 2.0.0-internal.6.0.0 | 2.0.0-internal.8.0.0 |
|
|
132
|
+
| `IDataStore.IFluidRouter` | 2.0.0-internal.6.0.0 | 2.0.0-internal.8.0.0 |
|
|
133
|
+
| `request` and `IFluidRouter` on `ILoader` and `Loader` | 2.0.0-internal.6.0.0 | 2.0.0-internal.8.0.0 |
|
|
134
|
+
| `request` and `IFluidRouter` on `IRuntime` and `ContainerRuntime` | 2.0.0-internal.6.0.0 | 2.0.0-internal.8.0.0 |
|
|
135
|
+
| `request` and `IFluidRouter` on `IFluidDataStoreRuntime` | 2.0.0-internal.6.0.0 | 2.0.0-internal.8.0.0 |
|
|
136
|
+
| `IFluidRouter` on `IFluidDataStoreChannel` and `FluidDataStoreRuntime` | 2.0.0-internal.6.0.0 | 2.0.0-internal.8.0.0 |
|
|
137
|
+
| `getRootDataStore` on `IContainerRuntime` and `ContainerRuntime` | 2.0.0-internal.6.0.0 | 2.0.0-internal.8.0.0 |
|
|
138
|
+
| `resolveHandle` on `IContainerRuntime` | 2.0.0-internal.7.0.0 | 2.0.0-internal.8.0.0 |
|
|
139
|
+
| `IFluidHandleContext` on `IContainerRuntimeBase` | 2.0.0-internal.7.0.0 | 2.0.0-internal.8.0.0 |
|
|
140
|
+
| `requestHandler` property in `ContainerRuntime.loadRuntime(...)` | 2.0.0-internal.7.0.0 | |
|
|
141
|
+
| `RuntimeRequestHandler` and `RuntimeRequestHandlerBuilder` | 2.0.0-internal.7.0.0 | |
|
|
142
|
+
| `request` and `IFluidRouter` on `IContainer` and `Container` | 2.0.0-internal.7.0.0 | 2.0.0-internal.8.0.0 |
|
|
143
|
+
| `request` on `IDataStore` | 2.0.0-internal.7.0.0 | 2.0.0-internal.8.0.0 |
|
|
144
|
+
| `IFluidRouter` and `IProvideFluidRouter` | 2.0.0-internal.7.0.0 | 2.0.0-internal.8.0.0 |
|
|
145
|
+
| `requestFluidObject` | 2.0.0-internal.7.0.0 | 2.0.0-internal.8.0.0 |
|
|
146
|
+
| `requestResolvedObjectFromContainer` | 2.0.0-internal.7.0.0 | 2.0.0-internal.8.0.0 |
|
|
147
|
+
| `getDefaultObjectFromContainer`, `getObjectWithIdFromContainer` and `getObjectFromContainer` | 2.0.0-internal.7.0.0 | 2.0.0-internal.8.0.0 |
|
|
148
|
+
<!-- prettier-ignore-end -->
|
|
149
|
+
|
|
150
|
+
The removal of some items will need to wait for the LTS version of the `Loader` to reach "2.0.0-internal.7.0.0". This is because old `Loader` or `Container` code doesn't know about the new `entryPoint` pattern and will still attempt to use the `request` pattern. The following items are affected:
|
|
151
|
+
|
|
152
|
+
- `requestHandler` property in `ContainerRuntime.loadRuntime(...)`, `BaseContainerRuntimeFactory`, `ContainerRuntimeFactoryWithDefaultDataStore`, `mixinAttributor`, `RuntimeFactory`, `TestContainerRuntimeFactory`
|
|
153
|
+
- `RuntimeRequestHandler` and `RuntimeRequestHandlerBuilder`
|
package/api-extractor.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "../../../common/build/build-common/api-extractor-base.json"
|
|
4
4
|
}
|