Commit bb2e83e
* 🏗 [RUMF-902] introduce serializationUtils
This commit introduces a few utility functions to store and retrieve
serialized node ids stored in DOM nodes. The equivalent tools (`mirror`,
`INode`...) that are only used by the 'mutation' module are intentionally
left as-is, and will be removed in a future PR when we'll enable the new
mutation observer.
Before this commit, some 'observer' strategies didn't check if
`mirror.getId` returned a valid `id` before emitting a record. In
practice it shouldn't happen, but in unit tests it did happen because we
artificially emitted 'input' events on a DOM node that wasn't in the
document. This is why some tests were slightly adjusted to reflect the
reality more accurately.
* ⚗ [RUMF-902] implement a new mutation observer
* 🚩 [RUMF-902] use the new mutation observer via a FF
* 👌 apply some suggestions from code review
Co-authored-by: Bastien Caudan <bastien.caudan@datadoghq.com>
* rename utils.spec to serializationUtils.spec
* 👌 remove undefined properties when using existing nodes more thoroughly
* 👌 remove the "handleMutations" function
* 👌 make sure 'nodeIsIgnored' is only called with serialized nodes
* 👌 rename a few things in the mutationObserver.spec
* 👌 clarify some mutationObserver tests
* 👌 remove useless uses of [0] for unused snapshot results
* 👌 move and rename sortNodesByTopologicalOrder
* 👌 remove unneeded record.spec unit test
We chose to remove this test because its intent is a bit obscure and the
new mutation observer has a good enough test coverage. I kept the test
for the old mutation observer implementation since its coverage is still
lacking. It will be removed when we enable the new mutation observer.
* Update record spec test title
Co-authored-by: Bastien Caudan <bastien.caudan@datadoghq.com>
Co-authored-by: Bastien Caudan <bastien.caudan@datadoghq.com>
1 parent 270cff1 commit bb2e83e
File tree
18 files changed
+1274
-93
lines changed- packages/rum-recorder
- src
- boot
- domain
- rrweb-snapshot
- rrweb
- test
- test/e2e
- lib/framework
- scenario
18 files changed
+1274
-93
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
28 | 36 | | |
29 | 37 | | |
30 | 38 | | |
| |||
57 | 65 | | |
58 | 66 | | |
59 | 67 | | |
| 68 | + | |
60 | 69 | | |
61 | 70 | | |
62 | 71 | | |
| |||
85 | 94 | | |
86 | 95 | | |
87 | 96 | | |
88 | | - | |
89 | 97 | | |
90 | 98 | | |
91 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | | - | |
| 5 | + | |
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
98 | | - | |
| 99 | + | |
99 | 100 | | |
100 | 101 | | |
101 | | - | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| |||
Lines changed: 18 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | | - | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
288 | 287 | | |
289 | 288 | | |
290 | 289 | | |
291 | | - | |
| 290 | + | |
292 | 291 | | |
293 | 292 | | |
294 | 293 | | |
| |||
369 | 368 | | |
370 | 369 | | |
371 | 370 | | |
372 | | - | |
| 371 | + | |
373 | 372 | | |
374 | 373 | | |
375 | | - | |
| 374 | + | |
376 | 375 | | |
377 | 376 | | |
378 | 377 | | |
379 | 378 | | |
380 | 379 | | |
381 | 380 | | |
382 | 381 | | |
383 | | - | |
384 | | - | |
| 382 | + | |
| 383 | + | |
385 | 384 | | |
386 | | - | |
| 385 | + | |
387 | 386 | | |
388 | | - | |
389 | | - | |
390 | | - | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
391 | 390 | | |
392 | | - | |
| 391 | + | |
393 | 392 | | |
394 | 393 | | |
395 | 394 | | |
396 | | - | |
397 | | - | |
398 | | - | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
410 | | - | |
411 | | - | |
| 410 | + | |
| 411 | + | |
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
| |||
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
428 | | - | |
| 428 | + | |
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
3 | 10 | | |
4 | 11 | | |
5 | 12 | | |
| |||
9 | 16 | | |
10 | 17 | | |
11 | 18 | | |
12 | | - | |
| 19 | + | |
13 | 20 | | |
14 | 21 | | |
15 | 22 | | |
| |||
184 | 191 | | |
185 | 192 | | |
186 | 193 | | |
187 | | - | |
188 | | - | |
| 194 | + | |
| 195 | + | |
189 | 196 | | |
190 | 197 | | |
191 | 198 | | |
| |||
308 | 315 | | |
309 | 316 | | |
310 | 317 | | |
311 | | - | |
| 318 | + | |
312 | 319 | | |
313 | 320 | | |
314 | 321 | | |
| |||
344 | 351 | | |
345 | 352 | | |
346 | 353 | | |
347 | | - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
348 | 359 | | |
349 | 360 | | |
350 | 361 | | |
| |||
388 | 399 | | |
389 | 400 | | |
390 | 401 | | |
391 | | - | |
| 402 | + | |
392 | 403 | | |
393 | 404 | | |
394 | 405 | | |
| |||
0 commit comments