-
Notifications
You must be signed in to change notification settings - Fork 576
Compat: Add minVersionForCollab option to declarative model and deprecate CompatibilityMode #27212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
3993621
86fa017
afb3e9e
7179ef5
55de693
5f1483e
3e1d70e
1ca24cb
0eac478
30b0de8
6f983ce
8a9d114
ce1688f
a38e5cf
d3a83b3
dc8c8ac
dd1678a
d65eeeb
fd975d2
a872826
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| --- | ||
| "@fluidframework/fluid-static": minor | ||
| "fluid-framework": minor | ||
| "__section": legacy | ||
| --- | ||
| `createTreeContainerRuntimeFactory` no longer accepts `minVersionForCollabOverride` | ||
|
|
||
| The `minVersionForCollabOverride` property on the `props` argument of `createTreeContainerRuntimeFactory` has been removed. | ||
|
|
||
| Pass a [`MinimumVersionForCollab`](https://fluidframework.com/docs/api/runtime-definitions/minimumversionforcollab-typealias) semver string (for example `"2.10.0"`) directly via the `compatibilityMode` property instead. `compatibilityMode` now accepts either a `MinimumVersionForCollab` semver string or the existing (deprecated) `CompatibilityMode` values `"1"` / `"2"`. | ||
|
Check failure on line 10 in .changeset/zesty-otters-collab.md
|
||
|
|
||
| Before: | ||
|
|
||
| ```ts | ||
| createTreeContainerRuntimeFactory({ | ||
| schema, | ||
| compatibilityMode: "2", | ||
| minVersionForCollabOverride: "2.10.0", | ||
| }); | ||
| ``` | ||
|
|
||
| After: | ||
|
|
||
| ```ts | ||
| createTreeContainerRuntimeFactory({ | ||
| schema, | ||
| compatibilityMode: "2.10.0", | ||
| }); | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |
| ```ts | ||
|
|
||
| // @public | ||
| // @public @deprecated | ||
| export type CompatibilityMode = "1" | "2"; | ||
|
|
||
| // @public | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |
| ```ts | ||
|
|
||
| // @public | ||
| // @public @deprecated | ||
| export type CompatibilityMode = "1" | "2"; | ||
|
|
||
| // @public | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |
| ```ts | ||
|
|
||
| // @public | ||
| // @public @deprecated | ||
| export type CompatibilityMode = "1" | "2"; | ||
|
|
||
| // @public | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |
| ```ts | ||
|
|
||
| // @public | ||
| // @public @deprecated | ||
| export type CompatibilityMode = "1" | "2"; | ||
|
|
||
| // @public | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,19 +4,19 @@ | |
| */ | ||
|
|
||
| import type { IContainerRuntimeOptionsInternal } from "@fluidframework/container-runtime/internal"; | ||
|
|
||
| import type { CompatibilityMode } from "./types.js"; | ||
| import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal"; | ||
| import { gte } from "semver-ts"; | ||
|
|
||
| /** | ||
| * The CompatibilityMode selected determines the set of runtime options to use. In "1" mode we support | ||
| * full interop with true 1.x clients, while in "2" mode we only support interop with 2.x clients. | ||
| * The `minVersionForCollab` determines the set of runtime options to use. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: I don't think this description is very accurate. Probably worth reworking this. |
||
| * For a 1.x `minVersionForCollab` we support full interop with true 1.x clients. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: these specifics probably belong in a |
||
| * For a 2.x `minVersionForCollab` we only support interop with 2.x clients. | ||
| * | ||
| * @privateRemarks In general, we can use the `compatibilityMode` property of `LoadContainerRuntimeParams` to apply | ||
| * the proper configurations. However, there are some options that we need to explicity set that differ | ||
| * from the default values (i.e. `enableRuntimeIdCompressor` below). | ||
| * @privateRemarks The purpose of this map is to use a different set of defaults | ||
| * than what the runtime normally uses based on a given `minVersionForCollab` (e.g. `enableRuntimeIdCompressor` below).) | ||
| */ | ||
| export const compatibilityModeRuntimeOptions: Record< | ||
| CompatibilityMode, | ||
| const minVersionForCollabToDefaultRuntimeOptions: Record< | ||
| "1" | "2", | ||
| IContainerRuntimeOptionsInternal | ||
| > = { | ||
| "1": {}, | ||
|
|
@@ -27,3 +27,20 @@ export const compatibilityModeRuntimeOptions: Record< | |
| enableRuntimeIdCompressor: "on", | ||
| }, | ||
| }; | ||
|
|
||
| /** | ||
| * Returns the fluid-static-specific runtime option overrides for the given `minVersionForCollab`. | ||
| * | ||
| * @remarks | ||
| * The bulk of runtime defaults for a given `minVersionForCollab` are selected by container-runtime | ||
| * (via `getMinVersionForCollabDefaults`). This function only contributes the additional overrides | ||
| * that fluid-static needs to layer on top of those defaults. | ||
| * @internal | ||
| */ | ||
| export function defaultRuntimeOptionsForMinVersion( | ||
| minVersionForCollab: MinimumVersionForCollab, | ||
| ): IContainerRuntimeOptionsInternal { | ||
| return minVersionForCollabToDefaultRuntimeOptions[ | ||
| gte(minVersionForCollab, "2.0.0") ? "2" : "1" | ||
|
jason-ha marked this conversation as resolved.
|
||
| ]; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a beta breaking change. It will need to be kept until 2.110 - file deprecation issue under #26499.