Skip to content

Commit 2b78153

Browse files
authored
Merge branch 'master' into remove-postcss
2 parents c824c46 + 33e01f5 commit 2b78153

29 files changed

Lines changed: 165 additions & 363 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.changeset/thirty-shirts-grow.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
"all": patch
3+
"packer": patch
4+
"plugins": patch
5+
"record": patch
6+
"replay": patch
7+
"rrdom": patch
8+
"rrdom-nodejs": patch
9+
"rrweb": patch
10+
"rrweb-player": patch
11+
"rrweb-snapshot": patch
12+
"types": patch
13+
"utils": patch
14+
---
15+
16+
Provide a /umd/ output folder alongside the /dist/ one so that we can serve UMD (Universal Module Definition) files with a .js extension, without upsetting expectations set by package.json that all .js files in /dist/ are modules

.github/workflows/ci-cd.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Tests
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
paths-ignore:
6+
- '**/*.md'
7+
pull_request:
8+
paths-ignore:
9+
- '**/*.md'
410

511
concurrency: ${{ github.workflow }}-${{ github.ref }}
612

.github/workflows/eslint-check.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: ESLint Check
2+
3+
on:
4+
push:
5+
pull_request_target:
6+
7+
jobs:
8+
eslint_check_upload:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
name: ESLint Check and Report Upload
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
repository: ${{ github.event.pull_request.head.repo.full_name }}
18+
ref: ${{ github.head_ref }}
19+
- name: Setup Node
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: lts/*
23+
cache: 'yarn'
24+
- name: Install Dependencies
25+
run: yarn install --frozen-lockfile
26+
env:
27+
PUPPETEER_SKIP_DOWNLOAD: true
28+
- name: Build Packages
29+
run: NODE_OPTIONS='--max-old-space-size=4096' yarn build:all
30+
- name: Eslint Check
31+
run: yarn turbo run lint
32+
- name: Save Code Linting Report JSON
33+
run: yarn lint:report
34+
# Continue to the next step even if this fails
35+
continue-on-error: true
36+
- name: Upload ESLint Report
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: eslint_report.json
40+
path: eslint_report.json
41+
42+
annotation:
43+
# Skip the annotation action in push events
44+
if: github.event_name == 'pull_request_target'
45+
permissions:
46+
checks: write
47+
needs: eslint_check_upload
48+
runs-on: ubuntu-latest
49+
name: ESLint Annotation
50+
steps:
51+
- uses: actions/download-artifact@v4
52+
with:
53+
name: eslint_report.json
54+
- name: Annotate Code Linting Results
55+
uses: ataylorme/eslint-annotate-action@v2
56+
with:
57+
repo-token: '${{ secrets.GITHUB_TOKEN }}'
58+
report-json: 'eslint_report.json'
59+
60+
bundle_size:
61+
# Only runs on PRs (needs a base branch to compare against)
62+
if: github.event_name == 'pull_request_target'
63+
runs-on: ubuntu-latest
64+
permissions:
65+
contents: read
66+
pull-requests: write
67+
name: Check Bundle Sizes
68+
steps:
69+
- uses: actions/checkout@v4
70+
with:
71+
repository: ${{ github.event.pull_request.head.repo.full_name }}
72+
ref: ${{ github.head_ref }}
73+
- name: Setup Node
74+
uses: actions/setup-node@v3
75+
with:
76+
node-version: lts/*
77+
cache: 'yarn'
78+
- name: Check bundle sizes
79+
uses: preactjs/compressed-size-action@v2
80+
with:
81+
install-script: 'yarn install --frozen-lockfile'
82+
build-script: 'build:all'
83+
compression: 'none'
84+
pattern: '**/dist/*.{js,cjs,mjs,css}'
85+
env:
86+
PUPPETEER_SKIP_DOWNLOAD: true

.github/workflows/style-check.yml

Lines changed: 2 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,8 @@
1-
name: Code Style Check
1+
name: Prettier Check
22

3-
on: [push, pull_request_target]
3+
on: [push, pull_request]
44

55
jobs:
6-
eslint_check_upload:
7-
runs-on: ubuntu-latest
8-
permissions:
9-
contents: read
10-
name: ESLint Check and Report Upload
11-
12-
steps:
13-
- uses: actions/checkout@v4
14-
with:
15-
repository: ${{ github.event.pull_request.head.repo.full_name }}
16-
ref: ${{ github.head_ref }}
17-
- name: Setup Node
18-
uses: actions/setup-node@v3
19-
with:
20-
node-version: lts/*
21-
cache: 'yarn'
22-
- name: Install Dependencies
23-
run: yarn install --frozen-lockfile
24-
env:
25-
PUPPETEER_SKIP_DOWNLOAD: true
26-
- name: Build Packages
27-
run: NODE_OPTIONS='--max-old-space-size=4096' yarn build:all
28-
- name: Eslint Check
29-
run: yarn turbo run lint
30-
- name: Save Code Linting Report JSON
31-
run: yarn lint:report
32-
# Continue to the next step even if this fails
33-
continue-on-error: true
34-
- name: Upload ESLint Report
35-
uses: actions/upload-artifact@v4
36-
with:
37-
name: eslint_report.json
38-
path: eslint_report.json
39-
40-
annotation:
41-
# Skip the annotation action in push events
42-
if: github.event_name == 'pull_request_target'
43-
permissions:
44-
checks: write
45-
needs: eslint_check_upload
46-
runs-on: ubuntu-latest
47-
name: ESLint Annotation
48-
steps:
49-
- uses: actions/download-artifact@v4
50-
with:
51-
name: eslint_report.json
52-
- name: Annotate Code Linting Results
53-
uses: ataylorme/eslint-annotate-action@v2
54-
with:
55-
repo-token: '${{ secrets.GITHUB_TOKEN }}'
56-
report-json: 'eslint_report.json'
57-
58-
bundle_size:
59-
# Only runs on PRs (needs a base branch to compare against)
60-
if: github.event_name == 'pull_request_target'
61-
runs-on: ubuntu-latest
62-
permissions:
63-
contents: read
64-
pull-requests: write
65-
name: Check Bundle Sizes
66-
steps:
67-
- uses: actions/checkout@v4
68-
with:
69-
repository: ${{ github.event.pull_request.head.repo.full_name }}
70-
ref: ${{ github.head_ref }}
71-
- name: Setup Node
72-
uses: actions/setup-node@v3
73-
with:
74-
node-version: lts/*
75-
cache: 'yarn'
76-
- name: Check bundle sizes
77-
uses: preactjs/compressed-size-action@v2
78-
with:
79-
install-script: 'yarn install --frozen-lockfile'
80-
build-script: 'build:all'
81-
compression: 'none'
82-
pattern: '**/dist/*.{js,cjs,mjs,css}'
83-
env:
84-
PUPPETEER_SKIP_DOWNLOAD: true
85-
866
prettier_check:
877
# In the forked PR, it's hard to format code and push to the branch directly, so the action only check the format correctness.
888
if: github.event_name != 'push' && github.event.pull_request.head.repo.full_name != 'rrweb-io/rrweb'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ temp
1616
# output of `yarn build`
1717
build
1818
dist
19+
umd
1920

2021
# turbo cache
2122
.turbo

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
[![Join the chat at slack](https://img.shields.io/badge/[email protected]?logo=slack)](https://join.slack.com/t/rrweb/shared_invite/zt-siwoc6hx-uWay3s2wyG8t5GpZVb8rWg)
1313
[![Twitter Follow](https://img.shields.io/badge/twitter-@rrweb__io-teal.svg?logo=twitter)](https://twitter.com/rrweb_io)
1414
[![Reddit](https://img.shields.io/badge/reddit-r/rrweb-teal.svg?logo=reddit)](https://www.reddit.com/r/rrweb)
15-
![total gzip size](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/rrweb@latest/dist/rrweb.min.cjs?compression=gzip&label=total%20gzip%20size)
16-
![recorder gzip size](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/rrweb@latest/dist/record/rrweb-record.min.cjs?compression=gzip&label=recorder%20gzip%20size)
15+
![recorder gzip size](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/@rrweb/record@latest/umd/record.min.js?compression=gzip&label=recorder%20gzip%20size&max=200000&softmax=100000)
16+
![replayer gzip size](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/@rrweb/replay@latest/umd/replay.min.js?compression=gzip&label=replayer%20gzip%20size&max=200000&softmax=100000)
1717
[![](https://data.jsdelivr.com/v1/package/npm/rrweb/badge)](https://www.jsdelivr.com/package/npm/rrweb)
1818

1919
[中文文档](./README.zh_CN.md)

README.zh_CN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
[![Join the chat at slack](https://img.shields.io/badge/[email protected]?logo=slack)](https://join.slack.com/t/rrweb/shared_invite/zt-siwoc6hx-uWay3s2wyG8t5GpZVb8rWg)
1313
[![Reddit](https://img.shields.io/badge/reddit-r/rrweb-teal.svg?logo=reddit)](https://www.reddit.com/r/rrweb)
14-
![total gzip size](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/rrweb@latest/dist/rrweb.min.cjs?compression=gzip&label=total%20gzip%20size)
15-
![recorder gzip size](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/rrweb@latest/dist/record/rrweb-record.min.cjs?compression=gzip&label=recorder%20gzip%20size)
14+
![total gzip size](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/rrweb@latest/umd/rrweb.min.js?compression=gzip&label=total%20gzip%20size)
15+
![recorder gzip size](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/@rrweb/record@latest/umd/record.min.js?compression=gzip&label=recorder%20gzip%20size)
1616
[![](https://data.jsdelivr.com/v1/package/npm/rrweb/badge)](https://www.jsdelivr.com/package/npm/rrweb)
1717

1818
> 我已开通 Github Sponsor, 您可以通过赞助的形式帮助 rrweb 的开发。

guide.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ You are recommended to install rrweb via jsdelivr's CDN service:
1515
rel="stylesheet"
1616
href="https://cdn.jsdelivr.net/npm/rrweb@latest/dist/style.css"
1717
/>
18-
<script src="https://cdn.jsdelivr.net/npm/rrweb@latest/dist/rrweb.umd.min.cjs"></script>
18+
<script src="https://cdn.jsdelivr.net/npm/rrweb@latest/umd/rrweb.min.js"></script>
1919
```
2020

2121
Also, you can link to a specific version number that you can update manually:
2222

2323
```html
24-
<script src="https://cdn.jsdelivr.net/npm/[email protected].14/dist/rrweb.umd.min.cjs"></script>
24+
<script src="https://cdn.jsdelivr.net/npm/[email protected].21/umd/rrweb.min.js"></script>
2525
```
2626

2727
#### Only include the recorder code
@@ -30,7 +30,7 @@ rrweb's code includes both the record and the replay parts. Most of the time you
3030
This also can be done by using the `@rrweb/record` package and the CDN service:
3131

3232
```html
33-
<script src="https://cdn.jsdelivr.net/npm/@rrweb/record@latest/dist/record.umd.min.cjs"></script>
33+
<script src="https://cdn.jsdelivr.net/npm/@rrweb/record@latest/umd/record.min.js"></script>
3434
```
3535

3636
The recorder UMD build exposes a global named `rrwebRecord`.
@@ -42,7 +42,7 @@ The recorder UMD build exposes a global named `rrwebRecord`.
4242
rel="stylesheet"
4343
href="https://cdn.jsdelivr.net/npm/@rrweb/replay@latest/dist/style.css"
4444
/>
45-
<script src="https://cdn.jsdelivr.net/npm/@rrweb/replay@latest/dist/replay.umd.min.cjs"></script>
45+
<script src="https://cdn.jsdelivr.net/npm/@rrweb/replay@latest/umd/replay.min.js"></script>
4646
```
4747

4848
The replayer UMD build exposes a global named `rrwebReplay`.
@@ -340,7 +340,7 @@ rrweb-player can also be included with `<script>`:
340340
rel="stylesheet"
341341
href="https://cdn.jsdelivr.net/npm/rrweb-player@latest/dist/style.css"
342342
/>
343-
<script src="https://cdn.jsdelivr.net/npm/rrweb-player@latest/dist/rrweb-player.umd.cjs"></script>
343+
<script src="https://cdn.jsdelivr.net/npm/rrweb-player@latest/umd/rrweb-player.js"></script>
344344
```
345345

346346
Or installed by using NPM:

guide.zh_CN.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@
1313
rel="stylesheet"
1414
href="https://cdn.jsdelivr.net/npm/rrweb@latest/dist/style.css"
1515
/>
16-
<script src="https://cdn.jsdelivr.net/npm/rrweb@latest/dist/rrweb.umd.min.cjs"></script>
16+
<script src="https://cdn.jsdelivr.net/npm/rrweb@latest/umd/rrweb.min.js"></script>
1717
```
1818

1919
也可以在 URL 中指定具体的版本号,例如:
2020

2121
```html
22-
<script src="https://cdn.jsdelivr.net/npm/[email protected].14/dist/rrweb.umd.min.cjs"></script>
22+
<script src="https://cdn.jsdelivr.net/npm/[email protected].21/umd/rrweb.min.js"></script>
2323
```
2424

2525
#### 仅引入录制部分
2626

2727
rrweb 代码分为录制和回放两部分,大多数时候用户在被录制的应用中只需要引入录制部分代码。同样可以通过使用 @rrweb/record 包和 CDN 服务来实现:
2828

2929
```html
30-
<script src="https://cdn.jsdelivr.net/npm/@rrweb/record@latest/dist/record.umd.min.cjs"></script>
30+
<script src="https://cdn.jsdelivr.net/npm/@rrweb/record@latest/umd/record.min.js"></script>
3131
```
3232

3333
录制端的 UMD build 会暴露全局变量 `rrwebRecord`
@@ -39,7 +39,7 @@ rrweb 代码分为录制和回放两部分,大多数时候用户在被录制
3939
rel="stylesheet"
4040
href="https://cdn.jsdelivr.net/npm/@rrweb/replay@latest/dist/style.css"
4141
/>
42-
<script src="https://cdn.jsdelivr.net/npm/@rrweb/replay@latest/dist/replay.umd.min.cjs"></script>
42+
<script src="https://cdn.jsdelivr.net/npm/@rrweb/replay@latest/umd/replay.min.js"></script>
4343
```
4444

4545
回放端的 UMD build 会暴露全局变量 `rrwebReplay`
@@ -334,7 +334,7 @@ rrweb-player 同样可以使用 CDN 方式安装:
334334
rel="stylesheet"
335335
href="https://cdn.jsdelivr.net/npm/rrweb-player@latest/dist/style.css"
336336
/>
337-
<script src="https://cdn.jsdelivr.net/npm/rrweb-player@latest/dist/rrweb-player.umd.cjs"></script>
337+
<script src="https://cdn.jsdelivr.net/npm/rrweb-player@latest/umd/rrweb-player.js"></script>
338338
```
339339

340340
或者通过 npm 安装:

0 commit comments

Comments
 (0)