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

fix: some clients need web vitals directly on window #1406

Merged
merged 2 commits into from
Sep 9, 2024

Conversation

pauldambra
Copy link
Member

@pauldambra pauldambra commented Sep 9, 2024

In #1401 we moved the web vitals callbacks onto an object on the window instead of placing them directly on the window... there are more and more extensions being added on to the window - and that is no bueno

but, existing clients installed with npm may now request web vitals and look for it directly on the window but it isn't there any more - also no bueno

we can't fix this in the main bundle since its only old clients and they won't have that code, so it has to be fixed in the entrypoint file - which is what generates the web vitals file the old clients are lazily loading

Copy link

vercel bot commented Sep 9, 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 9, 2024 6:24pm

@pauldambra pauldambra added the bump patch Bump patch version when this PR gets merged label Sep 9, 2024
Copy link

github-actions bot commented Sep 9, 2024

Size Change: +64 B (+0.01%)

Total Size: 1.19 MB

Filename Size Change
dist/array.full.js 341 kB +32 B (+0.01%)
dist/web-vitals.js 10.3 kB +32 B (+0.31%)
ℹ️ View Unchanged
Filename Size
dist/array.js 157 kB
dist/exception-autocapture.js 10.4 kB
dist/main.js 157 kB
dist/module.js 157 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

@pauldambra pauldambra merged commit 8d2909a into main Sep 9, 2024
13 checks passed
@pauldambra pauldambra deleted the fix/web-vitals-fallback branch September 9, 2024 18:48
@brunomguimaraes
Copy link

Thanks for this change @pauldambra !

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

Successfully merging this pull request may close these issues.

3 participants