Page MenuHomePhabricator

Upgrade Select2 in Page Forms (was formerly: Upgrade JS libraries included in Page Forms)
Open, Needs TriagePublic

Description

The Page Forms extension includes a number of JavaScript libraries, and all of them are at least somewhat in need of upgrading. In some cases, the library being used is already defunct and needs to be replaced altogether.

The JS libraries used by Page Forms, and the version being used of each one, are:

  • FancyBox - version being used is from 2010 (has been replaced by fancyBox3, which is apparently a separate library) (this was done)
  • Select2 - version being used is from 2012
  • Dynatree - version used is from 2013 (has been replaced by Fancytree - http://wwwendt.de/tech/fancytree/demo/) (this was done)
  • RateYo! - version is from 2014 (this was done)
  • jsGrid - version is from 2016

jsGrid is probably not worth upgrading at the moment, because it's still fairly recent, and Page Forms' version of it has some customizations. But the others should all get upgraded.

In MediaWiki 1.30, the version of jQuery bundled in with MediaWiki jumped from 1.11 to 3 - and when jQuery 3 is used, it leads to JS warnings for at least Dynatree and RateYo!, and possibly some of these other libraries. Additionally, there are probably useful features and bug fixes that have gone into these libraries in the intervening years.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 5 2018, 4:42 AM
Fz-29 added a subscriber: Fz-29.Jan 5 2018, 10:06 AM
D3r1ck01 added a subscriber: D3r1ck01.

I would update the libraries and see if any breaks happen.

Fz-29 added a comment.Jan 10 2018, 4:27 AM
This comment was removed by Fz-29.

Got it. Just didn't had a GCI tag, so thought why not.

Fz-29 added a comment.Jan 10 2018, 4:38 AM

Yeah, sure. I'm sorry, I got a bit confused. I thought your comment was on its subtask.

Could bower be used as a package manager to take care of the JS libraries included in Page Forms ?

Do you mean, require everyone installing Page Forms to use Bower to also install the necessary JS files?

Thinking about it, yes it would complicate the installation process. I guess it's better not to use bower.

Can I take up this task to upgrade the libraries?

@yashdeep97 - well, someone's already working on the Dynatree one, and jsGrid probably isn't worth doing, so that just leaves Select2 and FancyBox. I looked into Select2 at some point and I think it might be quite challenging. But the FancyBox upgrade may be doable. Sure, feel free to take it if you're interested.

@Yaron_Koren - Thanks! I'll work on the FancyBox upgrade then.

Change 418734 had a related patch set uploaded (by Yashdeep97; owner: Yashdeep97):
[mediawiki/extensions/PageForms@master] Upgrade FancyBox library to fancyBox3

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

Change 418734 merged by jenkins-bot:
[mediawiki/extensions/PageForms@master] Upgrade FancyBox library to fancyBox3

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

Yaron_Koren removed yashdeep97 as the assignee of this task.Mar 11 2018, 11:00 PM
Yaron_Koren updated the task description. (Show Details)
Yaron_Koren updated the task description. (Show Details)

The FancyBox upgrade has now been done, thanks to a patch from @yashdeep97, and there's also a patch in place for the Dynatree/Fancytree upgrade (https://gerrit.wikimedia.org/r/#/c/416920/), though it needs a little work. So the only upgrade really left to do is the Select2 one, and, as noted before, that's the hardest one. Still, this has been great progress.

Yaron_Koren updated the task description. (Show Details)Jan 9 2019, 1:22 AM
Yaron_Koren updated the task description. (Show Details)
Yaron_Koren renamed this task from Upgrade JS libraries included in Page Forms to Upgrade Select2 in Page Forms (was formerly: Upgrade JS libraries included in Page Forms).Feb 11 2019, 3:22 PM

I guess the following problem is related to this:

When you use the filtered format in SMW which uses a newer version of select2, you cannot have a #forminput: call on the same page where the filtered format is used. What happens is that the token-filters of the filtered format are broken as long as the forminput call is on the same page. If you remove it from the page, the token-filters work again.