Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: lazy load session recording #1588

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

pauldambra
Copy link
Member

@pauldambra pauldambra commented Dec 8, 2024

move session recording entirely to lazy loaded not just the rrweb portions

tested locally and can still record

still need to figure out how to safely release this since it will be published to NPM before the new lazy bundle is available on the CDN

Copy link

vercel bot commented Dec 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Dec 9, 2024 6:12am

Copy link

github-actions bot commented Dec 8, 2024

Size Change: -266 kB (-8.23%) ✅

Total Size: 2.97 MB

Filename Size Change
dist/array.full.es5.js 231 kB -28.1 kB (-10.85%) 👏
dist/array.full.js 336 kB -26.2 kB (-7.23%)
dist/array.full.no-external.js 335 kB -26.2 kB (-7.25%)
dist/array.js 150 kB -26.6 kB (-15.09%) 👏
dist/array.no-external.js 149 kB -26.6 kB (-15.17%) 👏
dist/main.js 151 kB -26.6 kB (-15.02%) 👏
dist/module.full.js 336 kB -26.2 kB (-7.23%)
dist/module.full.no-external.js 335 kB -26.2 kB (-7.25%)
dist/module.js 150 kB -26.6 kB (-15.08%) 👏
dist/module.no-external.js 149 kB -26.6 kB (-15.16%) 👏
ℹ️ View Unchanged
Filename Size
dist/all-external-dependencies.js 206 kB
dist/customizations.full.js 12.6 kB
dist/dead-clicks-autocapture.js 14.4 kB
dist/exception-autocapture.js 9.48 kB
dist/external-scripts-loader.js 2.48 kB
dist/recorder-v2.js 115 kB
dist/recorder.js 115 kB
dist/session-recorder.js 39.1 kB
dist/surveys-preview.js 57.6 kB
dist/surveys.js 63.3 kB
dist/tracing-headers.js 1.75 kB
dist/web-vitals.js 10.3 kB

compressed-size-action

@@ -825,7 +842,10 @@ describe('posthog core', () => {
posthog.sessionRecording = {
afterDecideResponse: jest.fn(),
startIfEnabledOrStop: jest.fn(),
} as unknown as SessionRecording
} as OnlyValidKeys<
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting... i expected this change to highlight the incorrect setup here that the as unknown is hiding

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to add tests on the loader separately from the loaded file

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.

1 participant