-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
chore: Add migration docs for Hub
#10126
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I prefer this table over the list we keep below (see other comment)
WDYT about mentioning getCurrentHub
, too here? It's probably the most common way how users interact with the Hub API
Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
MIGRATION.md
Outdated
| `new Hub()` | `withScope()`, `withIsolationScope()` or `new Scope()` | | ||
| hub.isOlderThan() | REMOVED - Was used to compare `Hub` instances, which are gonna be removed. | | ||
| hub.bindClient() | A combination of `scope.setClient()` and `client.setupIntegrations()` | | ||
| hub.pushScope() | Best replaced with `withScope()` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| hub.pushScope() | Best replaced with `withScope()` | | |
| hub.pushScope() | `Sentry.withScope()` | |
MIGRATION.md
Outdated
| hub.isOlderThan() | REMOVED - Was used to compare `Hub` instances, which are gonna be removed. | | ||
| hub.bindClient() | A combination of `scope.setClient()` and `client.setupIntegrations()` | | ||
| hub.pushScope() | Best replaced with `withScope()` | | ||
| hub.popScope() | When used in combination with `hub.pushScope()` best replaced with `withScope()` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| hub.popScope() | When used in combination with `hub.pushScope()` best replaced with `withScope()` | | |
| hub.popScope() | `Sentry.withScope()` | |
MIGRATION.md
Outdated
| hub.pushScope() | Best replaced with `withScope()` | | ||
| hub.popScope() | When used in combination with `hub.pushScope()` best replaced with `withScope()` | | ||
| hub.withScope() | `withScope()` | | ||
| getClient() | `scope.getClient` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| getClient() | `scope.getClient` | | |
| getClient() | `Sentry.getClient()` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
users should never use scope.getClient()
in the future, as we want to cascade the clients in v8 (so it is only set on the isolation scope).
MIGRATION.md
Outdated
| hub.popScope() | When used in combination with `hub.pushScope()` best replaced with `withScope()` | | ||
| hub.withScope() | `withScope()` | | ||
| getClient() | `scope.getClient` | | ||
| getScope() | REMOVED - Scopes are used directly now. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| getScope() | REMOVED - Scopes are used directly now. | | |
| getScope() | `Sentry.getCurrentScope()` to get the currently active scope | |
MIGRATION.md
Outdated
| hub.bindClient() | A combination of `scope.setClient()` and `client.setupIntegrations()` | | ||
| hub.pushScope() | Best replaced with `withScope()` | | ||
| hub.popScope() | When used in combination with `hub.pushScope()` best replaced with `withScope()` | | ||
| hub.withScope() | `withScope()` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| hub.withScope() | `withScope()` | | |
| hub.withScope() | `Sentry.withScope()` | |
MIGRATION.md
Outdated
| captureException() | `scope.captureException()` | | ||
| captureMessage() | `scope.captureMessage()` | | ||
| captureEvent() | `scope.captureEvent()` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| captureException() | `scope.captureException()` | | |
| captureMessage() | `scope.captureMessage()` | | |
| captureEvent() | `scope.captureEvent()` | | |
| captureException() | `Sentry.captureException()` | | |
| captureMessage() | `Sentry.captureMessage()` | | |
| captureEvent() | `Sentry.captureEvent()` | |
IMHO users should avoid using these on the scope directly, just use the global methods.
MIGRATION.md
Outdated
| addBreadcrumb() | `scope.addBreadcrumb()` | | ||
| setUser() | `scope.setUser()` | | ||
| setTags() | `scope.setTags()` | | ||
| setExtras() | `scope.setExtras()` | | ||
| setTag() | `scope.setTag()` | | ||
| setExtra() | `scope.setExtra()` | | ||
| setContext() | `scope.setContext()` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| addBreadcrumb() | `scope.addBreadcrumb()` | | |
| setUser() | `scope.setUser()` | | |
| setTags() | `scope.setTags()` | | |
| setExtras() | `scope.setExtras()` | | |
| setTag() | `scope.setTag()` | | |
| setExtra() | `scope.setExtra()` | | |
| setContext() | `scope.setContext()` | | |
| addBreadcrumb() | `Sentry.addBreadcrumb()` | | |
| setUser() | `Sentry.setUser()` | | |
| setTags() | `Sentry.setTags()` | | |
| setExtras() | `Sentry.setExtras()` | | |
| setTag() | `Sentry.setTag()` | | |
| setExtra() | `Sentry.setExtra()` | | |
| setContext() | `Sentry.setContext()` | |
MIGRATION.md
Outdated
| setExtra() | `scope.setExtra()` | | ||
| setContext() | `scope.setContext()` | | ||
| configureScope() | REMOVED - Scopes are now the unit of concurrency. | | ||
| run() | `withScope()` or `withIsolationScope()` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| run() | `withScope()` or `withIsolationScope()` | | |
| run() | `Sentry.withScope()` or `Sentry.withIsolationScope()` | |
MIGRATION.md
Outdated
| configureScope() | REMOVED - Scopes are now the unit of concurrency. | | ||
| run() | `withScope()` or `withIsolationScope()` | | ||
| getIntegration() | `client.getIntegration()` | | ||
| startTransaction() | `startSpan()`, `startInactiveSpan()` or `startSpanManual()` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| startTransaction() | `startSpan()`, `startInactiveSpan()` or `startSpanManual()` | | |
| startTransaction() | `Sentry.startSpan()`, `Sentry.startInactiveSpan()` or `Sentry.startSpanManual()` | |
Adds documentation on how to migrate off the hub API to the MIGRATION guide. This is still a bit basic - we will expand on this once we have figured out all of our migration paths and are finalizing v8.