@fluidframework/core-interfaces 2.0.0-internal.5.3.2 → 2.0.0-internal.5.4.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 +4 -0
- package/Removing-IFluidRouter.md +71 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
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 `initializeEntryPoint` that's found on `ContainerRuntime.loadRuntime` and `FluidDataStoreRuntime`'s constructor.
|
|
60
|
+
|
|
61
|
+
### Aliased DataStores
|
|
62
|
+
|
|
63
|
+
(Not yet written)
|
|
64
|
+
|
|
65
|
+
## Status
|
|
66
|
+
|
|
67
|
+
<!-- prettier-ignore-start -->
|
|
68
|
+
| API | Deprecated in | Removed in |
|
|
69
|
+
| -------------------------------------------------------- | -------------------- | -------------------- |
|
|
70
|
+
| `IFluidRouter` | 2.0.0-internal.5.4.0 | |
|
|
71
|
+
<!-- prettier-ignore-end -->
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/core-interfaces",
|
|
3
|
-
"version": "2.0.0-internal.5.
|
|
3
|
+
"version": "2.0.0-internal.5.4.0",
|
|
4
4
|
"description": "Fluid object interfaces",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@fluidframework/core-interfaces-previous": "npm:@fluidframework/core-interfaces@2.0.0-internal.5.2.0",
|
|
22
22
|
"@fluidframework/eslint-config-fluid": "^2.0.0",
|
|
23
23
|
"@microsoft/api-extractor": "^7.34.4",
|
|
24
|
-
"@types/node": "^
|
|
24
|
+
"@types/node": "^16.18.38",
|
|
25
25
|
"concurrently": "^7.6.0",
|
|
26
26
|
"copyfiles": "^2.4.1",
|
|
27
27
|
"eslint": "~8.6.0",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"ci:build:docs": "api-extractor run --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../_api-extractor-temp/",
|
|
44
44
|
"ci:test": "echo No test for this package",
|
|
45
45
|
"ci:test:coverage": "echo No test for this package",
|
|
46
|
-
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
|
|
46
|
+
"clean": "rimraf --glob \"dist\" \"lib\" \"*.tsbuildinfo\" \"*.build.log\"",
|
|
47
47
|
"eslint": "eslint --format stylish src",
|
|
48
48
|
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
49
49
|
"format": "npm run prettier:fix",
|