Skip to content

Tree: Reduce prop drilling to File

Warren Gifford requested to merge og/tree-refactoring into main

Created by: oleggromov

Description

When I saw one of the recent changes with adding symbols, I realised it only adds to the existing prop drilling issue we've got in the Tree-related components.

Although originally I intended to put almost everything used down the component tree into the TreeRootContext, unfortunately, it doesn't necessarily make code better as there's ChildTreeLayer and TreeLayer that can render each other and use this context in lifecycle methods, which is not as easily changed as in functional components. And without changing these two cornerstone components, the bigger refactoring I imagined doesn't really change things much.

So this PR only removes prop drilling to the FIle and Symbols components, as they're able to pluck them from the context.

The conclusion is: once we want any massive changes to the Tree, we would need to refactor it massively.

Test plan

  1. Pull the branch
  2. Run the app locally
  3. Make sure you opted in for using "Simple UI"
  4. Navigate a few example repos and see that things work as previously:

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Loading