Add App-level error boundary, referring users to GitHub issue creation (#1464)
* Add App-level error boundary, referring users to GitHub issue creation on page crashes. (#1452) * Class component is used as boundary since catching errors is apparently not yet possible with hooks. * EventListener in window was removed and replaced by error boundary's error catch, which now fires a GA exception. The fields it passes are slightly different because React uses slightly different error types. * Pre-filling issues with dynamic data is possible with POST requests to GitHub's API, but the GH web client seems to only support pre-fill based on templates. Therefore users still need to copy error info themselves. * Prefill GitHub issues with crash data. * Added package 'react-device-detect' to include device data such as OS, browser etc. in crash report. * Included error stack in issue body. * Used <code> html tag for displaying stack to user. * Slightly reduce vertical padding on code block. * Add ua-parser-js for parsing user agent. * Revert react-device-detect to ^1.6.2 (which is used for mobile detection etc. in components)
Showing
... | ... | @@ -36,6 +36,7 @@ |
"@types/rebass": "^4.0.7", | ||
"@types/styled-components": "^5.1.0", | ||
"@types/testing-library__cypress": "^5.0.5", | ||
"@types/ua-parser-js": "^0.7.35", | ||
"@types/wcag-contrast": "^3.0.0", | ||
"@typescript-eslint/eslint-plugin": "^4.1.0", | ||
"@typescript-eslint/parser": "^4.1.0", | ||
... | ... | @@ -105,6 +106,7 @@ |
"styled-system": "^5.1.5", | ||
"typechain": "^4.0.3", | ||
"typescript": "^4.2.3", | ||
"ua-parser-js": "^0.7.28", | ||
"use-count-up": "^2.2.5", | ||
"wcag-contrast": "^3.0.0", | ||
"workbox-core": "^6.1.0", | ||
... | ... |
src/utils/getUserAgent.ts
0 → 100644
Please register or sign in to comment