Make session replay opt-in so rrweb isn't shipped when it's disabled
Maintainers usually reply within 1 day
@grootbro is already working on this.
Since Oct 20, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- analytics, build-system, frontend
Research direction
Start by tracing loadReplayModule and the existing replay import, then inspect the @openpanel/web package entry points and the IIFE build's esbuild replay stub. Compare how the proposed @openpanel/web/replay entry and recorder option fit the current API. Done means replay users can import the recorder explicitly while apps without that import no longer receive the rrweb chunk; validate both build outputs.
Written by the indexing model from the issue text.
Description
@openpanel/web emits the replay chunk (rrweb, ~55 KB gz) even for apps that never set sessionReplay.enabled. #336 made it lazy, so no TTI cost, but loadReplayModule still does an unconditional import('./replay'), so the bundler always emits it and deploys it as dead code. Consumers can only drop it by stubbing rrweb or patching the package. (context: https://github.com/Openpanel-dev/openpanel/issues/336#issuecomment-4959858749)
Proposal: opt-in replay subpath
Base package stops importing ./replay; expose the recorder as @openpanel/web/replay and let consumers pass it in:
import { OpenPanel } from '@openpanel/web'
import { startReplayRecorder } from '@openpanel/web/replay'
new OpenPanel({ sessionReplay: { enabled: true, recorder: startReplayRecorder } })
rrweb then only enters a bundle when the subpath is imported. Replay users add one import, everyone else gets a lean build for free. The IIFE build already stubs replay via an esbuild plugin, so this mostly surfaces existing decoupling at the API level.
Smaller alternative if the API change is too much: a replay-free library entry or a build flag.
Follows up on #336.
- Dominant language
- TypeScript
- Stars
- 7.3k
- Forks
- 552
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 18
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Openpanel-dev/openpanel
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Openpanel-dev/openpanel#694 ·
Maintainers usually reply within 1 day
-
Free trial banner overlaps the AI Chat sidebarPossibly taken @VasuS609 claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Openpanel-dev/openpanel#690 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Openpanel-dev/openpanel#653 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Openpanel-dev/openpanel#610 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
Openpanel-dev/openpanel#682 ·
Maintainers usually reply within 1 day
All issues in Openpanel-dev/openpanel
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
nicobailon/pi-subagents#3425 ·
Maintainers usually reply within 1 day
-
area-a2a bug port python
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
strands-agents/harness-sdk#6697 · 1 comment ·
Maintainers usually reply within 1 day
-
api technical-debt
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
opencollective/opencollective#9235 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
openwatersio/slackwater#603 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day