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

Add React Native V6 Changes #11320

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

krystofwoldrich
Copy link
Member

@krystofwoldrich krystofwoldrich commented Sep 10, 2024

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.

  • Urgent deadline (GA date, etc.):
  • Other deadline: The week of 30 September the RN v6 stable version will be published
  • None: Not urgent, can wait up to 1 week+

Copy link

vercel bot commented Sep 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
changelog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 11, 2024 3:24pm
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 11, 2024 3:24pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
develop-docs ⬜️ Ignored (Inspect) Visit Preview Sep 11, 2024 3:24pm

Copy link

codecov bot commented Sep 11, 2024

Bundle Report

Changes will increase total bundle size by 49.45kB (0.35%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-server 7.5MB 49.46kB ⬆️
sentry-docs-edge-server 254.43kB 3 bytes ⬇️
sentry-docs-client 6.38MB 6 bytes ⬇️

Copy link
Contributor

@lizokm lizokm left a 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).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.

Comment on lines +57 to +59
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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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).

Comment on lines +66 to +67
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:

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- 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.

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