Skip to content

[codex] migrate to pnpm#1843

Open
Juice10 wants to merge 3 commits into
rrweb-io:mainfrom
Juice10:codex/migrate-to-pnpm
Open

[codex] migrate to pnpm#1843
Juice10 wants to merge 3 commits into
rrweb-io:mainfrom
Juice10:codex/migrate-to-pnpm

Conversation

@Juice10

@Juice10 Juice10 commented May 29, 2026

Copy link
Copy Markdown
Member

Summary

  • Migrate the workspace from Yarn to pnpm, including pnpm workspace/lock files and Corepack-backed CI updates.
  • Convert package scripts, internal workspace references, docs, and package cleanup paths to pnpm.
  • Remove obsolete Yarn files and unused root tooling.
  • Apply the focused CI browser install fix: no browser downloads during dependency install, no rrvideo install-time Playwright hook, explicit Playwright --with-deps setup in the test job, and Chrome supplied through PUPPETEER_EXECUTABLE_PATH.

CI Install Root Cause

The CI install hang came from browser provisioning being coupled to package installation. In this branch, the custom Puppeteer download scripts and Puppeteer revision tweak have been removed. The base bundle comparison keeps install scripts enabled, but removes only the legacy rrvideo install: playwright install hook from the checked-out Yarn base branch before installing dependencies.

Verification

  • pnpm exec prettier --check '**/*.{ts,md}'
  • git diff --cached --check
  • pnpm run build:all
  • pnpm run check-types
  • pnpm run lint
  • PUPPETEER_HEADLESS=true pnpm test
  • env CI=true PUPPETEER_SKIP_DOWNLOAD=true PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=true pnpm install --frozen-lockfile

Notes

  • docs/superpowers/** historical references were intentionally left unchanged.
  • release, watch, dev, repl, and live-stream commands were not run because they publish or are intentionally long-running/interactive.
  • packages/rrweb-player/.svelte-kit/ambient.d.ts remains an unstaged pre-existing/generated local modification and is not part of this PR.

@changeset-bot

changeset-bot Bot commented May 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9fa6f2c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets
Name Type
@rrweb/all Patch
@rrweb/packer Patch
@rrweb/record Patch
@rrweb/replay Patch
rrdom-nodejs Patch
rrdom Patch
rrvideo Patch
rrweb-player Patch
rrweb-snapshot Patch
rrweb Patch
@rrweb/types Patch
@rrweb/utils Patch
@rrweb/web-extension Patch
@rrweb/rrweb-plugin-canvas-webrtc-record Patch
@rrweb/rrweb-plugin-canvas-webrtc-replay Patch
@rrweb/rrweb-plugin-console-record Patch
@rrweb/rrweb-plugin-console-replay Patch
@rrweb/rrweb-plugin-sequential-id-record Patch
@rrweb/rrweb-plugin-sequential-id-replay Patch

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Changes

Size change: +225.23 kB (+2.50%) | Total size: 9244.40 kB

all - 1969.45 kB -> 2010.64 kB (+41.19 kB (+2.09%))
File Base PR Diff
all.cjs 566.12 kB 578.19 kB +12.07 kB (+2.13%)
all.js 565.79 kB 577.86 kB +12.07 kB (+2.13%)
all.umd.cjs 569.28 kB 581.38 kB +12.10 kB (+2.13%)
all.umd.min.cjs 268.25 kB 273.21 kB +4.96 kB (+1.85%)
plugins - 154.74 kB -> 155.08 kB (+348 B (+0.22%))
File Base PR Diff
packages/plugins/rrweb-plugin-canvas-webrtc-record/dist/rrweb-plugin-canvas-webrtc-record.umd.cjs 37.76 kB 37.79 kB +29 B (+0.08%)
packages/plugins/rrweb-plugin-canvas-webrtc-record/dist/rrweb-plugin-canvas-webrtc-record.umd.min.cjs 22.33 kB 22.36 kB +29 B (+0.13%)
packages/plugins/rrweb-plugin-canvas-webrtc-replay/dist/rrweb-plugin-canvas-webrtc-replay.umd.cjs 34.55 kB 34.58 kB +29 B (+0.08%)
packages/plugins/rrweb-plugin-canvas-webrtc-replay/dist/rrweb-plugin-canvas-webrtc-replay.umd.min.cjs 20.67 kB 20.70 kB +29 B (+0.14%)
packages/plugins/rrweb-plugin-console-record/dist/rrweb-plugin-console-record.umd.cjs 15.70 kB 15.73 kB +29 B (+0.18%)
packages/plugins/rrweb-plugin-console-record/dist/rrweb-plugin-console-record.umd.min.cjs 7.85 kB 7.87 kB +29 B (+0.36%)
packages/plugins/rrweb-plugin-console-replay/dist/rrweb-plugin-console-replay.umd.cjs 5.98 kB 6.01 kB +29 B (+0.47%)
packages/plugins/rrweb-plugin-console-replay/dist/rrweb-plugin-console-replay.umd.min.cjs 3.22 kB 3.25 kB +29 B (+0.88%)
packages/plugins/rrweb-plugin-sequential-id-record/dist/rrweb-plugin-sequential-id-record.umd.cjs 1.72 kB 1.75 kB +29 B (+1.65%)
packages/plugins/rrweb-plugin-sequential-id-record/dist/rrweb-plugin-sequential-id-record.umd.min.cjs 1.43 kB 1.46 kB +29 B (+1.98%)
packages/plugins/rrweb-plugin-sequential-id-replay/dist/rrweb-plugin-sequential-id-replay.umd.cjs 1.96 kB 1.99 kB +29 B (+1.44%)
packages/plugins/rrweb-plugin-sequential-id-replay/dist/rrweb-plugin-sequential-id-replay.umd.min.cjs 1.57 kB 1.60 kB +29 B (+1.81%)
record - 549.85 kB -> 549.94 kB (+88 B (+0.02%))
File Base PR Diff
record.cjs 157.64 kB 157.65 kB +8 B (+0.00%)
record.js 157.55 kB 157.56 kB +8 B (+0.00%)
record.umd.cjs 158.94 kB 158.98 kB +37 B (+0.02%)
record.umd.min.cjs 75.71 kB 75.75 kB +35 B (+0.05%)
replay - 1404.09 kB -> 1445.25 kB (+41.16 kB (+2.93%))
File Base PR Diff
replay.cjs 403.00 kB 415.06 kB +12.06 kB (+2.99%)
replay.js 402.91 kB 414.97 kB +12.06 kB (+2.99%)
replay.umd.cjs 405.95 kB 418.05 kB +12.09 kB (+2.98%)
replay.umd.min.cjs 192.23 kB 197.18 kB +4.95 kB (+2.58%)
rrdom - 546.53 kB -> 566.74 kB (+20.21 kB (+3.70%))
File Base PR Diff
rrdom.cjs 157.22 kB 163.14 kB +5.92 kB (+3.76%)
rrdom.js 156.52 kB 162.44 kB +5.92 kB (+3.78%)
rrdom.umd.cjs 159.23 kB 165.18 kB +5.95 kB (+3.74%)
rrdom.umd.min.cjs 73.56 kB 75.98 kB +2.43 kB (+3.30%)
rrdom-nodejs - 486.94 kB -> 507.15 kB (+20.21 kB (+4.15%))
File Base PR Diff
rrdom-nodejs.cjs 139.45 kB 145.37 kB +5.92 kB (+4.24%)
rrdom-nodejs.js 139.13 kB 145.05 kB +5.92 kB (+4.25%)
rrdom-nodejs.umd.cjs 141.80 kB 147.75 kB +5.95 kB (+4.20%)
rrdom-nodejs.umd.min.cjs 66.56 kB 68.98 kB +2.43 kB (+3.64%)
rrweb - 1907.63 kB -> 1948.82 kB (+41.19 kB (+2.16%))
File Base PR Diff
rrweb.cjs 549.29 kB 561.35 kB +12.06 kB (+2.20%)
rrweb.js 548.99 kB 561.05 kB +12.06 kB (+2.20%)
rrweb.umd.cjs 550.45 kB 562.55 kB +12.10 kB (+2.20%)
rrweb.umd.min.cjs 258.91 kB 263.87 kB +4.96 kB (+1.92%)
rrweb-player - 993.39 kB -> 1033.91 kB (+40.52 kB (+4.08%))
File Base PR Diff
rrweb-player.cjs 287.30 kB 299.19 kB +11.89 kB (+4.14%)
rrweb-player.js 287.18 kB 299.07 kB +11.89 kB (+4.14%)
rrweb-player.umd.cjs 289.56 kB 301.48 kB +11.92 kB (+4.12%)
rrweb-player.umd.min.cjs 129.36 kB 134.18 kB +4.82 kB (+3.73%)
rrweb-snapshot - 606.83 kB -> 627.03 kB (+20.21 kB (+3.33%))
File Base PR Diff
rrweb-snapshot.cjs 174.25 kB 180.17 kB +5.92 kB (+3.40%)
rrweb-snapshot.js 173.31 kB 179.22 kB +5.92 kB (+3.41%)
rrweb-snapshot.umd.cjs 176.69 kB 182.64 kB +5.95 kB (+3.37%)
rrweb-snapshot.umd.min.cjs 82.58 kB 85.00 kB +2.42 kB (+2.93%)
types - 9.90 kB -> 9.96 kB (+58 B (+0.57%))
File Base PR Diff
types.umd.cjs 6.55 kB 6.58 kB +29 B (+0.43%)
types.umd.min.cjs 3.35 kB 3.38 kB +29 B (+0.85%)
utils - 11.11 kB -> 11.16 kB (+58 B (+0.51%))
File Base PR Diff
utils.umd.cjs 7.11 kB 7.14 kB +29 B (+0.40%)
utils.umd.min.cjs 3.99 kB 4.02 kB +29 B (+0.71%)

@Juice10 Juice10 marked this pull request as ready for review May 29, 2026 19:31
Copilot AI review requested due to automatic review settings May 29, 2026 19:31

Copilot AI left a comment

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.

Pull request overview

Migrates the rrweb monorepo workspace and CI from Yarn to pnpm (Corepack-backed), updating workspace dependency protocols, scripts, and documentation, and stabilizing a set of Puppeteer/Vitest snapshot tests affected by the tooling change.

Changes:

  • Replace Yarn-based workspace setup with pnpm workspace/lock files and update CI workflows to install/build/test via pnpm.
  • Convert package scripts and inter-workspace dependencies to pnpm-friendly patterns (workspace:^, pnpm exec, pnpm dlx) and remove Yarn-specific config.
  • Reduce test flakiness under current Chrome by adjusting Puppeteer launch args, snapshot normalization, and test waits/thresholds.

Reviewed changes

Copilot reviewed 54 out of 61 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/lint-packages.sh Switch package lint tooling invocation from npx to pnpm dlx.
README.zh_CN.md Update contributor install instructions to pnpm.
README.md Update contributor commands from yarn to pnpm.
pnpm-workspace.yaml Add pnpm workspace definition and workspace-level pnpm settings/overrides.
packages/web-extension/vite.config.ts Handle workspace: rrweb dependency version when generating extension manifest.
packages/web-extension/README.md Update build/dev docs to pnpm commands.
packages/web-extension/package.json Convert scripts and workspace dependencies to pnpm/workspace protocol.
packages/utils/package.json Update scripts to remove yarn-specific invocations.
packages/types/package.json Update build/lint scripts to remove yarn wrapper.
packages/rrweb/test/utils.ts Stabilize Puppeteer launch and DOM snapshot stringification ordering.
packages/rrweb/test/replay/video.test.ts Reduce image-snapshot flakiness via a shared threshold constant.
packages/rrweb/test/record/webgl.test.ts Stabilize canvas recording FPS test and navigation behavior.
packages/rrweb/test/record/dialog.test.ts Stabilize dialog recording snapshots by filtering focus/blur noise and targeting mutation events.
packages/rrweb/test/record/cross-origin-iframes.test.ts Add RAF wait to reduce race conditions after input interactions.
packages/rrweb/test/record/snapshots/webgl.test.ts.snap Update snapshots due to stabilized canvas event capture/ordering.
packages/rrweb/test/record.test.ts Increase timeouts and make snapshot index assertions less brittle.
packages/rrweb/test/integration.test.ts Add RAF wait after typing to reduce timing flakiness.
packages/rrweb/test/snapshots/replayer.test.ts.snap Update snapshots reflecting deterministic CID ordering/renaming.
packages/rrweb/README.md Update contributor commands from yarn to pnpm.
packages/rrweb/package.json Convert scripts and workspace dependencies to pnpm/workspace protocol; tweak Vitest flags.
packages/rrweb-snapshot/package.json Convert scripts and workspace deps to pnpm/workspace protocol.
packages/rrweb-player/package.json Convert scripts and workspace deps to pnpm/workspace protocol.
packages/rrvideo/package.json Convert prepublish script and workspace deps to pnpm/workspace protocol.
packages/rrdom/package.json Convert scripts and workspace deps to pnpm/workspace protocol.
packages/rrdom-nodejs/package.json Convert scripts and workspace deps to pnpm/workspace protocol.
packages/replay/package.json Convert scripts and workspace deps to pnpm/workspace protocol.
packages/record/test/record.test.ts Update error messages to pnpm build instructions.
packages/record/package.json Convert scripts and workspace deps to pnpm/workspace protocol.
packages/plugins/rrweb-plugin-sequential-id-replay/package.json Convert scripts and workspace deps to pnpm/workspace protocol.
packages/plugins/rrweb-plugin-sequential-id-record/package.json Convert scripts and workspace deps to pnpm/workspace protocol.
packages/plugins/rrweb-plugin-console-replay/package.json Convert scripts and workspace deps to pnpm/workspace protocol.
packages/plugins/rrweb-plugin-console-record/package.json Convert scripts and workspace deps to pnpm/workspace protocol.
packages/plugins/rrweb-plugin-canvas-webrtc-replay/Readme.md Update example command from yarn to pnpm.
packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json Convert scripts and workspace deps to pnpm/workspace protocol.
packages/plugins/rrweb-plugin-canvas-webrtc-record/Readme.md Update example command from yarn to pnpm.
packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json Convert scripts and workspace deps to pnpm/workspace protocol.
packages/packer/package.json Convert scripts and workspace deps to pnpm/workspace protocol.
packages/all/package.json Convert scripts and workspace deps to pnpm/workspace protocol.
package.json Replace yarn-based scripts/resolutions with pnpm/turbo equivalents; remove obsolete tools; set packageManager to pnpm.
guide.zh_CN.md Update REPL/build instructions from yarn/npm to pnpm.
guide.md Update REPL/build instructions from yarn/npm to pnpm.
docs/styleguide.md Remove markdownlint-specific guidance; keep general Markdown guidelines.
docs/development/coding-style.md Update lint/format commands from yarn to pnpm.
CONTRIBUTING.md Update local dev commands from yarn to pnpm.
.yarnrc.yml Remove Yarn configuration file.
.puppeteerrc.cjs Update pinned browser revision for Puppeteer downloads.
.prettierignore Ignore additional generated/build output paths under pnpm build outputs.
.gitignore Remove yarn-specific ignores; add eslint_report.json and clarify build output ignores.
.github/workflows/style-check.yml Update formatting workflow to install/run checks using pnpm.
.github/workflows/release.yml Update release workflow to install/publish/build using pnpm.
.github/workflows/eslint-check.yml Update ESLint workflow to pnpm for install/build/lint/report; add pnpm-aware base branch handling.
.github/workflows/ci-cd.yml Update CI build/test pipeline to pnpm; add explicit browser installation/verification steps.
.github/config.yml Update contributor welcome message to recommend pnpm lint.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/config.yml
Comment on lines +8 to 9
- Run `pnpm lint` locally to catch formatting errors earlier.
- Document any user-facing changes you've made following the [documentation styleguide](https://github.com/rrweb-io/rrweb/blob/master/blob/main/docs/styleguide.md).
Comment on lines +19 to 20
<!-- You can run `pnpm lint-docs` to ensure that your documentation changes are
formatted correctly. -->
Comment on lines +292 to +324
const gl = canvas.getContext('webgl', { preserveDrawingBuffer: true })!;
// Set the clear color to darkish green.
gl.clearColor(0.0, 0.5, 0.0, 1.0);
// Clear the context with the newly set color. This is
// the function call that actually does the drawing.
gl.clear(gl.COLOR_BUFFER_BIT);
const context = canvas.getContext('2d')!;
context.fillStyle = 'rgb(0, 128, 0)';
context.fillRect(0, 0, canvas.width, canvas.height);

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.

this should be testing webgl recording, not 2d canvas

Comment on lines +304 to +333
const gl = canvas.getContext('webgl', { preserveDrawingBuffer: true })!;
// Set the clear color to darkish blue.
gl.clearColor(0.0, 0.0, 0.5, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT);
const context = canvas.getContext('2d')!;
context.fillStyle = 'rgb(0, 0, 128)';
context.fillRect(0, 0, canvas.width, canvas.height);

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.

should be testing webgl recording

@Juice10 Juice10 force-pushed the codex/migrate-to-pnpm branch from 2be9ebe to 9fa6f2c Compare May 30, 2026 08:05
@eoghanmurray

Copy link
Copy Markdown
Contributor

Is this a 2.0 PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants