Page MenuHomePhabricator

Cargo adds unnecessary JS config vars to all pages
Closed, ResolvedPublic

Description

Cargo adds the following JS config variables to pages where they're not used (e.g. Special:Preferences, but it it looks like it's actually just every page):

  • wgCargoDefaultQueryLimit
  • wgCargoMapClusteringMinimum
  • wgCargoMonthNames
  • wgCargoMonthNamesShort
  • wgCargoWeekDays
  • wgCargoWeekDaysShort

Event Timeline

Yes - it looks like those variables should not be included for any special pages (other than Cargo's own Special:CargoQuery and Special:CargoExport, both of which might use them), or if the "action" (i.e., Context::getActionName()) is anything other than "view".

Your enthusiasm is appreciated, but please just stick to one microtask.

@Yaron_Koren I want to participate in gsoc24 under your mentorship, so may I know what all you expect from me ?
Like how much time or how many issues I should fix before gsoc24 ?

Please let me know how can I join you on this journey

Just one microtask would be good, however long it takes (hopefully not too long).

I discovered that three of these six global JS variables are no longer actually getting used anywhere, so I removed them in fdbbb72c559c. That still leaves three variables, though, that should be subject to this new logic.

yes @Yaron_Koren As I can clearly see that you have removed the following variables -

  1. wgCargoMonthNames
  2. wgCargoWeekDays
  3. wgCargoWeekDaysShort

And the variables to be removed are

wgCargoDefaultQueryLimit
wgCargoMapClusteringMinimum
wgCargoMonthNamesShort

Change 1008918 had a related patch set uploaded (by Jatinder1901; author: Jatinder1901):

[mediawiki/extensions/Cargo@master] Fix:Removed-Unused-Variables

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

May I Know what other changes are required here ?

The key to this bug is "pages where they're not used".

Change 1009563 had a related patch set uploaded (by Obamwonyi; author: Obamwonyi):

[mediawiki/extensions/Cargo@master] fixed unnecessary addition of JS config vars to all pages

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

Change 1008918 abandoned by Yaron Koren:

[mediawiki/extensions/Cargo@master] Fix:Removed-Unused-Variables

Reason:

Incorrect patch

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

Change #1009563 merged by jenkins-bot:

[mediawiki/extensions/Cargo@master] fixed unnecessary addition of JS config vars to all pages

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

Yaron_Koren claimed this task.