Page MenuHomePhabricator

Move CoreParserFunctions and CoreTagHooks away from using global/static state
Open, LowPublic

Description

Aryeh submitted https://gerrit.wikimedia.org/r/c/mediawiki/core/+/451261 and https://gerrit.wikimedia.org/r/c/mediawiki/core/+/451329/ to straight up service-ify CoreParserFunctions and CoreTagHooks, but...it's not that great.

@tstarling and I discussed first splitting up the core parser functions into a few classes based on some logical grouping, and then turning those into service-y things.

Event Timeline

Can we make the "core" parser functions into an "installed by default" extension? I'd like to see the long-term trend toward reducing tight dependencies in core and making things libraries or extensions where possible. (It also serves as a use case to show that our extension APIs are "powerful enough" w/o being "too powerful".)

Most of these core parser functions don't need to be core at all. And probably some of them should be deprecated because scribunto modules are a "better" way of doing whatever they were introduced to solve. We have a linter extension which can help migrate away from those. Perhaps a small subset are really tightly-tied-to-core-parser functionality, and it would be best to reintroduce those distinctions.