Page MenuHomePhabricator

[GOAL] Componentize Skin classes
Open, MediumPublic

Description

The Skin.php class is 2487 lines long. The SkinTemplate class is 1706. Quite a few of the latter are going to be updated to the former, so we’re likely looking at a mega class that’s 3000 lines long.

The number of lines of code make it really hard to confidently make changes to skin code. We would like to refactor this code, separating responsibilities into separate components. Each component will define a getTemplateData function.

In future:

  • We envision allowing skins to define which components their skin uses
  • Allow skins to register their own components that extend or replace the default components
  • we might borrow from some of the ideas in the Chameleon skin and allow components to generate HTML. https://youtu.be/5bea4qhsDUs

More information: https://docs.google.com/document/d/1ub78OT9Gi3a9wj9BYP7Kqtqo6kgyEebkJJ2zlJirN-w/edit
(sorry for the google doc link, please feel free to request permission or a PDF copy if you are interested - there is nothing sensitive in here)

Related Objects