Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ Use browser ESM assets from a CDN:
href="https://cdn.rrweb.com/replay/current/dist/style.css"
/>
<script type="module">
import { record } from 'https://cdn.rrweb.com/record/current/dist/record.js';
import { Replayer } from 'https://cdn.rrweb.com/replay/current/dist/replay.js';
import { record } from 'https://cdn.rrweb.com/record/current/dist/record.min.js';
import { Replayer } from 'https://cdn.rrweb.com/replay/current/dist/replay.min.js';

record({
emit(event) {
Expand All @@ -61,9 +61,10 @@ Use browser ESM assets from a CDN:
```

Use `current` for the latest stable release, or pin an exact version such as
`https://cdn.rrweb.com/record/2.0.0/dist/record.js` and
`https://cdn.rrweb.com/replay/2.0.0/dist/replay.js` for immutable
production URLs.
`https://cdn.rrweb.com/record/2.0.0/dist/record.min.js` and
`https://cdn.rrweb.com/replay/2.0.0/dist/replay.min.js` for immutable
production URLs. Use `.min.js` for production; the unminified `.js` sibling
remains useful for debugging.

`rrweb-player` is also available as a browser ESM asset:

Expand All @@ -73,7 +74,7 @@ production URLs.
href="https://cdn.rrweb.com/rrweb-player/current/style.css"
/>
<script type="module">
import rrwebPlayer from 'https://cdn.rrweb.com/rrweb-player/current/rrweb-player.js';
import rrwebPlayer from 'https://cdn.rrweb.com/rrweb-player/current/rrweb-player.min.js';
</script>
```

Expand Down Expand Up @@ -329,7 +330,7 @@ the CDN:
href="https://cdn.rrweb.com/replay/current/dist/style.css"
/>
<script type="module">
import { Replayer } from 'https://cdn.rrweb.com/replay/current/dist/replay.js';
import { Replayer } from 'https://cdn.rrweb.com/replay/current/dist/replay.min.js';

const events = YOUR_EVENTS;

Expand All @@ -338,6 +339,9 @@ the CDN:
</script>
```

Use `.min.js` for production; switch to the unminified `.js` sibling when
debugging.

#### Control the replayer by API

```js
Expand Down Expand Up @@ -410,10 +414,13 @@ Browser without bundler (ESM):
href="https://cdn.rrweb.com/rrweb-player/current/style.css"
/>
<script type="module">
import rrwebPlayer from 'https://cdn.rrweb.com/rrweb-player/current/rrweb-player.js';
import rrwebPlayer from 'https://cdn.rrweb.com/rrweb-player/current/rrweb-player.min.js';
</script>
```

Use `.min.js` for production; switch to the unminified `.js` sibling when
debugging.

Legacy direct `<script>` include (UMD fallback):

```html
Expand Down
19 changes: 12 additions & 7 deletions guide.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ import '@rrweb/all/dist/style.css';
href="https://cdn.rrweb.com/replay/current/dist/style.css"
/>
<script type="module">
import { record } from 'https://cdn.rrweb.com/record/current/dist/record.js';
import { Replayer } from 'https://cdn.rrweb.com/replay/current/dist/replay.js';
import { record } from 'https://cdn.rrweb.com/record/current/dist/record.min.js';
import { Replayer } from 'https://cdn.rrweb.com/replay/current/dist/replay.min.js';

record({
emit(event) {
Expand All @@ -59,8 +59,9 @@ import '@rrweb/all/dist/style.css';
```

`current` 指向最新稳定版本;生产环境也可以固定到不可变的精确版本,例如
`https://cdn.rrweb.com/record/2.0.0/dist/record.js` 和
`https://cdn.rrweb.com/replay/2.0.0/dist/replay.js`。
`https://cdn.rrweb.com/record/2.0.0/dist/record.min.js` 和
`https://cdn.rrweb.com/replay/2.0.0/dist/replay.min.js`。生产环境请使用 `.min.js`;
未压缩的 `.js` 同级文件仍适合调试。

`rrweb-player` 也提供浏览器 ESM 资源:

Expand All @@ -70,7 +71,7 @@ import '@rrweb/all/dist/style.css';
href="https://cdn.rrweb.com/rrweb-player/current/style.css"
/>
<script type="module">
import rrwebPlayer from 'https://cdn.rrweb.com/rrweb-player/current/rrweb-player.js';
import rrwebPlayer from 'https://cdn.rrweb.com/rrweb-player/current/rrweb-player.min.js';
</script>
```

Expand Down Expand Up @@ -323,7 +324,7 @@ import '@rrweb/replay/dist/style.css';
href="https://cdn.rrweb.com/replay/current/dist/style.css"
/>
<script type="module">
import { Replayer } from 'https://cdn.rrweb.com/replay/current/dist/replay.js';
import { Replayer } from 'https://cdn.rrweb.com/replay/current/dist/replay.min.js';

const events = YOUR_EVENTS;

Expand All @@ -332,6 +333,8 @@ import '@rrweb/replay/dist/style.css';
</script>
```

生产环境请使用 `.min.js`;调试时可改用未压缩的 `.js` 同级文件。

#### 使用 API 控制回放

```js
Expand Down Expand Up @@ -402,10 +405,12 @@ import 'rrweb-player/dist/style.css';
href="https://cdn.rrweb.com/rrweb-player/current/style.css"
/>
<script type="module">
import rrwebPlayer from 'https://cdn.rrweb.com/rrweb-player/current/rrweb-player.js';
import rrwebPlayer from 'https://cdn.rrweb.com/rrweb-player/current/rrweb-player.min.js';
</script>
```

生产环境请使用 `.min.js`;调试时可改用未压缩的 `.js` 同级文件。

Legacy 直接 `<script>` 引入(UMD 兼容):

```html
Expand Down
7 changes: 4 additions & 3 deletions packages/record/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ browser:

```html
<script type="module">
import { record } from 'https://cdn.rrweb.com/record/current/dist/record.js';
import { record } from 'https://cdn.rrweb.com/record/current/dist/record.min.js';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file doesn't currently exist

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

</script>
```

Use `current` for the latest stable release, or pin an exact version such as
`https://cdn.rrweb.com/record/2.0.0/dist/record.js` for immutable
production URLs.
`https://cdn.rrweb.com/record/2.0.0/dist/record.min.js` for immutable
production URLs. Use `.min.js` for production; the unminified `.js` sibling
remains useful for debugging.

### 3) Legacy Direct `<script>` Include (UMD fallback)

Expand Down
7 changes: 4 additions & 3 deletions packages/replay/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ browser:
href="https://cdn.rrweb.com/replay/current/dist/style.css"
/>
<script type="module">
import { Replayer } from 'https://cdn.rrweb.com/replay/current/dist/replay.js';
import { Replayer } from 'https://cdn.rrweb.com/replay/current/dist/replay.min.js';
</script>
```

Use `current` for the latest stable release, or pin an exact version such as
`https://cdn.rrweb.com/replay/2.0.0/dist/replay.js` for immutable
production URLs.
`https://cdn.rrweb.com/replay/2.0.0/dist/replay.min.js` for immutable
production URLs. Use `.min.js` for production; the unminified `.js` sibling
remains useful for debugging.

### 3) Legacy Direct `<script>` Include (UMD fallback)

Expand Down
10 changes: 6 additions & 4 deletions packages/rrweb-player/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ import 'rrweb-player/dist/style.css';
href="https://cdn.rrweb.com/rrweb-player/current/style.css"
/>
<script type="module">
import rrwebPlayer from 'https://cdn.rrweb.com/rrweb-player/current/rrweb-player.js';
import rrwebPlayer from 'https://cdn.rrweb.com/rrweb-player/current/rrweb-player.min.js';
</script>
```

Use `current` for the latest stable release, or pin an exact version such as
`https://cdn.rrweb.com/rrweb-player/2.0.0/rrweb-player.js` for immutable
production URLs. See the [CDN assets docs](https://rrweb.com/docs/cloud/cdn-assets)
for the full URL shape and catalog.
`https://cdn.rrweb.com/rrweb-player/2.0.0/rrweb-player.min.js` for immutable
production URLs. Use `.min.js` for production; the unminified `.js` sibling
remains useful for debugging. See the
[CDN assets docs](https://rrweb.com/docs/cloud/cdn-assets) for the full URL
shape and catalog.

### 3) Legacy Direct `<script>` Include (UMD fallback)

Expand Down
11 changes: 6 additions & 5 deletions packages/rrweb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,16 @@ import 'rrweb/dist/style.css';
href="https://cdn.rrweb.com/replay/current/dist/style.css"
/>
<script type="module">
import { record } from 'https://cdn.rrweb.com/record/current/dist/record.js';
import { Replayer } from 'https://cdn.rrweb.com/replay/current/dist/replay.js';
import { record } from 'https://cdn.rrweb.com/record/current/dist/record.min.js';
import { Replayer } from 'https://cdn.rrweb.com/replay/current/dist/replay.min.js';
</script>
```

Use `current` for the latest stable release, or pin exact versions such as
`https://cdn.rrweb.com/record/2.0.0/dist/record.js` and
`https://cdn.rrweb.com/replay/2.0.0/dist/replay.js` for immutable
production URLs.
`https://cdn.rrweb.com/record/2.0.0/dist/record.min.js` and
`https://cdn.rrweb.com/replay/2.0.0/dist/replay.min.js` for immutable
production URLs. Use `.min.js` for production; the unminified `.js` sibling
remains useful for debugging.

### 3) Legacy Direct `<script>` Include (UMD fallback)

Expand Down
Loading