Skip to content

(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

Merged
merged 2 commits into from
Jun 11, 2025

Conversation

agarwal-navin
Copy link
Contributor

@agarwal-navin agarwal-navin commented Jun 6, 2025

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 in Shape -> countReferencedShapesAndIdentifiers - This makes it clear that this function counts any shapes and identifiers in the Shape 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.

@Copilot Copilot AI review requested due to automatic review settings June 6, 2025 21:18
@agarwal-navin agarwal-navin requested a review from a team as a code owner June 6, 2025 21:18
@github-actions github-actions bot added area: dds Issues related to distributed data structures area: dds: tree base: main PRs targeted against main branch labels Jun 6, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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 to encodeShapesAndIdentifiers
  • Renamed count methods to discoverReferencedShapesAndCount
  • Renamed callback parameter shapes to shapeDiscovered 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 for version, buffer, and identifierFilter, 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 like onShapeDiscovered to make its purpose clearer.
public discoverReferencedShapesAndCount(

@agarwal-navin agarwal-navin merged commit d993e57 into microsoft:main Jun 11, 2025
41 checks passed
@agarwal-navin agarwal-navin deleted the renameShapeEncoding branch June 11, 2025 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: dds: tree area: dds Issues related to distributed data structures base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants