Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-5481

Replace UnsafeComponent wrapper with ErrorBoundary wrapper in compass-components

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.31.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • 3
    • Not Needed
    • Iteration Utica

      We'd like to have all of Compass on one react root so that any context, like the current theme of Compass, that is in the tree can be used by contained elements. Currently the UnsafeComponent https://github.com/mongodb-js/compass/blob/main/packages/hadron-react-components/src/unsafe-component.jsx in Compass renders new react roots for the components it wraps. This makes the context not passable from compass-home to pages like compass-aggregations. The views where the unsafe component wrapper is used are the Workspace, Database, and Collection views.
      We currently have an error boundary component in compass-components which we can replace this component with, this will still catch rendering errors, and it will avoid creating more react roots.

      This will involves some style updates in Compass as UnsafeComponent currently has some styling influence.

            Assignee:
            rhys.howell@mongodb.com Rhys Howell
            Reporter:
            rhys.howell@mongodb.com Rhys Howell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: