I just noticed that ContentHandler has understandably deprecated several hooks.
However, not all the hooks have been updated as deprecated on the mw.o. Some of their replacements aren't even documented on mw.o.
Worse, there isn't any schedule for how long the legacy hooks are going to be supported or any HOWTOs for developers interested in making their extensions work in MW 1.21+..
This is especially frustrating for developers who may have used ArticleViewCustom (new in 1.19) only to have it be deprecated a year later in 1.21 for ArticleContentViewCustom.
(If anyone did use this hook in 1.19, they didn't document that use on mw.o, so we don't know about it and can't warn them about the issues that may come from this.)
Mark.
Didn't we just decide on a deprecation setup a few months ago? Marked for two majors then removed iirc
On Monday, July 22, 2013, Mark A. Hershberger wrote:
I just noticed that ContentHandler has understandably deprecated several hooks.
However, not all the hooks have been updated as deprecated on the mw.o. Some of their replacements aren't even documented on mw.o.
Worse, there isn't any schedule for how long the legacy hooks are going to be supported or any HOWTOs for developers interested in making their extensions work in MW 1.21+..
This is especially frustrating for developers who may have used ArticleViewCustom (new in 1.19) only to have it be deprecated a year later in 1.21 for ArticleContentViewCustom.
(If anyone did use this hook in 1.19, they didn't document that use on mw.o, so we don't know about it and can't warn them about the issues that may come from this.)
Mark.
Love alone reveals the true shape of the universe. -- "Everywhere Present", Stephen Freeman
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org javascript:; https://lists.wikimedia.org/mailman/listinfo/wikitech-l
No, absolutely not. Do not remove something just because it has been deprecated for two major versions.
-- Tim Starling
On 22/07/13 09:35, K. Peachey wrote:
Didn't we just decide on a deprecation setup a few months ago? Marked for two majors then removed iirc
On Monday, July 22, 2013, Mark A. Hershberger wrote:
I just noticed that ContentHandler has understandably deprecated several hooks.
However, not all the hooks have been updated as deprecated on the mw.o. Some of their replacements aren't even documented on mw.o.
Worse, there isn't any schedule for how long the legacy hooks are going to be supported or any HOWTOs for developers interested in making their extensions work in MW 1.21+..
This is especially frustrating for developers who may have used ArticleViewCustom (new in 1.19) only to have it be deprecated a year later in 1.21 for ArticleContentViewCustom.
(If anyone did use this hook in 1.19, they didn't document that use on mw.o, so we don't know about it and can't warn them about the issues that may come from this.)
Mark.
Love alone reveals the true shape of the universe. -- "Everywhere Present", Stephen Freeman
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org javascript:; https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On 07/21/2013 08:09 PM, Tim Starling wrote:
No, absolutely not. Do not remove something just because it has been deprecated for two major versions.
Do you have any recommendations for how we should handle deprecations? Is this done on a case-by-case basis?
Mark.
On Mon, Jul 22, 2013 at 8:39 AM, Mark A. Hershberger mah@everybody.orgwrote:
On 07/21/2013 08:09 PM, Tim Starling wrote:
No, absolutely not. Do not remove something just because it has been deprecated for two major versions.
Do you have any recommendations for how we should handle deprecations? Is this done on a case-by-case basis?
I would say so, yes. While the 2-version-to-deprecate is a nice rule of thumb to follow, each thing needs to be handled on its own. You should weigh the cost of keeping something around vs. the cost of breaking god knows what extension that someone has installed. Sure you can grep mw/extensions, but that only goes so far.
-Chad
On Mon, Jul 22, 2013 at 8:39 AM, Mark A. Hershberger mah@everybody.orgwrote:
Do you have any recommendations for how we should handle deprecations? Is this done on a case-by-case basis?
Most of the deprecated hooks have ContentHandler-aware replacements with compatible signatures. The mapping is as follows:
ArticleAfterFetchContent -> ArticleAfterFetchContentObject ArticleInsertComplete -> ArticleContentInsertComplete ArticleSave -> ArticleContentSave ArticleSaveComplete -> ArticleContentSaveComplete ArticleViewCustom -> ArticleContentViewCustom EditFilterMerged -> EditFilterMergedContent EditPageGetDiffContent -> EditPageGetPreviewContent EditPageGetDiffText -> EditPageGetDiffContent EditPageGetPreviewText -> EditPageGetPreviewContent
Only one deprecated hook could not be updated in this fashion: 'ShowRawCssJs'.
(If you want to see the diff of the patch that deprecated the hooks, see < https://git.wikimedia.org/commitdiff/mediawiki%2Fcore/49ed9dfdd05023cbd5d068...
)
I like the approach that Python's 2to3 tool (< http://docs.python.org/2/library/2to3.html%3E) and the 'six' library (< http://pythonhosted.org/six/%3E) take, which is to provide an interface for declaring 'moves', which map a deprecated or renamed method name to its modern equivalent. We could have something like that in core.
Daniel was diligent about adding wfDeprecated calls to the deprecated methods that the older hooks calls. I wonder if we could add a Jenkins check that flags usage of deprecated features. A sophisticated version would trace the execution of unit tests and flag diffs that activate deprecated code paths. But for starters we could just have a non-voting Jenkins job that greps diffs for deprecated hook names.
Ori
On Tue, Jul 23, 2013 at 12:19 PM, Ori Livneh ori@wikimedia.org wrote:
Daniel was diligent about adding wfDeprecated calls to the deprecated methods that the older hooks calls. I wonder if we could add a Jenkins check that flags usage of deprecated features. A sophisticated version would trace the execution of unit tests and flag diffs that activate deprecated code paths. But for starters we could just have a non-voting Jenkins job that greps diffs for deprecated hook names.
I see now that setting $wgDevelopmentWarnings = true will manifest usage of deprecated methods in PHP's error log, with E_USER_DEPRECATED. Jenkins could keep track of the number of these that are emitted by test runs and -1 changes that caused the number to go up.
I'll do my bit by enable this setting on MediaWiki-Vagrant :)
Ori
On Tue, Jul 23, 2013 at 12:31 PM, Ori Livneh ori@wikimedia.org wrote:
I see now that setting $wgDevelopmentWarnings = true will manifest usage of deprecated methods in PHP's error log, ...
I'll do my bit by enable this setting on MediaWiki-Vagrant :)
I did my bit by mentioning it in https://www.mediawiki.org/wiki/Manual:How_to_debug#PHP_errors :)
wikitech-l@lists.wikimedia.org