ref(v8): change integration.setupOnce signature#11238
Merged
AbhiPrasad merged 2 commits intodevelopfrom Mar 22, 2024
Merged
Conversation
Make integration.setupOnce accept no arguments. This will allow us to easily remove addGlobalEventProcessor.
Contributor
size-limit report 📦
|
c298lee
pushed a commit
that referenced
this pull request
Mar 22, 2024
Make `integration.setupOnce` accept no arguments. This will allow us to easily remove `addGlobalEventProcessor` which is deprecated API. This also means we can remove `IntegrationFnResult`, as the type signature of the functional and class based integrations are now the same. Next up - remove `addGlobalEventProcessor`!
c298lee
pushed a commit
that referenced
this pull request
Mar 23, 2024
Make `integration.setupOnce` accept no arguments. This will allow us to easily remove `addGlobalEventProcessor` which is deprecated API. This also means we can remove `IntegrationFnResult`, as the type signature of the functional and class based integrations are now the same. Next up - remove `addGlobalEventProcessor`!
cadesalaberry
pushed a commit
to cadesalaberry/sentry-javascript
that referenced
this pull request
Apr 19, 2024
Make `integration.setupOnce` accept no arguments. This will allow us to easily remove `addGlobalEventProcessor` which is deprecated API. This also means we can remove `IntegrationFnResult`, as the type signature of the functional and class based integrations are now the same. Next up - remove `addGlobalEventProcessor`!
|
This caused a regression (PostHog/posthog-js#1205) is there a migration guide? |
Member
|
Instead of passing these in, you should just use the global methods const integration = {
setupOnce(addGlobalEventProcessor, getCurrentHub) {
// do something...
}
}Do this: const integration = {
setupOnce() {
Sentry.addEventProcessor(...);
// use respective replacement of hub
}
}We do not have good docs on this yet, we'll update them accordingly! In most places, you should not use const integration = {
processEvent(event, hint) {
// use this directly if you just want to process events
return event;
},
setup(client) {
// use this for things you want to run once on setup of your app/client
}
} |
|
Thanks! I was able to get it working here. It's a 3rd party library so they'll need to update it. |
Member
|
For reference, and people stumbling over this later, here the PR to update the docs for the integration interface: getsentry/sentry-docs#10150 |
7 tasks
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.
Make
integration.setupOnceaccept no arguments. This will allow us to easily removeaddGlobalEventProcessorwhich is deprecated API.This also means we can remove
IntegrationFnResult, as the type signature of the functional and class based integrations are now the same.Next up - remove
addGlobalEventProcessor!