fix: remove postcss from @posthog/rrweb-record bundle#166
Open
pauldambra wants to merge 3 commits intomainfrom
Open
fix: remove postcss from @posthog/rrweb-record bundle#166pauldambra wants to merge 3 commits intomainfrom
pauldambra wants to merge 3 commits intomainfrom
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
|
Size Change: -810 kB (-6.95%) ✅ Total Size: 10.8 MB
ℹ️ View Unchanged
|
PostCSS (~250KB) was bundled into the record entry because the record package consumed pre-built workspace dependencies, preventing Rollup from tree-shaking unused modules like rebuild.ts. Add a resolveId plugin to the record package's vite config that redirects @posthog/rrweb, @posthog/rrweb-snapshot, and @posthog/rrdom to their source entry points so Rollup can see individual modules and drop the replay/postcss code. Also add slimDOMDefaults, resetMaxDepthState, and wasMaxDepthReached to the record-only sub-entries so the record chain doesn't need the full barrel exports. Result: 420KB → 170KB, zero postcss references. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add pull-requests: write permission so compressed-size-action can post comments - Add strip-hash to normalize content-hashed filenames across builds Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
91ffcc2 to
6f10930
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PostCSS (~250KB) was bundled into
@posthog/rrweb-recordbecause the record package consumed pre-built workspace dependencies, preventing Rollup from tree-shaking unused modules likerebuild.ts.resolveIdvite plugin topackages/record/vite.config.tsthat redirects@posthog/rrweb,@posthog/rrweb-snapshot, and@posthog/rrdomto their source entry points so Rollup can see individual modules and drop the replay/postcss codeslimDOMDefaultsandresetMaxDepthStatetorrweb-snapshot's record sub-entry (needed by the record chain)wasMaxDepthReachedandresetMaxDepthStatefromrrweb's record entrypull-requests: writepermission andstrip-hashfor content-hashed filenamesResult:
@posthog/rrweb-recordbundle 420KB → 170KB, zero postcss references.Test plan
pnpm build:allsucceedsgrep -c "postcss" packages/record/dist/rrweb-record.jsreturns 0pnpm --filter @posthog/rrweb-record testpasses🤖 Generated with Claude Code