-
Notifications
You must be signed in to change notification settings - Fork 46.8k
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
Move ReactFiberErrorDialog RN fork into RN itself #16141
Conversation
Details of bundled changes.Comparing: d9b4c55...7af7722 react-native-renderer
Generated by 🚫 dangerJS |
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.
👍
Sorry if I've misunderstood, but you did mention that this should only be merged only after facebook/react-native#25671 lands, which it hasn't. Intentional? (I ask because I'm planning on cutting a new React alpha very soon) |
@threepointone What I really meant is that this can't be synced to RN before the RN PR lands (side note: it's landing now). It's not actually a blocker to merging or to cutting a React release. |
Good to know, thank you! |
Summary: # Context In facebook/react#16141 we imported `ReactFiberErrorDialog` unchanged from React. That implementation was not idempotent: if passed the same error instance multiple times, it would amend its `message` property every time, eventually leading to bloat and low-signal logs. The message bloat problem is most evident when rendering multiple `lazy()` components that expose the same Error reference to React (e.g. due to some cache that vends the same rejected Promise multiple times). More broadly, there's a need for structured, machine-readable logging to replace stringly-typed interfaces in both the production and development use cases. # This diff * We leave the user-supplied `message` field intact and instead do all the formatting inside `ExceptionsManager`. To avoid needless complexity, this **doesn't** always have the exact same output as the old code (but it does come close). See tests for the specifics. * The only mutation we do on React-captured error instances is setting the `componentStack` expando property. This replaces any previously-captured component stack rather than adding to it, and so doesn't create bloat. * We also report the exception fields `componentStack`, unformatted `message` (as `originalMessage`) and `name` directly to `NativeExceptionsManager` for future use. Reviewed By: cpojer Differential Revision: D16331228 fbshipit-source-id: 7b0539c2c83c7dd4e56db8508afcf367931ac71d
Along with facebook/react-native#25671, moves the RN-specific implementation of
ReactFiberErrorDialog
from React to RN. This should only be merged (and subsequently synced to RN) after facebook/react-native#25671 lands.Also, with this, React doesn't use
ExceptionsManager
directly anymore, so we remove it from the RN private interface definition.