Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Wikitech

Make Extensions Aware of the ContentHandler

 

 

Wikipedia wikitech RSS feed   Index | Next | Previous | View Threaded


daniel at brightbyte

Oct 10, 2012, 6:52 AM

Post #1 of 11 (764 views)
Permalink
Make Extensions Aware of the ContentHandler

Hi!

I could use some help looking over extensions.

Since the ContentHandler stuff has been merged into the core, several much-used
functions and hooks have been deprecated. I have tried to find and replace all
calls in core, but a lot of extensions are still using the old stuff. They will
still work for all text-based content, but will generate a ton of warnings, and
will fail tests (and make core tests fail).

I have already posted updates for three extensions on gerrit:

* Gadgets: I3d28a3b8
* TitleBacklist: Ib3a00d89
* SpamBlacklist: I72d9ad58

So, it would be great if you (yes, you!) could help out by looking for
deprecated stuff in extensions. Grep for it and/or set $wgDevelopmentWarnings to
true on your wiki. Run test cases. See what causes warnings, and fix them.

Most prominently, the following functions have been deprecated:

* WikiPage::getText() was replaced by WikiPage::getContent()
* Revision::getText() was replaced by Revision::getContent()
* Article::getContent() was replaced by WikiPage::getContent()

The new functions all return Content objects instead of text.

Similarly, the ArticleSaveComplete hook and several more have been replaced by
hooks that use Content objects instead of page text.

Please have a look at docs/contenthandler.txt for an overview of the
architecture and a list of deprecated hooks.

-- daniel

PS: I'm unsure what level of backwarsd compatibility is desired for extensions.
I have tried to by B/C in the SpamBlacklist extension, but didn't care about it
for TitleBlacklist and Gadgets... could fix that, if it's required.


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


niklas.laxstrom at gmail

Oct 10, 2012, 8:06 AM

Post #2 of 11 (730 views)
Permalink
Re: Make Extensions Aware of the ContentHandler [In reply to]

On 10 October 2012 16:52, Daniel Kinzler <daniel [at] brightbyte> wrote:
> Hi!
>
> I could use some help looking over extensions.

What is the difference between "$content instanceof TextContent" and
"$title->getContentModel() === CONTENT_MODEL_WIKITEXT"?
-Niklas

--
Niklas Laxström

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


jeroendedauw at gmail

Oct 10, 2012, 9:21 AM

Post #3 of 11 (729 views)
Permalink
Re: Make Extensions Aware of the ContentHandler [In reply to]

Hey,

What is the difference between "$content instanceof TextContent" and
> "$title->getContentModel() === CONTENT_MODEL_WIKITEXT"?
> -Niklas
>

The former will be true for any content deriving from TextContent, which
currently includes WikitextContent, JavaScriptContent, CssContent and
RevisionTestModifyableContent. The later will only be true for
WikitextContent.

Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil.
--
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


robla at wikimedia

Oct 10, 2012, 2:37 PM

Post #4 of 11 (725 views)
Permalink
Re: Make Extensions Aware of the ContentHandler [In reply to]

On Wed, Oct 10, 2012 at 6:52 AM, Daniel Kinzler <daniel [at] brightbyte> wrote:
> Since the ContentHandler stuff has been merged into the core, several much-used
> functions and hooks have been deprecated. I have tried to find and replace all
> calls in core, but a lot of extensions are still using the old stuff. They will
> still work for all text-based content, but will generate a ton of warnings, and
> will fail tests (and make core tests fail).

I'm very worried about converting all of the extensions to use new
APIs now. If it turns out we need to revert ContentHandler, this will
make the revert that much more difficult.

I'd rather we remove deprecation warnings for the newly deprecated APIs.

Rob

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


daniel at nadir-seen-fire

Oct 10, 2012, 7:47 PM

Post #5 of 11 (722 views)
Permalink
Re: Make Extensions Aware of the ContentHandler [In reply to]

On Wed, 10 Oct 2012 14:37:47 -0700, Rob Lanphier <robla [at] wikimedia>
wrote:

> On Wed, Oct 10, 2012 at 6:52 AM, Daniel Kinzler <daniel [at] brightbyte>
> wrote:
>> Since the ContentHandler stuff has been merged into the core, several
>> much-used
>> functions and hooks have been deprecated. I have tried to find and
>> replace all
>> calls in core, but a lot of extensions are still using the old stuff.
>> They will
>> still work for all text-based content, but will generate a ton of
>> warnings, and
>> will fail tests (and make core tests fail).
>
> I'm very worried about converting all of the extensions to use new
> APIs now. If it turns out we need to revert ContentHandler, this will
> make the revert that much more difficult.
>
> I'd rather we remove deprecation warnings for the newly deprecated APIs.
>
> Rob

So use a conditional to check for the contenthandler classses/methods.

--
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


tylerromeo at gmail

Oct 10, 2012, 10:19 PM

Post #6 of 11 (720 views)
Permalink
Re: Make Extensions Aware of the ContentHandler [In reply to]

This is not a good idea. We should wait until the ContentHandler branch is
fully QAd and we are sure it will not be reverted before converting
extensions over to using it.

*--*
*Tyler Romeo*
Stevens Institute of Technology, Class of 2015
Major in Computer Science
www.whizkidztech.com | tylerromeo [at] gmail



On Wed, Oct 10, 2012 at 10:47 PM, Daniel Friesen <daniel [at] nadir-seen-fire
> wrote:

> On Wed, 10 Oct 2012 14:37:47 -0700, Rob Lanphier <robla [at] wikimedia>
> wrote:
>
> On Wed, Oct 10, 2012 at 6:52 AM, Daniel Kinzler <daniel [at] brightbyte>
>> wrote:
>>
>>> Since the ContentHandler stuff has been merged into the core, several
>>> much-used
>>> functions and hooks have been deprecated. I have tried to find and
>>> replace all
>>> calls in core, but a lot of extensions are still using the old stuff.
>>> They will
>>> still work for all text-based content, but will generate a ton of
>>> warnings, and
>>> will fail tests (and make core tests fail).
>>>
>>
>> I'm very worried about converting all of the extensions to use new
>> APIs now. If it turns out we need to revert ContentHandler, this will
>> make the revert that much more difficult.
>>
>> I'd rather we remove deprecation warnings for the newly deprecated APIs.
>>
>> Rob
>>
>
> So use a conditional to check for the contenthandler classses/methods.
>
> --
> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]
>
>
>
> ______________________________**_________________
> Wikitech-l mailing list
> Wikitech-l [at] lists
> https://lists.wikimedia.org/**mailman/listinfo/wikitech-l<https://lists.wikimedia.org/mailman/listinfo/wikitech-l>
>
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


daniel at nadir-seen-fire

Oct 10, 2012, 10:24 PM

Post #7 of 11 (720 views)
Permalink
Re: Make Extensions Aware of the ContentHandler [In reply to]

What is wrong with making extensions work right now both with and without
it?

--
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]

On Wed, 10 Oct 2012 22:19:25 -0700, Tyler Romeo <tylerromeo [at] gmail>
wrote:

> This is not a good idea. We should wait until the ContentHandler branch
> is
> fully QAd and we are sure it will not be reverted before converting
> extensions over to using it.
>
> *--*
> *Tyler Romeo*
> Stevens Institute of Technology, Class of 2015
> Major in Computer Science
> www.whizkidztech.com | tylerromeo [at] gmail
>
>
>
> On Wed, Oct 10, 2012 at 10:47 PM, Daniel Friesen
> <daniel [at] nadir-seen-fire
>> wrote:
>
>> On Wed, 10 Oct 2012 14:37:47 -0700, Rob Lanphier <robla [at] wikimedia>
>> wrote:
>>
>> On Wed, Oct 10, 2012 at 6:52 AM, Daniel Kinzler <daniel [at] brightbyte>
>>> wrote:
>>>
>>>> Since the ContentHandler stuff has been merged into the core, several
>>>> much-used
>>>> functions and hooks have been deprecated. I have tried to find and
>>>> replace all
>>>> calls in core, but a lot of extensions are still using the old stuff.
>>>> They will
>>>> still work for all text-based content, but will generate a ton of
>>>> warnings, and
>>>> will fail tests (and make core tests fail).
>>>>
>>>
>>> I'm very worried about converting all of the extensions to use new
>>> APIs now. If it turns out we need to revert ContentHandler, this will
>>> make the revert that much more difficult.
>>>
>>> I'd rather we remove deprecation warnings for the newly deprecated
>>> APIs.
>>>
>>> Rob
>>>
>>
>> So use a conditional to check for the contenthandler classses/methods.
>>
>> --
>> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


jeroendedauw at gmail

Oct 11, 2012, 4:52 AM

Post #8 of 11 (720 views)
Permalink
Re: Make Extensions Aware of the ContentHandler [In reply to]

Hey,

> What is wrong with making extensions work right now both with and without
it?

+1. I don't see any harm done in adding such conditional checks, and they
solve the problem at hand. We probably want to add them in any case, unless
breaking compatibility with MediaWiki older then 1.21 is acceptable.

Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil.
--
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


questpc at rambler

Oct 11, 2012, 4:59 AM

Post #9 of 11 (720 views)
Permalink
Re: Make Extensions Aware of the ContentHandler [In reply to]

> 11 Октябрь 2012 г. 15:53:42 пользователь Jeroen De Dauw (jeroendedauw [at] gmail) написал:
>
> Hey,
>
> > What is wrong with making extensions work right now both with and without
> it?
>
> +1. I don't see any harm done in adding such conditional checks, and they
> solve the problem at hand. We probably want to add them in any case, unless
> breaking compatibility with MediaWiki older then 1.21 is acceptable.
>
Also, it would be great, if WMF selected some old version of MediaWiki as LTS (Long Time Support) so extensions would be required to work with it. Currently that could be 1.17, first version which got ResourceLoader.
Dmitriy

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


jeroendedauw at gmail

Oct 11, 2012, 5:12 AM

Post #10 of 11 (722 views)
Permalink
Re: Make Extensions Aware of the ContentHandler [In reply to]

Hey,

> Also, it would be great, if WMF selected some old version of MediaWiki as
LTS (Long Time Support) so extensions would be required to work with it.
Currently that could be 1.17, first version which got ResourceLoader.

My observation is that most WMF maintained extensions are not maintained
with much regard to backwards compatibility but with a lot of effort being
put in replacing use of deprecated code usage quickly. They thus tend to
have compatibility broken early after MediaWiki releases. I'd be
semi-surprised to find a single one that is still compatible with 1.17 at
this point.

Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil.
--
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


questpc at rambler

Oct 12, 2012, 3:03 AM

Post #11 of 11 (722 views)
Permalink
Re: Make Extensions Aware of the ContentHandler [In reply to]

Dmitriy Sintsov.

11 Октябрь 2012 г. 16:13:02 пользователь Jeroen De Dauw (jeroendedauw [at] gmail) написал:

Hey,

> Also, it would be great, if WMF selected some old version of MediaWiki as LTS (Long Time Support) so extensions would be required to work with it. Currently that could be 1.17, first version which got ResourceLoader.

> My observation is that most WMF maintained extensions are not maintained with much regard to backwards compatibility but with a lot of effort being put in replacing use of deprecated code usage quickly. They thus tend to have compatibility broken early after MediaWiki releases. I'd be semi-surprised to find a single one that is still compatible with 1.17 at this point.

What's so major is preventing new extensions from running in 1.17? Page actions in separate classes? Router? Are these major obstacles?

Dmitriy

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Wikipedia wikitech RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.