Refactor Error Dialog Logging#18487
Merged
Merged
Conversation
componentName is not necessary and is misleading when the error is caused elsewhere in the stack. The stack is sufficient. The many error boundary fields are unnecessary because they can be inferred by the boundary itself.
If it was possible, it would've been done in createCapturedValue.
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit c2470ce:
|
gaearon
reviewed
Apr 4, 2020
| const capturedError = { | ||
| componentStack: errorInfo.stack !== null ? errorInfo.stack : '', | ||
| error: errorInfo.value, | ||
| errorBoundary: |
Collaborator
There was a problem hiding this comment.
I think you can drop this field. https://github.com/facebook/react-native/blob/21733641a8f1da6d6721618a0180509ab2b080a1/Libraries/Core/ReactFiberErrorDialog.js#L31
And maybe remove things from the type on their end.
Details of bundled changes.Comparing: 59fd09c...c2470ce react-dom
react-native-renderer
react-art
react-test-renderer
Size changes (stable) |
Details of bundled changes.Comparing: 59fd09c...c2470ce react-native-renderer
react-test-renderer
react-dom
react-art
ReactDOM: size: 0.0%, gzip: -0.0% Size changes (experimental) |
gaearon
approved these changes
Apr 4, 2020
Collaborator
gaearon
left a comment
There was a problem hiding this comment.
Looks good. Verify it on WWW (both sites)?
js1 upgrade react --pr 18487
This avoids needing this in the npm published case.
facebook-github-bot
pushed a commit
to facebook/react-native
that referenced
this pull request
Apr 4, 2020
Summary: Removed in facebook/react#18487 Changelog: [React Core] Logging changes Reviewed By: gaearon Differential Revision: D20853086 fbshipit-source-id: 4b0002f21269f415769a2ac8305ba5750245f7d1
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.
This stops passing "componentName" and some unnecessary fields to the custom error dialogs. This information is arguably misleading.
This is the only use case we have for getComponentName in PROD other than getting stacks but I'm going to use a different technique for prod stacks which will let me get rid of it in prod if I just remove this.
You'd think that this wouldn't affect the prod bundle but the indirect way this is wired up means that we include the code that should only be used by FB forks in the npm bundles as unused code. So I cleaned that up as well.