Add support for owner stacks#48782
Closed
rickhanlonii wants to merge 1 commit into
Closed
Conversation
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D68285628 |
7a294ea to
0d093d6
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D68285628 |
rickhanlonii
added a commit
to rickhanlonii/react-native
that referenced
this pull request
Jan 19, 2025
Summary: React currently has a babel transform to replace all `console.error` calls with a special function for RN and www. The function adds component stacks, which doesn't make sense in an owner stack world because: - not all console.error calls are replaced, creating inconsistency - oss web users don't append component stacks to console.log any more - component stacks can be accessed for DEV modals like logbox with `captureOwnerStack` - owner stacks are already added to the console with createTask if you use console.error directly - the redirection is the single greatest source of fragility in the logbox reporting pipeline So we're removing this as part of the owner stack rollout. This should only be enabled with owner stacks. ## Example Screen Before: {F1974436644} After: {F1974436645} [General][Added] - Add full owner stack support to React Native Differential Revision: D68285628
0d093d6 to
f00be8b
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D68285628 |
rickhanlonii
added a commit
to rickhanlonii/react-native
that referenced
this pull request
Jan 20, 2025
Summary: React currently has a babel transform to replace all `console.error` calls with a special function for RN and www. The function adds component stacks, which doesn't make sense in an owner stack world because: - not all console.error calls are replaced, creating inconsistency - oss web users don't append component stacks to console.log any more - component stacks can be accessed for DEV modals like logbox with `captureOwnerStack` - owner stacks are already added to the console with createTask if you use console.error directly - the redirection is the single greatest source of fragility in the logbox reporting pipeline So we're removing this as part of the owner stack rollout. This should only be enabled with owner stacks. ## Example Screen Before: {F1974436644} After: {F1974436645} [General][Added] - Add full owner stack support to React Native Differential Revision: D68285628
rickhanlonii
added a commit
to rickhanlonii/react-native
that referenced
this pull request
Jan 20, 2025
Summary: React currently has a babel transform to replace all `console.error` calls with a special function for RN and www. The function adds component stacks, which doesn't make sense in an owner stack world because: - not all console.error calls are replaced, creating inconsistency - oss web users don't append component stacks to console.log any more - component stacks can be accessed for DEV modals like logbox with `captureOwnerStack` - owner stacks are already added to the console with createTask if you use console.error directly - the redirection is the single greatest source of fragility in the logbox reporting pipeline So we're removing this as part of the owner stack rollout. This should only be enabled with owner stacks. ## Example Screen Before: {F1974436644} After: {F1974436645} [General][Added] - Add full owner stack support to React Native Differential Revision: D68285628
Summary: React currently has a babel transform to replace all `console.error` calls with a special function for RN and www. The function adds component stacks, which doesn't make sense in an owner stack world because: - not all console.error calls are replaced, creating inconsistency - oss web users don't append component stacks to console.log any more - component stacks can be accessed for DEV modals like logbox with `captureOwnerStack` - owner stacks are already added to the console with createTask if you use console.error directly - the redirection is the single greatest source of fragility in the logbox reporting pipeline So we're removing this as part of the owner stack rollout. This should only be enabled with owner stacks. ## Example Screen Before: {F1974436644} After: {F1974436645} [General][Added] - Add full owner stack support to React Native Reviewed By: hoxyq Differential Revision: D68285628
f00be8b to
9b52cef
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D68285628 |
Contributor
|
This pull request has been merged in 967ef32. |
Collaborator
|
This pull request was successfully merged by @rickhanlonii in 967ef32 When will my fix make it into a release? | How to file a pick request? |
EvanBacon
reviewed
Apr 4, 2025
Comment on lines
+198
to
+200
| if (!hasComponentStack(args) && React.captureOwnerStack != null) { | ||
| stack = React.captureOwnerStack(); | ||
| if (!hasComponentStack(args)) { |
Contributor
There was a problem hiding this comment.
Why does this get called twice, is args mutated between invocations?
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.
Summary:
React currently has a babel transform to replace all
console.errorcalls with a special function for RN and www. The function adds component stacks, which doesn't make sense in an owner stack world because:captureOwnerStackSo we're removing this as part of the owner stack rollout. This should only be enabled with owner stacks.
Example Screen
Before:

After:

[General][Added] - Add full owner stack support to React Native
Differential Revision: D68285628