diff --git a/.gitignore b/.gitignore index de1069e348..895e1115aa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,17 @@ -.vscode +.vscode/* +!/.vscode/rrweb-monorepo.code-workspace .idea node_modules package-lock.json # yarn.lock -build -dist -es -lib temp *.log + +.env + +.DS_Store + +build +dist diff --git a/.release-it.json b/.release-it.json index 72e1199133..41e16cf33f 100644 --- a/.release-it.json +++ b/.release-it.json @@ -1,9 +1,15 @@ { - "non-interactive": true, - "hooks": { - "before:init": ["npm run bundle", "npm run typings"] - }, + "hooks": {}, "git": { - "requireCleanWorkingDir": false + "commit": false, + "tag": false, + "push": false + }, + "npm": { + "publish": false + }, + "github": { + "release": true, + "releaseName": "Release ${version}" } } \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 52d6bad905..9d5753868e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,9 @@ language: node_js +os: linux + +dist: focal + node_js: - 12 @@ -7,4 +11,6 @@ install: - yarn script: - - xvfb-run --server-args="-screen 0 1920x1080x24" npm test + - yarn lerna run prepublish + - yarn lerna run check-types + - xvfb-run --server-args="-screen 0 1920x1080x24" yarn lerna run test diff --git a/.vscode/rrweb-monorepo.code-workspace b/.vscode/rrweb-monorepo.code-workspace new file mode 100644 index 0000000000..79849c8fe9 --- /dev/null +++ b/.vscode/rrweb-monorepo.code-workspace @@ -0,0 +1,31 @@ +{ + "folders": [ + { + "name": " rrweb monorepo", // added a space to bump it to the top + "path": ".." + }, + { + "name": "rrdom (package)", + "path": "../packages/rrdom" + }, + { + "name": "rrweb (package)", + "path": "../packages/rrweb" + }, + { + "name": "rrweb-player (package)", + "path": "../packages/rrweb-player" + }, + { + "name": "rrweb-snapshot (package)", + "path": "../packages/rrweb-snapshot" + } + ], + "settings": { + "jest.disabledWorkspaceFolders": [ + " rrweb monorepo", + "rrweb-player (package)", + "rrdom (package)" + ] + } +} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000..8521fa79c2 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,26 @@ +# Changelog + +## v1.0.0 + +### Featrues & Improvements + +- Support record same-origin non-sandboxed iframe. +- Support record open-mode shadow DOM. +- Implement the plugin API. +- Export `record.takeFullSnapshot` as a public API +- Record and replay drag events. +- Add options to mask texts (#540). + +### Fixes + +- Get the original MutationObserver when Angular patched it. +- Fix RangeError: Maximum call stack size exceeded (#479). +- Fix the linked-list implementation in the recorder. +- Don't perform newly added actions if the player is paused (#539). +- Fix inaccurate mouse position (#522) + +### Breaking Changes + +- Deprecated the usage of `rrweb.mirror`. Please use `record.mirror` and `replayer.getMirror()` instead. +- Deprecated the record option `recordLog `. See the new plugin API [here](./docs/recipes/console.md). +- Deprecated the replay option ` `. See the new plugin API [here](./docs/recipes/console.md). diff --git a/README.md b/README.md index c62942ed13..3e6490f17b 100644 --- a/README.md +++ b/README.md @@ -7,14 +7,13 @@ # rrweb -**[🚀 Try storyteller, a no-code interactive tutorial builder build with rrweb](https://storyteller.webzard.io/?utm_source=rrweb&utm_medium=github)** +**[The rrweb documentary (in Chinese, with English subtitles)](https://www.bilibili.com/video/BV1wL4y1B7wN?share_source=copy_web)** -**[The new adventure of the rrweb community](http://www.myriptide.com/rrweb-community/)** - -[![Build Status](https://travis-ci.org/rrweb-io/rrweb.svg?branch=master)](https://travis-ci.org/rrweb-io/rrweb) -[![Join the chat at https://gitter.im/rrweb-io/rrweb](https://badges.gitter.im/rrweb-io/rrweb.svg)](https://gitter.im/rrweb-io/rrweb?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Join the chat at slack](https://img.shields.io/badge/slack-@rrweb-teal.svg?logo=slack)](https://join.slack.com/t/rrweb/shared_invite/zt-siwoc6hx-uWay3s2wyG8t5GpZVb8rWg) +[![Twitter Follow](https://img.shields.io/badge/twitter-@rrweb__io-teal.svg?logo=twitter)](https://twitter.com/rrweb_io) ![total gzip size](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/rrweb@latest/dist/rrweb.min.js?compression=gzip&label=total%20gzip%20size) ![recorder gzip size](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/rrweb@latest/dist/record/rrweb-record.min.js?compression=gzip&label=recorder%20gzip%20size) +[![](https://data.jsdelivr.com/v1/package/npm/rrweb/badge)](https://www.jsdelivr.com/package/npm/rrweb) [中文文档](./README.zh_CN.md) @@ -22,36 +21,31 @@ rrweb refers to 'record and replay the web', which is a tool for recording and replaying users' interactions on the web. -**Currently, rrweb has already solved many difficult problems in recording and replaying, but the data structure may still be changed before the release of Version 1.0. So please be cautious to use rrweb in the production environment.** - ## Guide [**📚 Read the rrweb guide here. 📚**](./guide.md) -[**Recipes**](./docs/recipes/index.md) +[**🍳 Recipes 🍳**](./docs/recipes/index.md) ## Project Structure rrweb is mainly composed of 3 parts: -- **[rrweb-snapshot](https://github.com/rrweb-io/rrweb-snapshot)**, including both snapshot and rebuilding features. The snapshot is used to convert the DOM and its state into a serializable data structure with a unique identifier; the rebuilding feature is to rebuild the snapshot into corresponding DOM. +- **[rrweb-snapshot](https://github.com/rrweb-io/rrweb/tree/master/packages/rrweb-snapshot/)**, including both snapshot and rebuilding features. The snapshot is used to convert the DOM and its state into a serializable data structure with a unique identifier; the rebuilding feature is to rebuild the snapshot into corresponding DOM. - **[rrweb](https://github.com/rrweb-io/rrweb)**, including two functions, record and replay. The record function is used to record all the mutations in the DOM; the replay is to replay the recorded mutations one by one according to the corresponding timestamp. -- **[rrweb-player](https://github.com/rrweb-io/rrweb-player)**, is a player UI for rrweb, providing GUI-based functions like pause, fast-forward, drag and drop to play at any time. +- **[rrweb-player](https://github.com/rrweb-io/rrweb/tree/master/packages/rrweb-player/)**, is a player UI for rrweb, providing GUI-based functions like pause, fast-forward, drag and drop to play at any time. ## Roadmap -- rrweb - - handle cross-domain request errors - - record in web worker - - implement transmission data compression - - verify recording in mobile browser -- rrweb-player - - implement efficient progress bar drag and drop control - - add full screen mode -- extensions - - hijack the console API and record corresponding events - - hijack Ajax/fetch API and record request events - - use TraceKit to log exception events +- rrdom: an ad-hoc DOM for rrweb session data [#419](https://github.com/rrweb-io/rrweb/issues/419) +- storage engine: do deduplication on a large number of rrweb sessions +- more end-to-end tests +- compact mutation data in common patterns +- provide plugins via the new plugin API, including: + - XHR plugin + - fetch plugin + - GraphQL plugin + - ... ## Internal Design @@ -66,19 +60,101 @@ Since we want the record and replay sides to share a strongly typed data structu [Typescript handbook](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html) -1. Fork the rrweb component repository you want to patch. -2. Run `npm install` to install required dependencies. -3. Patch the code and pass all the tests. -4. Push the code and create a pull request. +1. Fork this repository. +2. Run `yarn install` in the root to install required dependencies for all sub-packages (note: `npm install` is _not_ recommended). +3. Run `yarn dev` in the root to get auto-building for all the sub-packages whenever you modify anything. +4. Navigate to one of the sub-packages (in the `packages` folder) where you'd like to make a change. +5. Patch the code and run `yarn test` to run the tests, make sure they pass before you commit anything. +6. Push the code and create a pull request. + +Protip: You can run `yarn test` in the root folder to run all the tests. In addition to adding integration tests and unit tests, rrweb also provides a REPL testing tool. [Using the REPL tool](./guide.md#REPL-tool) +## Core Team Members + +
+
+
+ Yuyz0112 + + |
+
+
+
+ Mark-Fenng + + |
+
+
+
+ eoghanmurray + + |
+
+
+
+ Juice10 + + |
+
- - - -
++ + + + | ++ + + + | ++ + + + | ++ + + + | +
+ + + + | ++ + + + | +
+
+
+ Yuyz0112 + + |
+
+
+
+ Mark-Fenng + + |
+
+
+
+ eoghanmurray + + |
+
+
+
+ Juice10 + + |
+
- - - -
++ + + + | ++ + + + | ++ + + + | +