Page MenuHomePhabricator

Add ParserOutput::addOutputData() to unify various accumulators in ParserOutput
Open, Needs TriagePublic

Description

(See T292868: Migrate boolean flags in ParserOutput to ::setFlag() or ::setOutputFlag() or ::setExtensionData() for a similar task involving boolean flags.)

ParserOutput contains a number of "accumulator" methods, which add new values to a list. The creation of the Content-Security-Policy source lists (::addExtraCSP*Src()) are good examples, but we also have some TTL maintenance operations like updateRuntimeAdaptiveExpiry() which funamentally maintain a list of possible "maximum time to live" values, and then selects the lowest of these in when ::finalizeAdaptiveCacheExpiry() is finally called.

In this task, create a new ::addOutputData() method to generalize the accumulators for Parsoid's ContentMetadataCollector interfaces so that this functionality is exposed to extensions but the full complexity is not exposed to Parsoid itself. T292868 is similar, but that task deals with boolean-valued flags. In order to maintain type safety, we'll keep the string/int accumulator methods separate from the boolean flag methods.

See also T296123: Simplify string|array argument type for ParserOutput::addModules()/::addModuleStyles()/::addJsConfigVars() which deal with another collection of accumulator methods.

Related Objects

Event Timeline

Change 740943 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/core@master] Add ParserOutput::addOutputData() to unify various ParserOutput accumulators

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

Change 740943 abandoned by C. Scott Ananian:

[mediawiki/core@master] Add ParserOutput::addOutputMetadata() to unify various ParserOutput accumulators

Reason:

Replaced by Ibd41485d5db7779f01642e2144c50ed49d409812 and I8bdffa55498d90e990af5bfc3332e3028b0a3539

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

@cscott: Removing task assignee as this open task has been assigned for more than two years - see the email sent to all task assignees on 2024-04-15.
Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome! :)
If this task has been resolved in the meantime, or should not be worked on by anybody ("declined"), please update its task status via "Add Action… 🡒 Change Status".
Also see https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator. Thanks!