Skip to content

feat(integrations): Introduce processEvent hook on Integration #9015

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

Closed
wants to merge 1 commit into from

Conversation

mydea
Copy link
Member

@mydea mydea commented Sep 13, 2023

This adds a new (optional) processEvent hook on the Integration interface, which allows to register an event processor for the current client only.

This has actually correct semantics in that the processor will only be registered for the client that the integration is added for. This is done by adding a new addEventProcessor method on the baseclient, which for now are called after all global & scope event processors.

Previously, all integrations always registered a global event processor, which is not really necessary. With this, we can be much more focused & also skip checking for existence of the integration on the client etc.

This adds a new (optional) `processEvent` hook on the `Integration` interface, which allows to register an event processor **for the current client only**.

This has actually correct semantics in that the processor will only be registered for the client that the integration is added for. This is done by adding a new `addEventProcessor` method on the baseclient, which for now are called after all global & scope event processors.
@mydea mydea self-assigned this Sep 13, 2023
@AbhiPrasad
Copy link
Member

Can we add the types first, and then do the integrations one package at a time? Makes it easier to review.

@mydea
Copy link
Member Author

mydea commented Sep 13, 2023

Can we add the types first, and then do the integrations one package at a time? Makes it easier to review.

Sure thing, makes sense 👍

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 75.41 KB (+0.02% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 31.29 KB (-0.11% 🔽)
@sentry/browser - Webpack (gzipped) 21.89 KB (-0.12% 🔽)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 70.17 KB (0%)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 28.49 KB (-0.05% 🔽)
@sentry/browser - ES6 CDN Bundle (gzipped) 20.57 KB (-0.12% 🔽)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 221.84 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 86.38 KB (+0.06% 🔺)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 61.22 KB (+0.08% 🔺)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 31.38 KB (-0.04% 🔽)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 75.43 KB (+0.02% 🔺)
@sentry/react - Webpack (gzipped) 21.92 KB (-0.11% 🔽)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 93.32 KB (+0.05% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 50.91 KB (+0.04% 🔺)

@mydea mydea closed this Sep 13, 2023
@mydea mydea deleted the fn/integration-prepareEvent branch November 17, 2023 08:28
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