forked from microsoft/FluidFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add compat mode option to AzureClient and TinyliciousClient (microsof…
- Loading branch information
1 parent
0f7233c
commit 2730787
Showing
31 changed files
with
989 additions
and
736 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"@fluidframework/azure-client": minor | ||
"@fluidframework/fluid-static": minor | ||
"@fluidframework/tinylicious-client": minor | ||
--- | ||
|
||
compatibilityMode parameter added to createContainer and getContainer on AzureClient and TinyliciousClient | ||
|
||
To support migration from 1.x to 2.0, a compatibility mode parameter has been added to these methods on AzureClient and TinyliciousClient. When set to "1", this allows interop between the 2.0 clients and 1.x clients. When set to "2", interop with 1.x clients is disallowed but new 2.0 features may be used. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
packages/framework/fluid-static/src/compatibilityConfiguration.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/*! | ||
* Copyright (c) Microsoft Corporation and contributors. All rights reserved. | ||
* Licensed under the MIT License. | ||
*/ | ||
|
||
import { | ||
CompressionAlgorithms, | ||
type IContainerRuntimeOptions, | ||
} from "@fluidframework/container-runtime/internal"; | ||
import { FlushMode } from "@fluidframework/runtime-definitions/internal"; | ||
import type { CompatibilityMode } from "./types.js"; | ||
|
||
/** | ||
* 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. | ||
*/ | ||
export const compatibilityModeRuntimeOptions: Record<CompatibilityMode, IContainerRuntimeOptions> = | ||
{ | ||
"1": { | ||
// 1.x clients are compatible with TurnBased flushing, but here we elect to remain on Immediate flush mode | ||
// as a work-around for inability to send batches larger than 1Mb. Immediate flushing keeps batches smaller as | ||
// fewer messages will be included per flush. | ||
flushMode: FlushMode.Immediate, | ||
// Op compression is on by default but introduces a new type of op which is not compatible with 1.x clients. | ||
compressionOptions: { | ||
minimumBatchSizeInBytes: Number.POSITIVE_INFINITY, // disabled | ||
compressionAlgorithm: CompressionAlgorithms.lz4, | ||
}, | ||
// Grouped batching is on by default but introduces a new type of op which is not compatible with 1.x clients. | ||
enableGroupedBatching: false, | ||
// TODO: Include explicit disables for things that are currently off-by-default? | ||
}, | ||
"2": { | ||
// Explicit schema control explicitly makes the container incompatible with 1.x clients, to force their | ||
// ejection from collaboration and prevent container corruption. It is off by default and must be explicitly enabled. | ||
explicitSchemaControl: true, | ||
// The runtime ID compressor is a prerequisite to use SharedTree but is off by default and must be explicitly enabled. | ||
// It introduces a new type of op which is not compatible with 1.x clients. | ||
enableRuntimeIdCompressor: "on", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.