Update filesize badges (might need further evolution before 2.0.0) (#1787)

* Update filesize badges (might need further evolution before 2.0.0)

* Don't run full CI/CD when only .md docs have changed in the PR

 - move eslint checks into their own file so they can also ignore .md changes
 - prettier checks don't need the same perms as eslint, so we can demote pull_request_target -> pull_request

* Add empty changeset

* Implement the bundle size change originally originally added in #1784 - adding here also to show how the conflicts would resolve

* Update .github/workflows/eslint-check.yml

---------

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
This commit is contained in:
Eoghan Murray
2026-04-01 12:00:00 +08:00
committed by GitHub
parent e4e73596ec
commit 5f1ff35ece
5 changed files with 99 additions and 67 deletions

View File

@@ -0,0 +1,2 @@
---
---

View File

@@ -1,6 +1,12 @@
name: Tests
on: [push, pull_request]
on:
push:
paths-ignore:
- '**/*.md'
pull_request:
paths-ignore:
- '**/*.md'
concurrency: ${{ github.workflow }}-${{ github.ref }}
@@ -41,16 +47,6 @@ jobs:
# run: PUPPETEER_EXECUTABLE_PATH=${{ steps.setup-chrome.outputs.chrome-path }} PUPPETEER_HEADLESS=true xvfb-run --server-args="-screen 0 1920x1080x24" yarn test
run: PUPPETEER_HEADLESS=true xvfb-run --server-args="-screen 0 1920x1080x24" yarn test
- name: Check bundle sizes
uses: preactjs/compressed-size-action@v2
with:
install-script: 'yarn install --frozen-lockfile'
build-script: 'build:all'
compression: 'none'
pattern: '**/dist/*.{js,cjs,mjs,css}'
env:
PUPPETEER_SKIP_DOWNLOAD: true
- name: Upload diff images to GitHub
uses: actions/upload-artifact@v4
if: failure()

86
.github/workflows/eslint-check.yml vendored Normal file
View File

@@ -0,0 +1,86 @@
name: ESLint Check
on:
push:
pull_request_target:
jobs:
eslint_check_upload:
runs-on: ubuntu-latest
permissions:
contents: read
name: ESLint Check and Report Upload
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'yarn'
- name: Install Dependencies
run: yarn install --frozen-lockfile
env:
PUPPETEER_SKIP_DOWNLOAD: true
- name: Build Packages
run: NODE_OPTIONS='--max-old-space-size=4096' yarn build:all
- name: Eslint Check
run: yarn turbo run lint
- name: Save Code Linting Report JSON
run: yarn lint:report
# Continue to the next step even if this fails
continue-on-error: true
- name: Upload ESLint Report
uses: actions/upload-artifact@v4
with:
name: eslint_report.json
path: eslint_report.json
annotation:
# Skip the annotation action in push events
if: github.event_name == 'pull_request_target'
permissions:
checks: write
needs: eslint_check_upload
runs-on: ubuntu-latest
name: ESLint Annotation
steps:
- uses: actions/download-artifact@v4
with:
name: eslint_report.json
- name: Annotate Code Linting Results
uses: ataylorme/eslint-annotate-action@v2
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
report-json: 'eslint_report.json'
bundle_size:
# Only runs on PRs (needs a base branch to compare against)
if: github.event_name == 'pull_request_target'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
name: Check Bundle Sizes
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'yarn'
- name: Check bundle sizes
uses: preactjs/compressed-size-action@v2
with:
install-script: 'yarn install --frozen-lockfile'
build-script: 'build:all'
compression: 'none'
pattern: '**/dist/*.{js,cjs,mjs,css}'
env:
PUPPETEER_SKIP_DOWNLOAD: true

View File

@@ -1,60 +1,8 @@
name: Code Style Check
name: Prettier Check
on: [push, pull_request_target]
on: [push, pull_request]
jobs:
eslint_check_upload:
runs-on: ubuntu-latest
permissions:
contents: read
name: ESLint Check and Report Upload
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'yarn'
- name: Install Dependencies
run: yarn install --frozen-lockfile
env:
PUPPETEER_SKIP_DOWNLOAD: true
- name: Build Packages
run: NODE_OPTIONS='--max-old-space-size=4096' yarn build:all
- name: Eslint Check
run: yarn turbo run lint
- name: Save Code Linting Report JSON
run: yarn lint:report
# Continue to the next step even if this fails
continue-on-error: true
- name: Upload ESLint Report
uses: actions/upload-artifact@v4
with:
name: eslint_report.json
path: eslint_report.json
annotation:
# Skip the annotation action in push events
if: github.event_name == 'pull_request_target'
permissions:
checks: write
needs: eslint_check_upload
runs-on: ubuntu-latest
name: ESLint Annotation
steps:
- uses: actions/download-artifact@v4
with:
name: eslint_report.json
- name: Annotate Code Linting Results
uses: ataylorme/eslint-annotate-action@v2
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
report-json: 'eslint_report.json'
prettier_check:
# In the forked PR, it's hard to format code and push to the branch directly, so the action only check the format correctness.
if: github.event_name != 'push' && github.event.pull_request.head.repo.full_name != 'rrweb-io/rrweb'

View File

@@ -12,8 +12,8 @@
[![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)
[![Reddit](https://img.shields.io/badge/reddit-r/rrweb-teal.svg?logo=reddit)](https://www.reddit.com/r/rrweb)
![total gzip size](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/rrweb@latest/dist/rrweb.min.cjs?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.cjs?compression=gzip&label=recorder%20gzip%20size)
![recorder gzip size](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/@rrweb/record@latest/dist/record.min.js?compression=gzip&label=recorder%20gzip%20size&max=200000&softmax=100000)
![replayer gzip size](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/@rrweb/replay@latest/dist/replay.min.js?compression=gzip&label=replayer%20gzip%20size&max=200000&softmax=100000)
[![](https://data.jsdelivr.com/v1/package/npm/rrweb/badge)](https://www.jsdelivr.com/package/npm/rrweb)
[中文文档](./README.zh_CN.md)