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

ref(browser): Refactor browser integrations to use processEvent #9022

Merged
merged 3 commits into from Sep 21, 2023

Conversation

mydea
Copy link
Member

@mydea mydea commented Sep 13, 2023

This refactors browser integrations to use the new processEvent hook on the Integrations interface.

It also updates Replay to register it's event processor on the client, not globally. This is also needed to ensure the order is somewhat stable, as global processors are run separately from the client ones.

@mydea mydea self-assigned this Sep 13, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 13, 2023

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 75.58 KB (-0.03% 🔽)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 31.46 KB (-0.13% 🔽)
@sentry/browser - Webpack (gzipped) 22.06 KB (-0.16% 🔽)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 70.27 KB (-0.02% 🔽)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 28.57 KB (-0.11% 🔽)
@sentry/browser - ES6 CDN Bundle (gzipped) 20.65 KB (-0.11% 🔽)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 222.17 KB (-0.01% 🔽)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 86.57 KB (-0.11% 🔽)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 61.42 KB (-0.15% 🔽)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 31.43 KB (-0.15% 🔽)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 75.6 KB (-0.03% 🔽)
@sentry/react - Webpack (gzipped) 22.09 KB (-0.16% 🔽)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 93.48 KB (-0.02% 🔽)
@sentry/nextjs Client - Webpack (gzipped) 51.04 KB (-0.07% 🔽)

Base automatically changed from fn/integration-processEvent to develop September 15, 2023 08:07
@mydea mydea force-pushed the fn/integrations-browser branch 2 times, most recently from 16a892a to 0b42518 Compare September 15, 2023 08:39
@mydea mydea marked this pull request as ready for review September 15, 2023 08:47
}

/** @inheritDoc */
public preprocessEvent(event: Event): void {
Copy link
Member Author

Choose a reason for hiding this comment

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

I actually figured this prob. makes sense as preprocess, as we may want to generally run this before all other processing, as the other processings may want to access the request?

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

LGTM (I assume we test most of these integrations anyway in integration tests so we shouldn't need any test adjustments, right?)

@mydea
Copy link
Member Author

mydea commented Sep 15, 2023

LGTM (I assume we test most of these integrations anyway in integration tests so we shouldn't need any test adjustments, right?)

Yeah so some tests failed during implementing this (which i fixed by now), so I'd say this should be OK covered!

@mydea
Copy link
Member Author

mydea commented Sep 15, 2023

Tests currently fail because of #9034, fix WIP.

};
return event;
},
{ id: 'Replay' },
Copy link
Member

Choose a reason for hiding this comment

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

What's the id for?

Copy link
Member Author

Choose a reason for hiding this comment

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

this is used to identify which event processor dropped an event (possibly). It's optional, but figured it's good form to add this for all our own event processors!

@mydea mydea merged commit 94c68e0 into develop Sep 21, 2023
76 checks passed
@mydea mydea deleted the fn/integrations-browser branch September 21, 2023 07:23
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.

None yet

3 participants