[AXON-41] Implement AtlascodeErrorBoundary #58
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.
What is this?
This is the 1st PR in a series related to improving our observability when something goes wrong.
In React, there's a concept of an Error Boundary - a special component which is intended to address rendering errors in the tree, and which is very notably missing in our pages 😉
Further, we are already pulling @atlaskit/analytics-next as a dependency, which conveniently offers an implementation we could use.
After the changes in this PR, we can receive an event with some data on rendering errors occuring in prod:
What does this PR have, mechanically?
SendAnalytics
AtlascodeErrorBoundary
implementation and usageWhat is notably NOT included here?
react
versionAtlascodeErrorBoundary
usage in other pages - to not overwhelm reviewers further ;DHow was this tested?
I've introduced the new error boundary to our
Settings
page, and then added a special component that fails on rendering. With that, when running our settings page, it was possible to show alternative HTML on render errors, while also receiving an event in the analityics service:(all the extra components were removed during clean-up)