tldraw/packages
Steve Ruiz 72ae8ddefd
Don't double squash (#3182)
This PR changes the way `Store.squashHistoryEntries` works. Previously,
the function would iterate through every entry and squash it against the
current entry (using `squashRecordDiffs`) to get the new current entry.
However, `squashRecordDiffs` does basically the same pattern, iterating
through the properties of every diff. As a result, each diff would be
iterated through twice: once as itself, and once again in the next
current.

This PR tweaks the function to operate on as many diffs as possible at
once.

### Change Type

<!--  Please select a 'Scope' label ️ -->

- [x] `sdk` — Changes the tldraw SDK
- [ ] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [ ] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [x] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know


### Test Plan

- [x] Unit Tests
- [ ] End to end tests

### Release Notes

- Minor improvement when modifying multiple shapes at once.
2024-03-20 12:44:09 +00:00
..
assets Update CHANGELOG.md [skip ci] 2024-02-29 18:28:45 +00:00
editor Add image annotator example (#3147) 2024-03-19 11:41:25 +00:00
namespaced-tldraw use native structuredClone on node, cloudflare workers, and in tests (#3166) 2024-03-18 17:16:09 +00:00
state [perf] Reinstate render throttling (#3160) 2024-03-15 16:18:23 +00:00
store Don't double squash (#3182) 2024-03-20 12:44:09 +00:00
tldraw Add image annotator example (#3147) 2024-03-19 11:41:25 +00:00
tlschema use native structuredClone on node, cloudflare workers, and in tests (#3166) 2024-03-18 17:16:09 +00:00
tlsync use native structuredClone on node, cloudflare workers, and in tests (#3166) 2024-03-18 17:16:09 +00:00
utils use native structuredClone on node, cloudflare workers, and in tests (#3166) 2024-03-18 17:16:09 +00:00
validate use native structuredClone on node, cloudflare workers, and in tests (#3166) 2024-03-18 17:16:09 +00:00