refactor: stream the analytics provider#2637
Merged
chanceaclark merged 1 commit intocanaryfrom Oct 15, 2025
Merged
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
51e3576 to
12aee6b
Compare
12aee6b to
20c0911
Compare
20c0911 to
6517a1c
Compare
jkanive
approved these changes
Oct 15, 2025
chanceaclark
added a commit
that referenced
this pull request
Oct 21, 2025
jamesqquick
pushed a commit
that referenced
this pull request
Feb 11, 2026
chanceaclark
added a commit
that referenced
this pull request
Apr 27, 2026
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.
What/Why?
This pull request implements a streamable analytics provider that optimizes the loading of Google Analytics in the root layout. The changes introduce a new
StreamableAnalyticsProvidercomponent that leverages the Streamable library to defer the loading of analytics data until after the initial page render.Key changes:
StreamableAnalyticsProvidercomponent that wraps analytics initialization in a StreamableAnalyticsProviderin the react library to usePropsWithChildrenfor better type safetyThe motivation behind this change is to prevent analytics metadata from blocking the initial page render, improving Core Web Vitals and overall user experience. Analytics data is now loaded asynchronously after the page is rendered.
Testing
Migration
No breaking changes for consumers. The analytics functionality remains the same from an end-user perspective, but now loads asynchronously for better performance.
This pull request description was generated with the assistance of AI. Portions of the code and/or implementation ideas in this PR may also have been created or influenced by AI tools.