reactpy icon indicating copy to clipboard operation
reactpy copied to clipboard

Refactor Layout Rendering

Open rmorshea opened this issue 3 years ago • 0 comments

Current Situation

The logic inside layout.py is becoming increasingly convoluted. Special edge case logic is starting to be introduced in order to handle bugs that should, in reality be handled more generally. I doubt that a new contributor would be able to groc the logic and make a contribution to this area of the code-base without a great deal of effort.

Proposed Actions

The complexity of the logic has stemmed from the increased usage of model states mutations throughout the rendering process in order to handle unforeseen cases. We should take an approach where every function which results in a new model state, instead of attaching it to the tree, returns that new model state.

Thankfully the large library of tests we've built up over time will aid in this process. I think we should be able to make these refactors with minimal impact to users as a result.

Work Items

  • [ ] clean up layout.py

rmorshea avatar Jan 27 '22 18:01 rmorshea