Collapse multiple text mutations when frozen / throttled - #1933
Open
eoghanmurray wants to merge 13 commits into
Open
eoghanmurray wants to merge 13 commits into
eoghanmurray wants to merge 13 commits into
Conversation
🦋 Changeset detectedLatest commit: c7d2802 The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
eoghanmurray
force-pushed
the
collapse-frozen-mutations
branch
from
September 8, 2026 12:04
ce9ff62 to
179b3f9
Compare
Contributor
Bundle Size ChangesSize change: +1.42 kB (+0.01%) | Total size: 10430.46 kB
|
| File | Base | PR | Diff |
|---|---|---|---|
all.cjs |
567.91 kB | 568.03 kB | +121 B (+0.02%) |
all.js |
567.58 kB | 567.70 kB | +121 B (+0.02%) |
all.umd.cjs |
571.12 kB | 571.24 kB | +121 B (+0.02%) |
all.umd.min.cjs |
269.12 kB | 269.12 kB | +1 B (+0.00%) |
browser-client - 670.07 kB -> 670.42 kB (+364 B (+0.05%))
| File | Base | PR | Diff |
|---|---|---|---|
browser-client.cjs |
192.15 kB | 192.26 kB | +121 B (+0.06%) |
browser-client.js |
191.92 kB | 192.04 kB | +121 B (+0.06%) |
browser-client.umd.cjs |
194.97 kB | 195.09 kB | +121 B (+0.06%) |
browser-client.umd.min.cjs |
91.03 kB | 91.03 kB | +1 B (+0.00%) |
record - 552.68 kB -> 553.04 kB (+364 B (+0.06%))
| File | Base | PR | Diff |
|---|---|---|---|
record.cjs |
158.46 kB | 158.58 kB | +121 B (+0.07%) |
record.js |
158.38 kB | 158.49 kB | +121 B (+0.07%) |
record.umd.cjs |
159.79 kB | 159.91 kB | +121 B (+0.07%) |
record.umd.min.cjs |
76.05 kB | 76.06 kB | +1 B (+0.00%) |
rrweb - 1913.90 kB -> 1914.26 kB (+364 B (+0.02%))
| File | Base | PR | Diff |
|---|---|---|---|
rrweb.cjs |
551.07 kB | 551.19 kB | +121 B (+0.02%) |
rrweb.js |
550.77 kB | 550.89 kB | +121 B (+0.02%) |
rrweb.umd.cjs |
552.29 kB | 552.41 kB | +121 B (+0.02%) |
rrweb.umd.min.cjs |
259.77 kB | 259.78 kB | +1 B (+0.00%) |
eoghanmurray
force-pushed
the
collapse-frozen-mutations
branch
from
September 9, 2026 11:50
a8e5ab7 to
365f778
Compare
@rrweb/all
@rrweb/browser-client
@rrweb/packer
@rrweb/record
@rrweb/replay
rrdom
rrdom-nodejs
rrvideo
rrweb
rrweb-player
rrweb-snapshot
@rrweb/types
@rrweb/utils
@rrweb/rrweb-plugin-canvas-webrtc-record
@rrweb/rrweb-plugin-canvas-webrtc-replay
@rrweb/rrweb-plugin-console-record
@rrweb/rrweb-plugin-console-replay
@rrweb/rrweb-plugin-network-record
@rrweb/rrweb-plugin-network-replay
@rrweb/rrweb-plugin-sequential-id-record
@rrweb/rrweb-plugin-sequential-id-replay
commit: |
…mutations are frozen
…on that this PR fixes; the text is only set to 'yellow' in the test once
…e e.g. style attribute diffs over and over while frozen or during throttling - this mirrors the other pattern from this PR for text mutations - more importantly, the serialization of new 'add' nodes has always happened upon emission, so the deferred computation is by design (no point in serializing something that may have been added then quickly removed)
…`sampling.mutation` ms setting - can prevent overly frequent (javascript based) animation per second on the same attribute; the mutation buffer will emit a single change at the end if throttled changes are against the same element
…default in rrweb package; useful for experimenting with live-stream in worktrees where there's been no previous build
… attributes/textContent on a per-element basis rather than globally (so a noisy element can't delay a well behaved one)
eoghanmurray
force-pushed
the
collapse-frozen-mutations
branch
from
September 21, 2026 22:00
365f778 to
49c6e6c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR does two things:
Replay should be unaffected, as the replayer would have applied the last mutation in the series, which should end up in the same state at that timestamp. The test data shows some de-duplication of text/attributes after this change, which is proof positive.
Tech note:
WeakMapadded in perf(rrweb): attribute mutation optimization #1343 in relation toattributes/attributeMapcan be improved by replacing both variables with a singleMap. The array was holding strong references to the Node anyway in the attributeCursor; these were freed at the end after// resetand this is still the case after this change