Commit Graph

1197 Commits

Author SHA1 Message Date
Yanzhen Yu
adffe1e9ad bump 0.6.0 2026-04-01 12:00:00 +08:00
Yanzhen Yu
632c6de677 update test command 2026-04-01 12:00:00 +08:00
Yanzhen Yu
fdcf1d0bb2 update dependencies
In this commit, we updated rrweb-snapshot to 0.6.0 which including
a breaking change in data structure.
2026-04-01 12:00:00 +08:00
Yanzhen Yu
8567114688 fix file link 2026-04-01 12:00:00 +08:00
Yanzhen Yu
824e165ede add internal design docs 2026-04-01 12:00:00 +08:00
Yanzhen Yu
68daa2d029 prevent form and a tag default behaviour 2026-04-01 12:00:00 +08:00
Yanzhen Yu
500f89b1d0 add a repl mode for quick test 2026-04-01 12:00:00 +08:00
Yanzhen Yu
430e84811a add chinese README 2026-04-01 12:00:00 +08:00
Yanzhen Yu
cbe80dbd2e also resolve missing previous node 2026-04-01 12:00:00 +08:00
Yanzhen Yu
00df74fd3f bump 0.5.1 2026-04-01 12:00:00 +08:00
Yanzhen Yu
b7bf5f5fe3 Fix add node logic with missingNextNodeMap
This patch include a breaking change to the recorder's event data.

We used to consider mirror.getId will always return the id of the
target node because we keep serialize every node. But if we call
mirror.getId before serialization then bug happened. This could
happen when we get nextId of newly added nodes if its next sibling
was also newly added.
So we have to return -1 as the id of node which was not serialized
and when we building added nodes in the replayer we should handle
this.

For example, nodes el1, el2 were added together and el1's nextId
will be -1 since el2 was not serialized at that moment. Now we
call el1 as a 'missing next node' and not append it into the DOM
tree after building, instead we store it in a missingNextNodeMap.
After a added node in the same mutation was successfully appened
we will check whether it has a previous id and the id was pointed
to some nodes in the map, if so, we will insert that node before
it and delete the node from map.
2026-04-01 12:00:00 +08:00
Yanzhen Yu
4c0ced2ba1 fix the add node condition 2026-04-01 12:00:00 +08:00
Yanzhen Yu
d3948d982e temp hack the integration test cases 2026-04-01 12:00:00 +08:00
Yanzhen Yu
d5b89558e1 fix order of continuous append 2026-04-01 12:00:00 +08:00
Yanzhen Yu
7c04836709 add travis build 2026-04-01 12:00:00 +08:00
Yanzhen Yu
729f8e8453 bump 0.5.0 2026-04-01 12:00:00 +08:00
Yanzhen Yu
7a57784daf Implement #2: simulate hover event 2026-04-01 12:00:00 +08:00
Yanzhen Yu
4e0c401583 add select2.html snapshot test 2026-04-01 12:00:00 +08:00
Yanzhen Yu
97ed5eb229 implement pause which has a better performance than play at some time offset 2026-04-01 12:00:00 +08:00
Yanzhen Yu
47467ff692 bump 0.4.3 2026-04-01 12:00:00 +08:00
Yanzhen Yu
c18626bf5a fix mutation filter in recorder and change the order of apply mutations in replayer
This change include two critical fix for both recorder and replayer.

In the recorder, previously we filter text and attribute mutations by check its target id,
but this was a wrong approach because removed node also has id at the callback moment.
We corrected this by checking whether the mirror map still has the target id in its keys.

In the replayer side, the issue was we got exceptions when calling insertBefore which says
the ref node was not the child node of the caller node. This will happen when the previous
or next sibling has been removed in the same callback but the previousId or nextId was
recorded.
After apply remove node mutations before add node mutations, we can make sure the removed
siblings will not exist in the mirror map when apply add node mutations. When we get node
from mirror map with an removed id, we will get null and pass it to insertBefore which
is valid.
As a side note, this apply order is safe because we ensured all the remove node mutations
do not include removing newly added nodes in the same callback.
2026-04-01 12:00:00 +08:00
Yanzhen Yu
609f51a26a add a has method to mirror for checking whether an id is in the map 2026-04-01 12:00:00 +08:00
Yanzhen Yu
6ce32f7994 filter text and attributes mutations which target tot a removed node 2026-04-01 12:00:00 +08:00
Yanzhen Yu
7c35cb2f49 check added nodes from removed nodes and dropped nodes 2026-04-01 12:00:00 +08:00
Yanzhen Yu
aa3e2f02ed rewrite mutation observer handler with lazy child list calculation 2026-04-01 12:00:00 +08:00
Yanzhen Yu
487f1d0c9a add meta event and fix childList observer, also update related replayer 2026-04-01 12:00:00 +08:00
Yanzhen Yu
cd0889e9c5 implemented the play any offset feature 2026-04-01 12:00:00 +08:00
Yanzhen Yu
eb56afa59f export more props of replayer to the UI 2026-04-01 12:00:00 +08:00
Yanzhen Yu
f75748674f impl dynamic config and pause. Bump 0.3.0 2026-04-01 12:00:00 +08:00
Yanzhen Yu
e040ae76c5 align id map by skip extra added nodes 2026-04-01 12:00:00 +08:00
Yanzhen Yu
c9bb0e6557 update id map when DOM changed and handle element scroll event 2026-04-01 12:00:00 +08:00
Yanzhen Yu
a90198ee46 update rollup config so we can benefit from tree shaking 2026-04-01 12:00:00 +08:00
Yanzhen Yu
5bbc29ef1a add test infra and a basic record integration test 2026-04-01 12:00:00 +08:00
Yanzhen Yu
f4ded6b6d1 impl replay the mutations and mouse interactions 2026-04-01 12:00:00 +08:00
Yanzhen Yu
f7e4a90751 apply viewport resize and input event changes 2026-04-01 12:00:00 +08:00
Yanzhen Yu
499d84fc70 use raf to impl a more accurate timer and replay events async 2026-04-01 12:00:00 +08:00
Yanzhen Yu
9fda4c0809 import snapshot rebuilder into replayer 2026-04-01 12:00:00 +08:00
Yanzhen Yu
4446e27899 fix scroll value and record viewport when loaded 2026-04-01 12:00:00 +08:00
Yanzhen Yu
41b9861fbf improve record method and bump 0.2.0 2026-04-01 12:00:00 +08:00
Yanzhen Yu
789cae98a1 update bundle configs 2026-04-01 12:00:00 +08:00
Yanzhen Yu
c96052d8a4 add input event observer and hook the value setter 2026-04-01 12:00:00 +08:00
Yanzhen Yu
ad2ac811a3 serialize newly added nodes and update id node map when childList changed 2026-04-01 12:00:00 +08:00
Yanzhen Yu
ee4fc3ce7e add scroll and viewport resize observers 2026-04-01 12:00:00 +08:00
Yanzhen Yu
7078ce2f2a add mouse interactions observer 2026-04-01 12:00:00 +08:00
Yanzhen Yu
61312a0ad0 add mouse movement observer 2026-04-01 12:00:00 +08:00
Yanzhen Yu
d2175eae87 change observed mutations into serializable records 2026-04-01 12:00:00 +08:00
Yanzhen Yu
e2fbecea96 init the repo and integrate rrweb-snapshot 2026-04-01 12:00:00 +08:00