Commit Graph

45 Commits

Author SHA1 Message Date
Yanzhen Yu
c822e344a8 fix serializeNodeWithId args 2020-10-26 23:25:11 +08:00
Yanzhen Yu
0e63852bbc Release 0.9.8 2020-10-23 13:49:37 +08:00
Eoghan Murray
665567119d Suspend mutations during snapshot (#385)
* The `processMutations` function needed to be bound to the `mutationBuffer` object, as otherwise `this` referred to the `MutationObserver` object itself

* Enable external pausing of mutation buffer emissions

 - no automatic pausing based on e.g. pageVisibility yet, assuming such a thing is desirable
   https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
 - user code has to call new API method `freezePage` e.g. when page is hidden or after a timeout
 - automatically unpauses when the next user initiated event occurs
   (am assuming everything that isn't a mutation event counts as 'user initiated'
   either way think this is the correct thing to do until I see a counterexample
   of an event that shouldn't cause the mutations to be unbufferred)

* Avoid a build up of duplicate `adds` by delaying pushing to adds until emission time

* Need to export freezePage in order to use it from rrweb.min.js

* Add a test to check if mutations can be turned off with the `freezePage` method

* I noticed out of order ids (in terms of a DOM walk) in a FullSnapshot.  A DOM mutation was executed against the mirror asynchronously before it could be fully processed. This would lead to a situation in replay where a mutation is executed against a DOM tree that already has the mutation applied. This changeset fixes that by freezing any mutations until the snapshot is completed.

* Remove attribute modifications from a mutation event that were incorrect in that they were repeating the attributes of those nodes present in the 'adds' array of the same mutation

* I've manually verified that this empty text node is actually removed when the dropdown is opened:

document.getElementById('select2-results-1').childNodes
NodeList(2) [li.select2-results-dept-0.select2-result.select2-result-selectable.select2-highlighted, li.select2-results-dept-0.select2-result.select2-result-selectable]

and also that it is not reinstated after the second `await page.click('.select2-container');`

* Rearrange when removal happens in order to satisfy tests. I'm also reverting a recent test change (2600fe7) so that tests pass after this rearrangement; I believe that test change to still be the correct way of doing it, but maybe it is not strictly important that there are extra mutations on attributes of just added nodes

* As mutations are now paused during FullSnapshots, we shouldn't be counting this as a 'user emission'. We automatically emit mutations after unpause anyway ('emit anything queued up now')

* Ensure that we clear arrays before emitting, as the mutation could have the side effect of triggering a FullSnapshot (checkoutEveryNth), which would otherwise re-trigger emission of same mutation (through the new pause/fullsnapshot/mutationemit/unpause process)

* Don't let the programattic pausing during TakeFullSnapshot accidentally unpause a manual call to the API method `freezePage`

* Rename paused -> frozen for consistency and change to use getter/setter access methods
2020-10-04 20:54:10 +08:00
Yanzhen Yu
8065415de6 Release 0.9.6 2020-09-21 14:01:56 +08:00
Yanzhen Yu
c9391a9c92 Release 0.9.5 2020-09-20 14:16:29 +08:00
Yanzhen Yu
52e257627d Release 0.9.2 2020-09-07 22:02:27 +08:00
Yanzhen Yu
41690c755c close #330 implement more accurate finish event 2020-09-07 21:59:57 +08:00
Yanzhen Yu
0256bea4bc hide iframe before first meta event 2020-09-07 12:52:09 +08:00
Yanzhen Yu
c8094c33dc Release 0.9.1 2020-09-07 09:47:17 +08:00
Yanzhen Yu
5e9e1a2522 Release 0.9.0 2020-08-09 13:10:55 +08:00
Yanzhen Yu
a90999d96e close #274 implement the new state management proposal 2020-08-08 17:07:37 +08:00
Yanzhen Yu
6f08ec3ca7 add the patch function to utils 2020-07-18 16:56:22 +08:00
Eoghan Murray
286b520907 Restore functioning of #200 - this got broken after #242 (#246)
- What was broken was that it would just play activity from the first page view, but then would stop at the second page view (meta) as actions after that had been discarded
 - This restores the functionality given by the comment 'return the events from last meta to the end.' - we never want to discard events that are after the baseline time
 - I believe 'session' is the incorrect terminology for this function name, as a session in web analytics usually means a series of page views
2020-07-16 00:12:37 +08:00
Yanzhen Yu
c286c105dd update typings entry 2020-06-15 18:25:13 +08:00
Yanzhen Yu
4cf196718c export utils as public API 2020-06-15 17:10:18 +08:00
Yanzhen Yu
7feb2c945c update typescript to 3.9.5 2020-06-12 18:32:48 +08:00
Eoghan Murray
8766335c82 Move mutation processing into it's own class (#223)
* Move mutation processing into it's own object.

This should stand on it's own as a refactor, but is intended as a basis
for exposing the new MutationBuffer object to further outside control e.g.
to 'mute' or batch up mutation emission when the page becomes inactive
from a https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
point of view

* The `processMutations` function needed to be bound to the `mutationBuffer` object, as otherwise `this` referred to the `MutationObserver` object itself

* Neglected to add this output of `npm run typings`

* Get around the binding problem by using Arrow function expressions

* Prettier formatting
2020-06-06 18:33:58 +08:00
Yanzhen Yu
4811589816 Release 0.7.32 2020-04-11 18:36:07 +08:00
yz-yu
4f36d0e57d Packer (#172)
* introduce pako and add general packer interface

* add tests for packer

* use function API instead of class API for better tree shaking support

* refcatoring the rollup bundle config
2020-04-07 18:03:47 +08:00
Yanzhen Yu
18129bab70 Release 0.7.31 2020-04-05 22:04:46 +08:00
Yanzhen Yu
69094081ea Release 0.7.29 2020-02-28 19:52:06 +08:00
Yanzhen Yu
fa4b4299e7 Release 0.7.28 2020-02-26 09:58:36 +08:00
Yanzhen Yu
bf2142cb60 Release 0.7.27 2019-11-24 22:39:34 +08:00
yz-yu
b64e1492ab add hooks API (#132) 2019-09-17 23:33:38 +08:00
Yanzhen Yu
487165791a re-add addCustomEvent function via function property 2019-08-12 21:52:24 +08:00
Yanzhen Yu
3beb57273e Revert "temp revert #81"
This reverts commit 835161c737.
2019-08-12 21:26:35 +08:00
Yanzhen Yu
835161c737 temp revert #81
This patch introduce a breaking change in rrweb-record's API, so
we will revert it in 0.7.x and release it in 0.8.
2019-08-12 21:21:53 +08:00
Yanzhen Yu
d90e1671c1 Release 0.7.21 2019-08-11 14:41:23 +08:00
Yanzhen Yu
a95759fc9c hotfix throttle function args 2019-08-11 14:41:06 +08:00
Yanzhen Yu
dbcf03e415 Release 0.7.20 2019-08-10 17:32:24 +08:00
Yanzhen Yu
7f32fbdd05 Release 0.7.19 2019-08-04 14:53:42 +08:00
肉肉肉肉
b569b84794 new feature: add custom style in replayer (#87)
* new feature: add custom style in replayer

* concat style rules for loop
2019-07-10 12:33:54 +08:00
Yanzhen Yu
a255387230 Release 0.7.17 2019-06-22 23:03:49 +08:00
Sebastian Jakob
189df87b9d Option to mask inputs (#80)
* Option to mask inputs

Added option 'maskAllInputs' to replace all user inputs with an Asterisk.

* Update types.d.ts
2019-06-15 12:52:08 +08:00
Yanzhen Yu
d32b31f3e3 remove mitt typings namesapce 2019-06-05 17:33:20 +08:00
yz-yu
2398f5c0b1 start to support live mode (#73)
1. add a liveMode flag to config, when liveMode is set, the timer
will keep running even though all the actions casted
2. add a public method addEvent, which will cast newly added event
in sync
3. move mouse in sync mode with the latest position info
2019-05-26 16:02:52 +08:00
Yanzhen Yu
e8de7435eb Release 0.7.13 2019-05-12 21:10:52 +08:00
Yanzhen Yu
2d8d4b0c19 fix #62 accept RegExp type block class config 2019-04-14 16:11:54 +08:00
Yanzhen Yu
faed623986 resume with time offset when after wait stylesheet load 2019-04-09 17:00:02 +08:00
Yanzhen Yu
8e90801daf Release 0.7.10 2019-04-02 13:38:38 +08:00
Yanzhen Yu
d9ffe4c736 check attribute is null instead of any falsy value 2019-02-17 15:54:14 +08:00
Yanzhen Yu
65fd31487c Release 0.7.9 2019-02-08 09:09:23 +08:00
Yanzhen Yu
3ce4c76e60 Release 0.7.8 2019-01-25 18:26:16 +08:00
Yanzhen Yu
6abf4fd4a0 move all events to an enum and update guide 2019-01-25 17:18:51 +08:00
yz-yu
128deca040 update dependencies and generate typings (#44) 2019-01-21 19:54:21 +08:00