Add minDocumentRuntimeVersion compatibility API#27656
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Hi! Thank you for opening this PR. Want me to review it? Based on the diff (1496 lines, 134 files), I've queued these reviewers:
How this works
|
jason-ha
left a comment
There was a problem hiding this comment.
No other internal uses of minVersionForCollab that need addressed?
Check with API counsel if this is the name. I was expecting to see minDocumentRuntimeVersion - I'm okay with minimum spelled out but I don't know what the recommendation is.
| * | ||
| * @remarks Prefer {@link LoadContainerRuntimeParams.minimumDocumentRuntimeVersion} for new usages. |
| ## Cross-client Compatibility Configuration and Enforcement | ||
|
|
||
| ### minVersionForCollab | ||
| ### minimumDocumentRuntimeVersion / minVersionForCollab |
There was a problem hiding this comment.
Can we just have the new name?
If entry with old name should stick around for tombstoning, then keep it on its own and refer back to here.
| * @input | ||
| * @public | ||
| */ | ||
| export type MinimumDocumentRuntimeVersion = MinimumVersionForCollab; |
There was a problem hiding this comment.
This one should get the main definition and the other is deprecated alias, yeah?
| function getMinVersionForCollabFromParams( | ||
| minimumDocumentRuntimeVersion: MinimumDocumentRuntimeVersion | undefined, | ||
| minVersionForCollab: MinimumVersionForCollab | undefined, | ||
| ): MinimumVersionForCollab { | ||
| if ( | ||
| minimumDocumentRuntimeVersion !== undefined && | ||
| minVersionForCollab !== undefined && | ||
| minimumDocumentRuntimeVersion !== minVersionForCollab | ||
| ) { | ||
| throw new UsageError( | ||
| "minimumDocumentRuntimeVersion and minVersionForCollab must match when both are provided.", | ||
| ); | ||
| } |
There was a problem hiding this comment.
Why do we need this?
Thinking that if we have some consistency check I would check that only one is defined.
| "__section": feature | ||
| --- | ||
|
|
||
| Add document runtime version naming for compatibility configuration |
There was a problem hiding this comment.
We should be deprecating the old.
Look over the existing deprecation/breaking issues. Probably one of them can be updated and referred to here.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jason-ha
left a comment
There was a problem hiding this comment.
I've stopped reviewing part way. There seems like a lot of minVersionForCollab sticking around. Hard to see what the long-term code state will be.
| interface IFoo { | ||
| foo: string; | ||
| minVersionForCollab: MinimumVersionForCollab | undefined; | ||
| minVersionForCollab: MinDocumentRuntimeVersion | undefined; |
There was a problem hiding this comment.
I guess this minVersionForCollab is an arbitrary test property?
Maybe it could have a name that is neither minVersionForCollab nor minDocumentRuntimeVersion.
| * See {@link @fluidframework/container-runtime#LoadContainerRuntimeParams.minDocumentRuntimeVersion} for more details. | ||
| */ | ||
| readonly minVersionForCollab: MinimumVersionForCollab; | ||
| readonly minVersionForCollab: MinDocumentRuntimeVersion; |
| @@ -179,7 +179,7 @@ export interface CodecVersionBase< | |||
| * `undefined` should be used for unstable codec versions (with string FormatVersions), | |||
| * as well as previously stabilized formats that are discontinued (meaning we always prefer to use some other format for encoding). | |||
| */ | |||
| readonly minVersionForCollab: MinimumVersionForCollab | undefined; | |||
| readonly minVersionForCollab: MinDocumentRuntimeVersion | undefined; | |||
| * the data's format should be versioned and if they can't handle the format they should error. | ||
| */ | ||
| readonly minVersionForCollab: MinimumVersionForCollab; | ||
| readonly minVersionForCollab: MinDocumentRuntimeVersion; |
There was a problem hiding this comment.
Can this be renamed? How would it need staged?
| export function extractPersistedSchema( | ||
| schema: ImplicitFieldSchema, | ||
| minVersionForCollab: MinimumVersionForCollab, | ||
| minVersionForCollab: MinDocumentRuntimeVersion, |
| @@ -24,7 +24,7 @@ import type { ITree } from "@fluidframework/tree"; | |||
| * | |||
| * @deprecated Specify the minimum Fluid Framework version directly via the | |||
| * `minVersionForCollab` parameter, which accepts a | |||
There was a problem hiding this comment.
Update to minDocumentRuntimeVersion
| provideEntryPoint: mockProvideEntryPoint, | ||
| // @ts-expect-error - Invalid version strings are not castable to MinimumVersionForCollab | ||
| // @ts-expect-error - Invalid version strings are not castable to MinDocumentRuntimeVersion | ||
| minVersionForCollab: version, |
There was a problem hiding this comment.
This and many others above aren't renamed?
| readonly isReadOnly: () => boolean; | ||
| readonly minVersionForCollab: MinimumVersionForCollab; | ||
| readonly minVersionForCollab: MinDocumentRuntimeVersion; | ||
| } |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output |
Bundle size comparisonBase commit: Notable changes
Per-bundle deltas
|
Description
Adds
minDocumentRuntimeVersionas the preferred name for configuring the minimum Fluid runtime version required to open or process documents created or loaded by a container runtime.The existing
minVersionForCollabparameter remains supported as a deprecated compatibility alias for now, with removal planned for 3.0.0 as part of #27180. Callers should specify only one ofminDocumentRuntimeVersionorminVersionForCollab.This also makes
MinDocumentRuntimeVersionthe preferred exported type for new API surfaces. Existing APIs that referencedMinimumVersionForCollabhave been updated to referenceMinDocumentRuntimeVersion.MinimumVersionForCollabremains supported as a deprecated alias.Additional compatibility-related surfaces now use the preferred name where safe:
CodecWriteOptionsBetanow supportsminDocumentRuntimeVersionand keepsminVersionForCollabas a deprecated compatibility alias.minDocumentRuntimeVersionwhile keepingminVersionForCollabas a deprecated compatibility alias where needed.minDocumentRuntimeVersion.Persisted schema/wire-format fields intentionally remain named
minVersionForCollab