Page MenuHomePhabricator

Split PageGateway
Open, MediumPublic


PageGateway.js does too much:

  • File scope response caching.
  • JSON MW API response marshaling.
  • HTML server side render marshaling.
  • HTTP client for multiple endpoints: siteinfo, mobileview.
  • HTML section rendering.

This task is about splitting it up into a few new files including:

  • Caching moves somewhere else or is deleted. Make sure you understand the consequences to callers.
  • siteinfo client moves to new gateway.
  • HTML renderer moves to a new file.
  • Server side HTML to Page marshaling moves to a new file.

Developer notes

Work out how it is being used by Talk and Edit features and determine if any of it can be thrown away.

  • Why is caching needed?
  • Why is site info needed?

Event Timeline

Restricted Application changed the subtype of this task from "Deadline" to "Task". · View Herald TranscriptOct 23 2018, 5:03 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

HTML renderer moves to a new file.

I don't see any rendering in the PageGateway - only parsing of HTML.

siteinfo client moves to new gateway.

Looking at the code here, LanguagesGateway makes sense and copying across getPageLanguages.

So I'm seeing opportunities to break this up into several pieces:

  • LanguageGateway
  • PageGateway
  • PageParser (might relate somewhat to T206335)

Splitting out the LanguageGateway, seems like a good first step here and I only see one usage in skins/MinervaNeue/resources/skins.minerva.scripts/init.js. I actually think this task as written feels a little like an "epic", given its an "epic" file used in many places.

Jdlrobson changed the task status from Open to Stalled.Nov 7 2018, 9:53 PM

Stalling this one on completion of T206036 (which has a note to reopen)

Niedzielski changed the task status from Stalled to Open.Apr 8 2019, 3:41 PM
ovasileva triaged this task as Medium priority.May 28 2019, 4:46 PM
ovasileva moved this task from Incoming to Needs Prioritization on the Readers-Web-Backlog board.