Requests for comment/ChangesList formatting

ChangesList
The list of changes on the Special:Recentchanges, Special:Watchlist and Special:RecentChangesLinked ("Related changes") are formatted using the ChangesList class or derivatives of it. There are several formats for ChangesList, including OldChangesList, EnhancedChangesList, as well, as CleanChanges provided by an extension and perhaps others.

ChangesList generally take a list or RecentChange records and one-by-one format them in a standard way, with special casing for log entries. As new types of changes become available, such as provided by extensions (e.g. Flow, Wikibase), the standard formatting does not always work well. For the OldChangesList, there is a hook for each change line, at the end, after formatting it in the standard way, where extensions can modify it or replace it. There is no equivalent hook(s) for EnhancedChanges and even if there were, certain aspects of formatting are hardcoded like formatting the recent changes flags.

The RecentChanges table now has a newish column, rc_source, which is more flexible for specifying different types of RecentChange entries. For example, 'mw.edit', 'mw.log', 'mw.new' for core RecentChange types and 'wb' and 'flow' provided by extensions.

refactor
If handling everything in the cacheEntry is too complicated or otherwise not really possible, then we might want a more overall refactoring of ChangesList code to make it more flexible.

ChangesListEntry

 * ChangesListEntry (RecentChange)
 * EnhancedChangesListEntry

ChangeLine

 * ChangeLine (interface)
 * OldChangeLine
 * EnhancedChangesUngroupedLine
 * EnhancedChangesBlockGroupLine
 * flags
 * EnhancedChangesGroupNestedEntry

ChangeLineFormatter

 * ChangeLineFormatter (interface)
 * OldChangeLineFormatter
 * EnhancedChangesBlockGroupLineFormatter

EnhancedChangesBlockGroup

 * EnhancedChangesBlockGroup
 * EnhancedChangesBlockGroupSummaryLine
 * arrow
 * flags / timestamp
 * change summary
 * EnhancedChangesBlockGroupLine[]

Other formatters

 * flags
 * character difference
 * rollback