rsnext/packages/next/compiled/@next/react-dev-overlay
Nate Wienert 97b964a18f
feat(react-dev-overlay): export getErrorByType and add preventDisplay prop (#34237)
Report full parsed runtime errors over error bus, accepts preventDisplay prop to avoid showing error messages inline, while still reporting errors over the bus.

Basically, we want to handle the parsed error/stack differently in Next Live, showing a modal that sits above the content and allows users to report the issue to us. We want to have that stack trace in the issue report, so I added a new event `unhandled-error-full`.

The `preventDisplay` prop then just lets us output our own modal instead of showing the error inline, but still renders the `<RuntimeErrors />` component so it can fetch the stack and report it over the bus.

This isn't *beautiful* code per-se, but I think doing it really right would require a pretty intense re-structure of this module. I think ideally we'd have export a function to fetch of the stack that we can just expose separately - that fetch currently happens in a sub-sub-component (DevOverlay > Errors > RuntimeError). But that re-write is pretty high effort, would still require much of what we do here anyway, and would just to get a slightly less awkward API in a not very high-use area. So leaving it as-is for now, happy to revisit though if we want.

## Feature

- [x] Related issues linked using `fixes #number`

Fixes an issue with Next Live #290.

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-02-18 21:09:09 +00:00
..
client.js feat(react-dev-overlay): export getErrorByType and add preventDisplay prop (#34237) 2022-02-18 21:09:09 +00:00
mappings.wasm Pre-compile more dependencies continued (#32679) 2021-12-21 16:13:45 +01:00
middleware.js Pre-compile more dependencies continued (#32679) 2021-12-21 16:13:45 +01:00
package.json Pre-compile more dependencies continued (#32679) 2021-12-21 16:13:45 +01:00