Port FieldBatchCodec and ForestCodec to ClientVersionDispatchingCodecBuilder#26534
Open
CraigMacomber wants to merge 5 commits intomicrosoft:mainfrom
Open
Port FieldBatchCodec and ForestCodec to ClientVersionDispatchingCodecBuilder#26534CraigMacomber wants to merge 5 commits intomicrosoft:mainfrom
CraigMacomber wants to merge 5 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the FieldBatchCodec and ForestCodec implementations from the older makeVersionedValidatedCodec pattern to use the newer ClientVersionDispatchingCodecBuilder pattern. This modernizes the codec infrastructure and provides better type safety and consistency with other codecs in the codebase.
Changes:
- Replaced
makeFieldBatchCodecfunction withfieldBatchCodecBuilderconstant usingClientVersionDispatchingCodecBuilder - Replaced
makeForestSummarizerCodecfunction withforestCodecBuilderconstant usingClientVersionDispatchingCodecBuilder - Updated all usage sites to call
.build()on the codec builders instead of calling factory functions - Updated error message regex patterns in tests to match the new JSON array format for version lists
- Changed
EncodedFieldBatchexport from value export to type-only export - Added type narrowing assertions in tests where codec return types became more generic
- Added type cast in
treeAlpha.tsdue to loss of specific return type information
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/dds/tree/src/feature-libraries/chunked-forest/codec/codecs.ts | Refactored to use ClientVersionDispatchingCodecBuilder pattern, extracting codec logic into helper function |
| packages/dds/tree/src/feature-libraries/chunked-forest/codec/index.ts | Changed EncodedFieldBatch export to type-only and replaced function export with builder |
| packages/dds/tree/src/feature-libraries/chunked-forest/index.ts | Updated exports to use fieldBatchCodecBuilder |
| packages/dds/tree/src/feature-libraries/forest-summary/codec.ts | Complete refactor to use ClientVersionDispatchingCodecBuilder with ForestCodecOptions interface |
| packages/dds/tree/src/feature-libraries/forest-summary/index.ts | Updated exports to use forestCodecBuilder |
| packages/dds/tree/src/feature-libraries/forest-summary/forestSummarizer.ts | Updated to call forestCodecBuilder.build() |
| packages/dds/tree/src/feature-libraries/index.ts | Updated public API exports |
| packages/dds/tree/src/shared-tree/*.ts | Updated usage sites to call .build() on codec builders |
| packages/dds/tree/src/test/**/*.spec.ts | Updated tests to use new builder pattern and adjusted error message assertions |
packages/dds/tree/src/feature-libraries/forest-summary/codec.ts
Outdated
Show resolved
Hide resolved
Josmithr
reviewed
Feb 25, 2026
packages/dds/tree/src/feature-libraries/forest-summary/codec.ts
Outdated
Show resolved
Hide resolved
Josmithr
reviewed
Feb 25, 2026
packages/dds/tree/src/feature-libraries/forest-summary/codec.ts
Outdated
Show resolved
Hide resolved
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Port FieldBatchCodec and ForestCodec to ClientVersionDispatchingCodecBuilder.
Reviewer Guidance
The review process is outlined on this wiki page.