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: supports reloading beforeSend for next/react/remix #83

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

feugy
Copy link
Member

@feugy feugy commented Nov 7, 2024

🖖 What's in there?

Supports updating beforeSend in next/react/remix components.

🤺 How to test?

I made some unit tests for this.

🔬Notes to reviewers

We don't think it worth supporting this with astro/sveltekit/vue/nuxt. Let's wait for use cases first.

@feugy feugy requested a review from a team November 7, 2024 10:36
Copy link

vercel bot commented Nov 7, 2024

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

Name Status Preview Comments Updated (UTC)
speed-insights-astro ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 7, 2024 10:40am
speed-insights-nextjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 7, 2024 10:40am
speed-insights-nuxt ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 7, 2024 10:40am
speed-insights-remix ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 7, 2024 10:40am
speed-insights-sveltekit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 7, 2024 10:40am
speed-insights-vue ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 7, 2024 10:40am

Copy link

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@testing-library/[email protected] None +15 2.45 MB brrianalexis, cmckinstry, dfcook, ...13 more
npm/@testing-library/[email protected] environment Transitive: eval +30 4.22 MB testing-library-bot

🚮 Removed packages: npm/@testing-library/[email protected], npm/@testing-library/[email protected], npm/@types/[email protected]

View full report↗︎

rerender(<SpeedInsights beforeSend={beforeSend} />);
expect(window.siq).toHaveLength(0);

rerender(<SpeedInsights beforeSend={beforeSend2} />);
Copy link
Collaborator

Choose a reason for hiding this comment

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

thank you for the testing!!

@@ -8,6 +8,10 @@ export function SpeedInsights(
framework?: string;
},
): JSX.Element | null {
useEffect(() => {
window.si?.('beforeSend', props.beforeSend);
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: should we only set if its not undefined?

@feugy feugy merged commit 857f881 into main Nov 7, 2024
11 checks passed
@feugy feugy deleted the damien/log-900-make-beforesend-changeable branch November 7, 2024 13:02
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.

2 participants