-
Notifications
You must be signed in to change notification settings - Fork 549
(tree) Renamed some shape encoding entities in chunked forest #24777
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
(tree) Renamed some shape encoding entities in chunked forest #24777
Conversation
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.
Pull Request Overview
This PR improves clarity by renaming key functions and parameters related to shape encoding in the chunked-forest codec.
- Renamed
handleShapesAndIdentifiers
toencodeShapesAndIdentifiers
- Renamed
count
methods todiscoverReferencedShapesAndCount
- Renamed callback parameter
shapes
toshapeDiscovered
to clarify its role
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/dds/tree/src/test/.../nodeShape.spec.ts | Updated tests to call discoverReferencedShapesAndCount |
packages/dds/tree/src/test/.../compressedEncode.spec.ts | Updated tests to import/use encodeShapesAndIdentifiers |
packages/dds/tree/src/test/.../chunkEncodingGeneric.spec.ts | Renamed test references from handleShapesAndIdentifiers |
packages/dds/tree/src/test/.../checkEncode.ts | Updated cloning comments and calls to use encodeShapesAndIdentifiers |
packages/dds/tree/src/feature-libraries/chunked-forest/codec/nodeShape.ts | Renamed NodeShape method and its callback parameter |
packages/dds/tree/src/feature-libraries/chunked-forest/codec/compressedEncode.ts | Updated calls and class methods to the new names |
packages/dds/tree/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts | Renamed and refactored traversal variables and function signature |
Comments suppressed due to low confidence (2)
packages/dds/tree/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts:52
- The public
encodeShapesAndIdentifiers
function would benefit from explicit JSDoc@param
tags forversion
,buffer
, andidentifierFilter
, as well as a@returns
tag to improve API discoverability.
export function encodeShapesAndIdentifiers<TEncodedShape>(
packages/dds/tree/src/feature-libraries/chunked-forest/codec/nodeShape.ts:124
- [nitpick] The callback parameter
shapeDiscovered
could be renamed to a more conventional event-style name likeonShapeDiscovered
to make its purpose clearer.
public discoverReferencedShapesAndCount(
Renamed the following related to shape encoding in chunked forest:
handleShapesAndIdentifiers
->updateShapesAndIdentifiersEncoding
- This makes it explicit that the function update the encoding of shapes and identifiers in the passed buffer.count
inShape
->countReferencedShapesAndIdentifiers
- This makes it clear that this function counts any shapes and identifiers in theShape
and counts them.shapes
paramater in the above function ->shapeDiscovered
- This makes it explicit that this is a callback which should be called whenever a shape is discovered.