Skip to content
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

POC: Kibana React Error Boundary #169010

Closed
wants to merge 13 commits into from

Conversation

tsullivan
Copy link
Member

@tsullivan tsullivan commented Oct 16, 2023

Summary

Address #167159
Replaces #168054

Technical doc [Elastic internal] https://docs.google.com/document/d/1kVD3T08AzLuvRMnFrXzWd6rTQWZDFfjqmOMCoXRI-14/edit

This PR creates the KibanaErrorBoundary component and KibanaErrorService utility, and shows it in use in two main areas that control lazy-loaded UI elements:

  1. Stack Management. This PR handles the error that could occur when navigating across management apps, and async code needed to render the app failed to load.
  2. Share Menu Manager. This PR handles the error that could occur when the Share Menu Manager calls on a ShareMenuItem to render itself, and async code that is needed fails to load.

Screenshots

  • Recoverable error, in large callout
    • recoverable - callout error
  • Recoverable error, in small inline callout and toast
    • recoverable - inline error
  • Fatal error, in large calllout
    • fatal - callout error
  • Fatal error, in small inline callout and toast
    • fatal - inline error

Testing

  1. Use a script proxy in between the browser and the Kibana server. Try https://github.com/tsullivan/simple-node-proxy
  2. Script the proxy to send 404 responses for the Reporting plugin bundle, and for a bundle of some Management app.
  3. Try the Share > CSV menu in Discover. It should be blocked, and handled with a toast message. Buttons in the toast should work.
  4. Try the management app. It should be blocked, and handled with an EuiCallout. Refresh button and EuiAccordion should work.

@tsullivan tsullivan added Meta Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) labels Oct 16, 2023
@kibana-ci
Copy link
Collaborator

kibana-ci commented Oct 16, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #14 / AppContainer should call setIsMounting(false) if mounting throws

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
core 486 493 +7
share 72 79 +7
total +14

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/shared-ux-error-boundary - 4 +4

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
share 5.5KB 5.0KB -490.0B

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/shared-ux-error-boundary - 1 +1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
core 367.4KB 374.4KB +7.0KB
share 52.0KB 59.4KB +7.4KB
total +14.3KB
Unknown metric groups

API count

id before after diff
@kbn/shared-ux-error-boundary - 6 +6

ESLint disabled line counts

id before after diff
@kbn/shared-ux-error-boundary - 2 +2

Total ESLint disabled count

id before after diff
@kbn/shared-ux-error-boundary - 2 +2

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @tsullivan

@tsullivan
Copy link
Member Author

closing this as the design isn't solidified, and we don't know if we want to take on this level of scope for the project

@tsullivan tsullivan closed this Oct 23, 2023
@tsullivan tsullivan deleted the sharedux/error-boundary-poc branch September 5, 2024 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:build-storybooks Meta Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants