FluidFramework
FluidFramework copied to clipboard
tree: Allow removeRange() on empty array node
Description
Before this change calling node.removeRange() on an empty array node would throw.
More generally removing any empty range at the end of the array would throw due to the start equaling the length.
This seems inconsistent and has been changed to allow this case (which is a no-op, just like other empty range removals).
Errors due to invalid input into removeRange now throw UsageErrros not asserts.
This change also makes it easier for simple-tree tests to check for usage errors.
This also starts a refactor to FlexTreeSequenceField to avoid requiring an extra intermediate flex tree API between SequenceFieldEditBuilder and ArrayNode for edits. This continues our trend toward reducing complexity in flex-tree which does not add value given the existing of the new package public (simple-tree) api.
Breaking Changes
ArrayNode.removeRange no longer throws when the start equals the length.
Reviewer Guidance
The review process is outlined on this wiki page.
Could not find a usable baseline build with search starting at CI 627baa91926cc6983f645d62e492dadc8ba2313e
Generated by :no_entry_sign: dangerJS against f9f79b3fb353957c4c8c35dce73158447ccc2c07