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: web vitals 3000 #1401

Merged
merged 8 commits into from
Sep 9, 2024
Merged

feat: web vitals 3000 #1401

merged 8 commits into from
Sep 9, 2024

Conversation

pauldambra
Copy link
Member

@pauldambra pauldambra commented Sep 6, 2024

or at least web vitals 1000

see PostHog/posthog#24597

this PR

  • adds sample rate config (supporting client or remote config)
  • adds metrics allowlist (supporting client or remote config)
  • add more INP info to events

Copy link

vercel bot commented Sep 6, 2024

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

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Sep 7, 2024 11:15am

Copy link

github-actions bot commented Sep 6, 2024

Size Change: +12.2 kB (+1.04%)

Total Size: 1.19 MB

Filename Size Change
dist/array.full.js 341 kB +5.34 kB (+1.59%)
dist/array.js 157 kB +774 B (+0.5%)
dist/main.js 157 kB +774 B (+0.49%)
dist/module.js 157 kB +774 B (+0.5%)
dist/web-vitals.js 10.3 kB +4.53 kB (+78.27%) 🆘
ℹ️ View Unchanged
Filename Size
dist/exception-autocapture.js 10.4 kB
dist/recorder-v2.js 110 kB
dist/recorder.js 111 kB
dist/surveys-preview.js 59.8 kB
dist/surveys.js 66 kB
dist/tracing-headers.js 8.26 kB

compressed-size-action

const postHogWebVitalsCallbacks = {
onLCP,
onCLS,
onFCP,
onINP,
}

assignableWindow.postHogWebVitalsCallbacks = postHogWebVitalsCallbacks
assignableWindow.__PosthogExtensions__ = assignableWindow.__PosthogExtensions__ || {}
Copy link
Member Author

Choose a reason for hiding this comment

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

every time we add random things onto the window an angel dies (probably)

so I'm slowly moving things onto a single global object on window

this will mean we can start to type that object and have fewer (window as any) flying around the place

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump minor Bump minor version when this PR gets merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants