The app clients are performing several transformations locally on HTML content. In order to reduce code duplication, the apps teams are moving this code into the #wikimedia-page-library and sharing it by adding this library as a dependency of the apps.
Instead of doing these locally, we should move as many of these as possible into the PCS so that clients have to do less processing. As another benefit, the more of this code we can integrate at the PCS layer, the more closely we can preview the display of pages without running app code.
We should evaluate each transform and determine if possible and how to best integrate it into the PCS. Ideally we are performing these transformations.
[x] Run LeadIntroductionTransform (to move the first paragraph up)
[p] Expose pagelib CSS (needed for EditTransform)
[p] Run EditTransform (to add edit pencils)
[p] RedLinks
[p] WidenImage
[] FooterTransformer
[] ThemeTransform - classifyElements [Annotate elements with CSS classes that can be used by CSS rules. The classes themselves are not theme-dependent so classification only need only occur once]
Probably later:
[] Run CollapseTable: uses window.dispatchEvent, need to separate that from DOM transformations. In MCS we probably only want to do the DOM transformations.
[] Run LazyLoadTransform
Out of scope (client specific):
[] ThemeTransform - actual theme selection (done on root `html` element)
[] DimImagesTransform? (client setting for dark themes, etc.)