Skip to content

Add splice method to TreeArrayNode#26740

Open
brrichards wants to merge 6 commits intomicrosoft:mainfrom
brrichards:new-array-splice
Open

Add splice method to TreeArrayNode#26740
brrichards wants to merge 6 commits intomicrosoft:mainfrom
brrichards:new-array-splice

Conversation

@brrichards
Copy link
Contributor

Summary

Adds splice method to TreeArrayNode that follows Array.prototype.splice semantics. Supports removing and inserting items in a single opertaion, with optional deleteCount and negative start indices. Wraps remove + insert in a transaction for hydrated nodes to enable atomic undo/redo.

@brrichards brrichards requested review from a team as code owners March 16, 2026 17:56
Copilot AI review requested due to automatic review settings March 16, 2026 17:56
Copy link
Contributor

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

Adds a new splice API to TreeArrayNode to support combined remove/insert operations with Array.prototype.splice-like behavior, including negative start indices and optional deleteCount, and updates the public API surface accordingly.

Changes:

  • Adds TreeArrayNode.splice to the public interface and implements it in arrayNode.ts (wrapping hydrated edits in a transaction).
  • Adds unit tests covering several splice scenarios.
  • Updates API reports and adds a changeset entry documenting the new API.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/dds/tree/src/test/simple-tree/node-kinds/arrayNode.spec.ts Adds new splice test cases for array nodes
packages/dds/tree/src/simple-tree/node-kinds/array/arrayNode.ts Adds splice to the interface and implements the method
packages/dds/tree/api-report/tree.public.api.md Updates public API report to include splice
packages/dds/tree/api-report/tree.legacy.public.api.md Updates legacy public API report to include splice
packages/dds/tree/api-report/tree.legacy.beta.api.md Updates legacy beta API report to include splice
packages/dds/tree/api-report/tree.beta.api.md Updates beta API report to include splice
packages/dds/tree/api-report/tree.alpha.api.md Updates alpha API report to include splice
.changeset/plain-tires-melt.md Adds a minor changeset describing the new splice method and usage

@github-actions
Copy link
Contributor

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output


> fluid-framework-docs-site@0.0.0 ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> fluid-framework-docs-site@0.0.0 serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> fluid-framework-docs-site@0.0.0 check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

Crawling...

Stats:
  257792 links
    1822 destination URLs
    2063 URLs ignored
       0 warnings
       0 errors


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants