Page MenuHomePhabricator

Remove #[AllowDynamicProperties] from Parser class
Open, Needs TriagePublic

Description

This was added in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/866668 as a stopgap fix for T324890, T324891, T324901 but that usage is inconsistent with plans for async rendering and the Parser->Parsoid migration and should be reverted. Ideally we could add some sort of wfDeprecated() warning to handle this with our usual deprecation mechanism -- maybe by implementing the __get() magic method.

Communication between extension tag invocations on the same article page should in general be discouraged as it disallows independent/asynchronous rendering & caching. Often coordination between fragments can be done via a post processing hook once all the fragments are rendered. Where coordination is "necessary" it should be done via serializable data in the ParserOutput object, not via the Parser object.

Related Objects

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

This states

Where coordination is "necessary" it should be done via serializable data in the ParserOutput object, not via the Parser object.

However, it seems to me that in T300979: Ensure ParserOutput can always be combined asynchronously/out-of-order, you precisely aim to forbid such behavior. Is this indeed the case? If so, how is the relative timeframe between these two tasks? I think for MediaWiki-extensions-Variables , it should be possible to migrate to seiralizable ParserOutput data, but of course I would still require free read/write-access.

Coordination is done in a T300979-compatible fashion by having the individual fragments register metadata in the ParserOutput in a write-only fashion, then if a global reconciliation pass is needed it is done in a post-processing pass once all of the fragments have been finally composed.

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

[mediawiki/core@master] Deprecate use of dynamic properties attached to Parser

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

Change #1004257 merged by jenkins-bot:

[mediawiki/core@master] Deprecate use of dynamic properties attached to Parser

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

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

[mediawiki/core@REL1_42] Deprecate use of dynamic properties attached to Parser

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

Change #1019803 merged by jenkins-bot:

[mediawiki/core@REL1_42] Deprecate use of dynamic properties attached to Parser

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

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

[mediawiki/core@master] [Parser] Add deprecated Parser:$proofreadRenderingPages property

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

Change #1020249 merged by jenkins-bot:

[mediawiki/core@master] [Parser] Add deprecated Parser:$proofreadRenderingPages property

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

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

[mediawiki/core@master] [Parser] Add deprecated Parser::$mTemplatePath property

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

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

[mediawiki/core@REL1_42] [Parser] Add deprecated Parser:$proofreadRenderingPages property

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

Change #1020282 merged by jenkins-bot:

[mediawiki/core@master] [Parser] Add deprecated Parser::$mTemplatePath property

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

Change #1020230 merged by jenkins-bot:

[mediawiki/core@REL1_42] [Parser] Add deprecated Parser:$proofreadRenderingPages property

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

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

[mediawiki/core@REL1_42] [Parser] Add deprecated Parser::$mTemplatePath property

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

Change #1021799 merged by jenkins-bot:

[mediawiki/core@REL1_42] [Parser] Add deprecated Parser::$mTemplatePath property

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