Page MenuHomePhabricator

Replace usages of WikiPage::prepareContentForEdit
Open, MediumPublic

Description

Status quo: WikiPage::prepareContentForEdit() provides access to PST-transformed and rendered content for pre-save or post-save processing. It uses a kind of home-brew memoization mechanism to allow callbacks to access this information while a new revision is being saved, without having to re-generate it.

The PreparedEdit object returned by prepareContentForEdit() is not sufficient for multi-content revision handling. Also, several fields exposed by it seem to be unused, or and/or have unclear semantics.

A better mechanism is needed to provide (cached?) access to PST content and rendered ParserOutput each slot, as well as a ParserOutput containing the combined rendering of all slots. Ideally, callbacks would receive a provider object as a parameter which facilitates lazy creation and caching (see T194049).

A first attempt to cover the described functionality can be found in the DerivedPageDataUpdater class proposed in https://gerrit.wikimedia.org/r/c/405015/. However, a more narrow interface should be exposed to calling code, and WikiPage should (eventually) no longer server as the factory and in-situ-cache for the provider object.

Related Objects

StatusSubtypeAssignedTask
Declineddchen
OpenNone
OpenNone
DuplicateNone
OpenFeatureNone
OpenBUG REPORTNone
OpenNone
StalledNone
OpenFeatureNone
DuplicateNone
ResolvedNone
OpenNone
OpenNone
OpenFeatureNone
OpenNone
ResolvedNone
ResolvedNone
OpenFeatureNone
OpenNone
OpenFeatureNone
StalledNone
OpenNone
Opendaniel
OpenNone
Resolveddaniel
InvalidTgr
ResolvedAnomie
ResolvedAnomie

Event Timeline

daniel triaged this task as Medium priority.May 7 2018, 1:17 PM
daniel created this task.
daniel removed daniel as the assignee of this task.May 7 2018, 1:18 PM
Vvjjkkii renamed this task from Replace usages of WikiPage::prepareContentForEdit to 9gdaaaaaaa.Jul 1 2018, 1:11 AM
Vvjjkkii raised the priority of this task from Medium to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed subscribers: Aklapper, gerritbot.
CommunityTechBot renamed this task from 9gdaaaaaaa to Replace usages of WikiPage::prepareContentForEdit.Jul 2 2018, 6:41 AM
CommunityTechBot lowered the priority of this task from High to Medium.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added subscribers: Aklapper, gerritbot.