Breakdown trees: Integrating into tree widget from @itwin/[email protected]
and above
#1207
Labels
enhancement
New feature or request
This issue lists the problems and, in some cases, solutions to them, for making it possible to integrate Tree components from
@itwin/breakdown-trees-react
into a tree widget from@itwin/[email protected]
, with as little effort as possible.Dependency requirements
The first thing that needs to be done is dependency update. Key points here:
@itwin/[email protected]
APIs and have a peer dependency on it.@itwin/breakdown-trees-react
packages must satisfy requirements of the context.Dependencies' update status
Status of updating dependencies to satisfy host's requirements:
React v17 -> v18. In turn, this required to update these:
redux
and related packages (we may be able to dropredux
altogether),@wojtekmaj/enzyme-adapter-react-17
- it doesn't look like there's an alternative for React 18, needs further investigation if we want the tests to run.This also required a few small code changes.
AppUI v5:
useResizeObserver
is removed, I replaced it with this.Tree widget:
@itwin/breakdown-trees-react
to use widget v2 - that is straightforward. However, since the host is going to use widget v3, some fiddling with dependencies is needed by the host:iTwin.js v4 - no issues, peer dependency is already on v4.
iTwinUI v3 - was on v2, but updating didn't result in any visible issues.
Summary
If all we want is to render tree components from
@itwin/breakdown-trees-react
and we're okay ignoring the tests and lint errors, it's pretty easy.However, if we're thinking about a proper component, then I suggest we start fresh, and add a new one into
tree-widget-react
itself. Rewriting this as a simple hierarchy-only (no display control, no actions) component is pretty straightforward, and I personally would feel much safer knowing that it's based on up-to-date dependencies and no hacks are required to integrate it.The text was updated successfully, but these errors were encountered: