Repository navigation
fix(rrweb): strip inlined worker sourceMappingURL comment (Angular build break in beta.6) - #197
Conversation
…ild time (Angular break in beta.6) Angular's esbuild builder deletes column-0 sourceMappingURL lines from dependencies; the inlined worker template literal ended with one followed by the closing backtick, so dist/index.js stopped parsing. Remove it at build time, dedupe the trailing comment, and add a dist guard (script + CI + test) that emulates Angular's stripping over every package dist. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WeiJxSMPCqs6TBDKuGw9TG
|
No actionable comments were generated in the recent review. Summary
Change: Bug fix Merge Risk:
|
|
Claude finished @krassx's task in 54s —— View job Review of PR #197: strip inlined worker
|
…build Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WeiJxSMPCqs6TBDKuGw9TG
|
Claude finished @krassx's task in 14s —— View job Re-review of PR #197 after the push (commit
|
…strip, move build tooling out of src - the guard test no longer cleans dist/ (raced turbo's concurrent build: ENOENT in onSuccess); the dedupe step honours the configured out dir - the strip regex is anchored to line start and the build fails unless exactly one comment is stripped - the built-package test extracts the inlined worker, syntax-checks it and runs a vm smoke - tooling moved to packages/rrweb/build (coverage + tsconfig include it); temp dirs cleaned up Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WeiJxSMPCqs6TBDKuGw9TG
|
Claude finished @krassx's task in 54s —— View job Re-review of PR #197 after the push (commit
|
Ships the @bugsee/rrweb fix for the Angular esbuild build break (#197) and everything merged since beta.6. Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Problem
@bugsee/rrweb@0.1.0-beta.6breaks Angular's esbuildapplicationbuilder (Unterminated string literal ... dist/index.js:9100). Angular strips^//# sourceMappingURL=[^\r\n]*(gm) from dependency JS. rrweb's inlined image-bitmap worker is a template literal whose text ends\n//# sourceMappingURL=image-bitmap-data-url-worker-NVDCVKXO.js.mapfollowed by the closing backtick on the same line (originates in the vendoredrecord.js); the regex deleted the backtick and;.Fix
packages/rrweb/build/strip-inline-sourcemap.ts(build tooling, outsidesrc/): esbuildonLoadplugin removing a line-start sourceMappingURL comment followed by a backtick on the same line. Wired intotsup.config.tswithexpected: 1: the build fails if a vendor bump changes the number of such comments. The vendoredrecord.jsand its sha256 pin are untouched.//# sourceMappingURL=index.js.maptwice; anonSuccessstep (honouring the configured out dir) keeps one.esbuildadded as an rrweb devDependency.Guard
scripts/check-dist-sourcemaps.mjs(pnpm check:dist-sourcemaps): for everypackages/*/dist/**/*.{js,cjs,mjs}, a column-0 sourceMappingURL comment may only be in the trailing comment run, and the file must still parse after Angular's exact regex. Green over all 175 dist files.ci.yml(builds rrweb, then scans) ANDrelease.yml(afterturbo run build, before publish, so every published dist is scanned).packages/rrweb/build/dist-sourcemap-guard.test.tsbuilds the real package into a temp dir (so it cannot race turbo's ownbuildondist/), asserts the same, and extracts the inlined worker to syntax-check it and run a vm smoke.application-builder smoke (full Angular install per run); the guard emulates the failing step. A reviewer verified with realng buildon Angular 18/19/21: all fail on beta.6 and build with this change.Note: the E2E job getting stuck on "Install Playwright's browsers" is runner infrastructure (same on other PRs); rerun it if it times out.
Version not bumped; beta.7 to be cut by the maintainer.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WeiJxSMPCqs6TBDKuGw9TG