You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Shared Tree: Use minVersionForCollab instead of oldestCompatibleClient to specify min client version (#25402)
## Description
This change replaces `SharedTreeOptions.oldestCompatibleClient` with
`minVersionForCollab`. Additionally, Shared Tree will now use the
`minVersionForCollab` specified at the ContainerRuntime level when
`minVersionForCollab` is not specified at the Shared Tree level.
Changes APIs and codec code to use MinimumVersionForCollab in place of
FluidClientVersion. Also changes FluidClientVersion to a const object
that contains MinimumVersionForCollab values.
## Breaking Changes
This change breaks the following alpha APIs:
- `SharedTreeOptions`: `oldestCompatibleClient` has been replaced with
`minVersionForCollab`. See changeset notes on how to specify the minimum
compatible version.
- `CodecWriteOptions.oldestCompatibleClient` (type change)
- `makeDetachedFieldIndexCodec` (parameter type change)
- `TreeAlpha.exportCompressed` (parameter type change)
- `extractPersistedSchema` (parameter type change)
---------
Co-authored-by: Alex Villarreal <[email protected]>
Co-authored-by: Craig Macomber (Microsoft) <[email protected]>
MinimumVersionForCollab is now used in place of tree's alpha FluidClientVersion
7
+
8
+
`FluidClientVersion`: No longer used as the type for Fluid Client versions in APIs/codecs (for example, `oldestCompatibleClient`).
9
+
Additionally, `FluidClientVersion` is now a const object with members that declare specific [`MinimumVersionForCollab`](https://fluidframework.com/docs/api/runtime-definitions/minimumversionforcollab-typealias) versions.
10
+
These are intended to be used with APIs that require a version (such as `TreeAlpha.exportCompressed`).
11
+
12
+
`CodecWriteOptions` and `SharedTreeOptions`: `oldestCompatibleClient` has been replaced by `minVersionForCollab`.
13
+
See migration guide below.
14
+
15
+
`TreeAlpha.exportCompressed`: The `options` parameter previously had `oldestCompatibleClient` and now has `minVersionForCollab`.
16
+
Migrating requires a rename. Existing `FluidClientVersion.*` values are now `MinimumClientVersion`s.
17
+
18
+
#### Migrating
19
+
20
+
If an application is calling `loadContainerRuntime` directly and previously specified the minimum client version when
@@ -45,7 +45,7 @@ export function makeVersionedCodec<
45
45
if(!supportedVersions.has(versioned.version)){
46
46
thrownewUsageError(
47
47
`Unsupported version ${versioned.version} encountered while decoding data. Supported versions for this data are: ${Array.from(supportedVersions).join(", ")}.
48
-
The client which encoded this data likely specified an "oldestCompatibleClient" value which corresponds to a version newer than the version of this client ("${pkgVersion}").`,
48
+
The client which encoded this data likely specified an "minVersionForCollab" value which corresponds to a version newer than the version of this client ("${pkgVersion}").`,
49
49
);
50
50
}
51
51
constdecoded=inner.decode(data,context);
@@ -103,7 +103,7 @@ export function makeVersionDispatchingCodec<TDecoded, TContext>(
103
103
}
104
104
105
105
/**
106
-
* Creates a codec which dispatches to the appropriate member of a codec family based on the `oldestCompatibleClient` for encode and the
106
+
* Creates a codec which dispatches to the appropriate member of a codec family based on the `minVersionForCollab` for encode and the
107
107
* version number in data it encounters for decode.
108
108
* @privateRemarks
109
109
* This is a two stage builder so the first stage can encapsulate all codec specific details and the second can bring in configuration.
@@ -115,17 +115,17 @@ export class ClientVersionDispatchingCodecBuilder<TDecoded, TContext> {
@@ -115,12 +115,12 @@ export type FieldBatchCodec = IJsonCodec<
115
115
>;
116
116
117
117
/**
118
-
* Get the write version for {@link makeFieldBatchCodec} based on the `oldestCompatibleClient` version.
118
+
* Get the write version for {@link makeFieldBatchCodec} based on the `minVersionForCollab` version.
119
119
* @privateRemarks
120
120
* TODO: makeFieldBatchCodec (and makeVersionDispatchingCodec transitively) should bake in this versionToFormat logic and the resulting codec can then support use with FluidClientVersion directly.
0 commit comments