Page MenuHomePhabricator

Deprecate and remove Parser::clearState()
Open, Needs TriagePublic

Description

Only caller is Kartographer extension:
https://gerrit.wikimedia.org/g/mediawiki/extensions/Kartographer/+/ccb3b46ad3974103fa4d3eacbf332ccc3e1badc0/includes/ApiSanitizeMapData.php#49

and it probably has no effect there. We shouldn't be recycling parser objects, just create a new one for your parse.

Event Timeline

Please be aware that in the current parser implementation, some extensions use the onClearState hook provided by MediaWiki. Are you planning on removing that too?

If this is the case, I would love to take a look at this patch for the Variables extension and the discussion about the necessity of the use of this hook for the extension. If we find a solution which works there (possibly by adding a hook to the ParserOutput constructor), it will work for all these extensions, except maybe for TemplateStyles.