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.
- Run LeadIntroductionTransform (to move the first paragraph up)
- Expose pagelib CSS (needed for EditTransform)
- Run EditTransform (to add edit pencils)
- Run EditTransform (to add edit pencils also for lead section)
- 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]
- Run LazyLoadTransform
- Run CollapseTable: uses window.dispatchEvent, need to separate that from DOM transformations. In MCS we probably only want to do the DOM transformations.
Out of scope (client specific):
- FooterTransformer - seems more UI, requires I18N, has lots of client side event handlers
- ThemeTransform - actual theme selection (done on root html element)
- DimImagesTransform? (client setting for dark themes, etc.)