Skip to content

feat(core): Add afterAllSetup hook for integrations #10345

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

Merged
merged 2 commits into from
Jan 25, 2024
Merged

Conversation

mydea
Copy link
Member

@mydea mydea commented Jan 25, 2024

This adds a new hook to integrations which runs after all integrations have run their setup hooks.
This can be used to handle integrations that depend on each other.

The only timing guarantee is that afterAllSetup will be called after every integration has run setupOnce and setup.

@mydea mydea requested review from lforst, Lms24 and AbhiPrasad January 25, 2024 16:56
@mydea mydea self-assigned this Jan 25, 2024
Copy link
Contributor

github-actions bot commented Jan 25, 2024

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped) 77.88 KB (+0.05% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 69.07 KB (+0.05% 🔺)
@sentry/browser (incl. Tracing, Replay with Canvas) - Webpack (gzipped) 72.96 KB (+0.04% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 62.71 KB (+0.05% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 33.11 KB (+0.13% 🔺)
@sentry/browser (incl. Feedback) - Webpack (gzipped) 31.28 KB (+0.1% 🔺)
@sentry/browser (incl. sendFeedback) - Webpack (gzipped) 31.29 KB (+0.1% 🔺)
@sentry/browser - Webpack (gzipped) 22.54 KB (+0.19% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback) - ES6 CDN Bundle (gzipped) 75.61 KB (+0.05% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 67.16 KB (+0.05% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 33.01 KB (+0.11% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped) 24.46 KB (+0.13% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 211.47 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 99.49 KB (+0.06% 🔺)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 73.17 KB (+0.13% 🔺)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 36.11 KB (+0.12% 🔺)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 69.48 KB (+0.06% 🔺)
@sentry/react - Webpack (gzipped) 22.58 KB (+0.13% 🔺)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 86.14 KB (+0.05% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 50.44 KB (+0.08% 🔺)
@sentry-internal/feedback - Webpack (gzipped) 17.21 KB (0%)

* This hook is triggered after `setupOnce()` and `setup()` have been called for all integrations.
* You can use it if it is important that all other integrations have been run before.
*/
afterSetup?(client: Client): void;
Copy link
Member

Choose a reason for hiding this comment

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

l: wdyt about afterIntegrationsSetup or afterAllSetup? To me afterSetup conveys more that it'd be called once the integration implementing it was set up.
Don't wanna 🚲 shed to long though, I'm also fine if we leave it as is.

Copy link
Member Author

Choose a reason for hiding this comment

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

let's go with afterAllSetup then 👍

@mydea
Copy link
Member Author

mydea commented Jan 25, 2024

cc @billyvg we can also use this for the replay & replay canvas integrations I think, to make the dependency a bit simpler!

@mydea mydea changed the title feat(core): Add afterSetup hook for integrations feat(core): Add afterAllSetup hook for integrations Jan 25, 2024
@mydea mydea merged commit d64b798 into develop Jan 25, 2024
@mydea mydea deleted the fn/afterSetup branch January 25, 2024 17:40
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