Commit 8ac4951
authored
fix the diffing (tldraw#7108)
doing fine grained diffs on the tip tap documents was no bueno
### Change type
- [x] `other`
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Treat `props` and `meta` as nested patches, while defaulting
non-string/non-array object fields to full `put` when changed; update
diffing internals accordingly.
>
> - **Diffing behavior**:
> - Treat `props` and `meta` as nested keys for patching via
`diffObject`.
> - For other object fields, emit `put` when changed unless values are
arrays or strings (which still diff/append).
> - Maintain fine-grained handling for arrays (`diffArray`) and strings
(append optimization).
> - **API/Internal changes**:
> - `diffRecord` now calls `diffObject(prev, next, new
Set(['props','meta']), legacyAppendMode)`.
> - `diffObject` signature includes `nestedKeys` and uses shallow
equality to choose between nested `diffValue` vs `put`.
> - Recursive calls to `diffObject` pass `undefined` for `nestedKeys` to
limit deep nesting.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
8329710. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 7bf7adf commit 8ac4951
1 file changed
Lines changed: 23 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
194 | 199 | | |
195 | 200 | | |
196 | 201 | | |
| |||
202 | 207 | | |
203 | 208 | | |
204 | 209 | | |
205 | | - | |
206 | | - | |
207 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
208 | 224 | | |
209 | | - | |
| 225 | + | |
210 | 226 | | |
211 | 227 | | |
212 | 228 | | |
| |||
232 | 248 | | |
233 | 249 | | |
234 | 250 | | |
235 | | - | |
| 251 | + | |
236 | 252 | | |
237 | 253 | | |
238 | 254 | | |
| |||
0 commit comments