Evaluate and Integrate page library transforms into PCS
Closed, ResolvedPublic

Description

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)
  • RedLinks
  • WidenImage
  • 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

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.

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.)
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
bearND triaged this task as Normal priority.Mar 27 2018, 5:00 PM
bearND claimed this task.

Change 425837 had a related patch set uploaded (by BearND; owner: BearND):
[mediawiki/services/mobileapps@master] mobile-sections: use LeadIntroductionTransform from page-library

https://gerrit.wikimedia.org/r/425837

Change 425837 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] content-html: use LeadIntroductionTransform from page-library

https://gerrit.wikimedia.org/r/425837

bearND updated the task description. (Show Details)Jun 19 2018, 12:20 AM
bearND updated the task description. (Show Details)

Change 440983 had a related patch set uploaded (by BearND; owner: BearND):
[mediawiki/services/mobileapps@master] Expose page-library CSS

https://gerrit.wikimedia.org/r/440983

Change 440983 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] Expose page-library CSS

https://gerrit.wikimedia.org/r/440983

Change 441511 had a related patch set uploaded (by BearND; owner: BearND):
[mediawiki/services/mobileapps@master] Combine page-lib CSS into base CSS

https://gerrit.wikimedia.org/r/441511

Change 441512 had a related patch set uploaded (by BearND; owner: BearND):
[mediawiki/services/mobileapps@master] content-html: add section edit buttons

https://gerrit.wikimedia.org/r/441512

bearND updated the task description. (Show Details)Jun 22 2018, 12:22 AM
bearND updated the task description. (Show Details)Jun 22 2018, 12:24 AM

Change 441511 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] Combine page-lib CSS into base CSS

https://gerrit.wikimedia.org/r/441511

Change 441566 had a related patch set uploaded (by BearND; owner: BearND):
[mediawiki/services/mobileapps@master] content-html: use hideRedLinks from page-library

https://gerrit.wikimedia.org/r/441566

Change 441584 had a related patch set uploaded (by BearND; owner: BearND):
[mediawiki/services/mobileapps@master] content-html: use widenImage from page-library

https://gerrit.wikimedia.org/r/441584

bearND updated the task description. (Show Details)Jul 2 2018, 3:38 PM

Change 441566 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] content-html: use hideRedLinks from page-library

https://gerrit.wikimedia.org/r/441566

Change 441584 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] content-html: use widenImage from page-library

https://gerrit.wikimedia.org/r/441584

Change 443673 had a related patch set uploaded (by BearND; owner: BearND):
[mediawiki/services/mobileapps@master] Move pagelib CSS after RL base CSS

https://gerrit.wikimedia.org/r/443673

Change 443673 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] Move pagelib CSS after RL base CSS

https://gerrit.wikimedia.org/r/443673

bearND updated the task description. (Show Details)Jul 3 2018, 9:21 PM

Change 444324 had a related patch set uploaded (by BearND; owner: BearND):
[mediawiki/services/mobileapps@master] content-html: add section edit button for lead section, too

https://gerrit.wikimedia.org/r/444324

Seeing all the event handling set up in https://github.com/wikimedia/wikipedia-ios/blob/develop/www/js/footers.js I don't find many useful things to do in PCS. We could add the container but then we'd also have to add I18N, too. It's probably not worth at this time.

bearND updated the task description. (Show Details)Jul 7 2018, 12:40 AM
bearND updated the task description. (Show Details)Jul 9 2018, 4:36 PM

Change 441512 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] content-html: add section edit buttons

https://gerrit.wikimedia.org/r/441512

Change 445039 had a related patch set uploaded (by BearND; owner: BearND):
[mediawiki/services/mobileapps@master] content-html: theme preparation transform

https://gerrit.wikimedia.org/r/445039

bearND updated the task description. (Show Details)Jul 10 2018, 11:23 PM

Change 445073 had a related patch set uploaded (by BearND; owner: BearND):
[mediawiki/services/mobileapps@master] WIP: content-html: add lazy loading of images

https://gerrit.wikimedia.org/r/445073

Change 444324 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] content-html: add section edit button for lead section, too

https://gerrit.wikimedia.org/r/444324

Change 445039 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] content-html: theme preparation transform

https://gerrit.wikimedia.org/r/445039

Change 445073 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] content-html: add lazy loading of images

https://gerrit.wikimedia.org/r/445073

bearND updated the task description. (Show Details)Jul 19 2018, 11:13 PM
Jhernandez added a subscriber: Jhernandez.

Cool, good for now. We will revisit the collapse table transforms in the future.

Jhernandez closed this task as Resolved.Aug 6 2018, 11:52 AM