-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add React Native V6 Changes #11320
base: master
Are you sure you want to change the base?
Add React Native V6 Changes #11320
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Bundle ReportChanges will increase total bundle size by 49.45kB (0.35%) ⬆️. This is within the configured threshold ✅ Detailed changes
|
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.
Phew, what a PR!! I've made some language suggestions, but overall this looks really good.
|
||
You can access the global scope via `Sentry.getGlobalScope()`. | ||
|
||
Note that the global scope can only be used to write data, not to capture events. Events can only be captured on the current scope (e.g. `getCurrentScope().captureException()` and similar APIs). |
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.
Note that the global scope can only be used to write data, not to capture events. Events can only be captured on the current scope (e.g. `getCurrentScope().captureException()` and similar APIs). | |
Note, that the global scope can only be used to write data, not to capture events. Events can only be captured on the current scope (for example, `getCurrentScope().captureException()` and similar APIs). |
|
||
### Isolation Scope | ||
|
||
The isolation scope is used to isolate events from each other. For example, each request in a web server might get its own isolation scope, so that events from one request don't interfere with events from another request. In most cases, you'll want to put data that should be applied to your events on the isolation scope - which is also why all `Sentry.setXXX` methods, like `Sentry.setTag()`, will write data onto the currently active isolation scope. A classic example for data that belongs on the isolation scope is a user - each request may have a different user, so you want to make sure that the user is set on the isolation scope. |
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.
The isolation scope is used to isolate events from each other. For example, each request in a web server might get its own isolation scope, so that events from one request don't interfere with events from another request. In most cases, you'll want to put data that should be applied to your events on the isolation scope - which is also why all `Sentry.setXXX` methods, like `Sentry.setTag()`, will write data onto the currently active isolation scope. A classic example for data that belongs on the isolation scope is a user - each request may have a different user, so you want to make sure that the user is set on the isolation scope. | |
The isolation scope is used to isolate events from each other. For example, each request in a web server might get its own isolation scope, so that events from one request don't interfere with events from another. In most cases, you'll want to put data that should be applied to your events on the isolation scope. This is why all `Sentry.setXXX` methods, like `Sentry.setTag()` will write data onto the currently active isolation scope. A classic example of data that belongs on the isolation scope is user data, where each request may have a different user, so you'd want to make sure that the user is set on the isolation scope. |
In the browser, the isolation scope is never forked, because it is impossible | ||
to keep track of where an isolation scope would belong to. Because of this, in | ||
the browser the isolation scope is effectively global. |
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.
In the browser, the isolation scope is never forked, because it is impossible | |
to keep track of where an isolation scope would belong to. Because of this, in | |
the browser the isolation scope is effectively global. | |
In the browser, the isolation scope is never forked because it's impossible to keep track of where an isolation scope would belong. This is why the isolation scope is effectively global in the browser. |
When you call a global function such as <PlatformIdentifier name="capture-event" /> internally Sentry | ||
discovers the current hub and asks it to capture an event. Internally the hub will | ||
then merge the event with the topmost scope's data. | ||
Note that the isolation scope can only be used to write data, not to capture events. Events can only be captured on the current scope (e.g. `getCurrentScope().captureException()` and similar APIs). |
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.
Note that the isolation scope can only be used to write data, not to capture events. Events can only be captured on the current scope (e.g. `getCurrentScope().captureException()` and similar APIs). | |
Note, that the isolation scope can only be used to write data, not to capture events. Events can only be captured on the current scope (for example, `getCurrentScope().captureException()` and similar APIs). |
The current scope is the local scope that is currently active. Unlike the rarely-forked isolation scope, the current scope may be forked more frequently and under the hood. It can be used to store data that should only be applied to specific events. In most cases, you should not access this scope directly, but use `Sentry.withScope` to create a new scope that is only active for a specific part of your code: | ||
|
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.
The current scope is the local scope that is currently active. Unlike the rarely-forked isolation scope, the current scope may be forked more frequently and under the hood. It can be used to store data that should only be applied to specific events. In most cases, you should not access this scope directly, but use `Sentry.withScope` to create a new scope that is only active for a specific part of your code: | |
Current scope is the local scope that's currently active. Unlike the rarely-forked isolation scope, the current scope may be forked more frequently and under the hood. It can be used to store data that should only be applied to specific events. In most cases, you shouldn't access this scope directly, but use `Sentry.withScope` to create a new scope that's only active for a specific part of your code: | |
|
||
### ignoreEmptyBackNavigationTransactions | ||
|
||
Does not sample transactions that are from routes that have been seen any more and don't have any spans. This removes a lot of the clutter as most back navigation transactions are now ignored. The default value is `true`. |
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.
Does not sample transactions that are from routes that have been seen any more and don't have any spans. This removes a lot of the clutter as most back navigation transactions are now ignored. The default value is `true`. | |
This ensures that transactions that are from routes that are no longer being seen and don't have any spans, are not being sampled. This removes a lot of clutter, making it so that most back navigation transactions are now ignored. The default value is `true`. |
Please let me know if I changed the meaning too much here.
|
||
### enableTabsInstrumentation | ||
|
||
Instrumentation will create a transaction on tab change. By default only navigation commands create transactions. The default value is `false`. |
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.
Instrumentation will create a transaction on tab change. By default only navigation commands create transactions. The default value is `false`. | |
This instrumentation will create a transaction on tab change. By default, only navigation commands create transactions. The default value is `false`. |
|
||
### ignoreEmptyBackNavigationTransactions | ||
|
||
Does not sample transactions that are from routes that have been seen any more and don't have any spans. This removes a lot of the clutter as most back navigation transactions are now ignored. The default value is `true`. |
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.
Does not sample transactions that are from routes that have been seen any more and don't have any spans. This removes a lot of the clutter as most back navigation transactions are now ignored. The default value is `true`. | |
This ensures that transactions that are from routes that are no longer being seen and don't have any spans, are not being sampled. This removes a lot of clutter, making it so that most back navigation transactions are now ignored. The default value is `true`. | |
|
||
### ignoreEmptyBackNavigationTransactions | ||
|
||
Does not sample transactions that are from routes that have been seen any more and don't have any spans. This removes a lot of the clutter as most back navigation transactions are now ignored. The default value is `true`. |
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.
Does not sample transactions that are from routes that have been seen any more and don't have any spans. This removes a lot of the clutter as most back navigation transactions are now ignored. The default value is `true`. | |
This ensures that transactions that are from routes that are no longer being seen and don't have any spans, are not being sampled. This removes a lot of clutter, making it so that most back navigation transactions are now ignored. The default value is `true`. | |
|
||
## Notes | ||
|
||
- This instrumentation supports React Navigation version 5 and above. If you use React Navigation version 4, see the [instrumentation for React Navigation V4](/platforms/react-native/tracing/instrumentation/react-navigation-v4/). | ||
- This instrumentation supports React Navigation version 5 and above. Starting the SDK version 6 React Navigation 4 is not supported, please upgrade. |
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.
- This instrumentation supports React Navigation version 5 and above. Starting the SDK version 6 React Navigation 4 is not supported, please upgrade. | |
- This instrumentation supports React Navigation version 5 and above. Starting with SDK version 6, React Navigation version 4 will no longer be supported. Please upgrade. |
DESCRIBE YOUR PR
Sentry React Native V6 changes.
Migration guide will be in separate PR.
IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.