Page MenuHomePhabricator

Namespace classes inside the util folder
Closed, ResolvedPublic4 Estimated Story Points

Description

Move the following util classes into src folder:

  • StatsBar
  • JsSelectToInput
  • MessageWebImporter
  • StatsTable
  • TuxMessageTable
  • HTMLJsSelectToInputField

See: https://www.mediawiki.org/wiki/Extension:Translate/Namespaces to identify where to move them.

Also add strict types and remove unnecessary comments as mentioned here: https://www.mediawiki.org/wiki/Help:Extension:Translate/Developer_guide

Event Timeline

abi_ renamed this task from Move some util classes to src folder to Move 5 classes in util to src folder.May 17 2022, 5:22 AM
abi_ reassigned this task from wangombe-g to Wangombe.
abi_ updated the task description. (Show Details)
abi_ added a subscriber: wangombe-g.
abi_ triaged this task as Medium priority.May 17 2022, 5:24 AM
abi_ set the point value for this task to 4.

Change 792928 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/Translate@master] Move Translate utility classes to namespaces

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

Wangombe changed the task status from Open to In Progress.May 18 2022, 5:29 AM
Wangombe updated the task description. (Show Details)

Change 793355 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/Translate@master] Update references to classes moved to util folder

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

Change 797204 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/Translate@master] Move Translate utility classes to use namespaces

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

Change 797239 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/Translate@master] Use HTMLJsSelectToInputField with namespaces

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

Change 797255 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/Translate@master] Use TranslatePreferences::class with namespaces

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

Change 797265 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/Translate@master] Update StatsTable::class to use namespaces

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

Change 797266 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/Translate@master] update JsSelectToInput::class to use namespaces

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

Change 792928 abandoned by Wangombe:

[mediawiki/extensions/Translate@master] Move Translate utility classes to namespaces

Reason:

Broken down changes to simpler patches to simplify CR

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

Change 793355 abandoned by Wangombe:

[mediawiki/extensions/Translate@master] Update references to classes moved to util folder

Reason:

Broken down changes to simpler patches to simplify CR

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

Change 797204 abandoned by Wangombe:

[mediawiki/extensions/Translate@master] Move RevTag utility class to use namespaces

Reason:

RevTag::class should have been deprecated instead. There are currently no guidelines on how to do this so this change is no longer in consideration

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

I've removed the following from the list of classes to move under namespaces:

  • TranslatePreferences
  • RevTag
  • HTMLJsSelectToInputField

Since we eventually want to get rid of these classes or move them to a separate extension.

Instead I've now added the following classes instead:

  • MessageWebImporter
  • StatsBar
  • TuxMessageTable

Sorry about the confusion.

The patches were mostly ready I think. Is it really worth throwing them away because they will eventually be deleted? If they would be deleted within a few months, then yes of course, but “eventually” sounds rather like years. Having two (legacy and namespaced) file systems has costs (for example, I often find myself searching for a file at the wrong place, and it takes some extra seconds to navigate to the right one), so IMO the bit of additional work needed to finish and merge these changes would be worth it if these classes are likely to be around for at least a few more years.

The patches were mostly ready I think. Is it really worth throwing them away because they will eventually be deleted? If they would be deleted within a few months, then yes of course, but “eventually” sounds rather like years. Having two (legacy and namespaced) file systems has costs (for example, I often find myself searching for a file at the wrong place, and it takes some extra seconds to navigate to the right one), so IMO the bit of additional work needed to finish and merge these changes would be worth it if these classes are likely to be around for at least a few more years.

I think we can remove RevTag fairly easily, so I can submit a patch to do that.

Moving TranslatePreferences to the Translatewiki extension is not something that will happen soon but I'm not sure if TranslatePreferences belongs under the Utility namespace so we can skip that. The patch to move HTMLJsSelectToInputField to the Utility namespace is fine.

Will update the task description.

abi_ renamed this task from Move 5 classes in util to src folder to Namespace classes inside the util folder.May 30 2022, 10:14 AM
abi_ updated the task description. (Show Details)

Change 801351 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/Translate@master] Move StatsBar::class to use namespaces

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

Change 801378 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/Translate@master] Use MessageWebImporter::class with namespace

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

Change 797255 abandoned by Abijeet Patro:

[mediawiki/extensions/Translate@master] Remove TranslatePreferences:class from Translate

Reason:

The move to translatewiki repo will take time so not making this change now.

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

Change 797239 abandoned by Abijeet Patro:

[mediawiki/extensions/Translate@master] Remove HTMLJsSelectToInputField::class. Move to translatewiki repo

Reason:

The move to translatewiki repo will take time so not making this change now.

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

Change 797265 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Update StatsTable::class to use namespaces

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

Change 801351 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Remove unused StatsBar::class from Translate.

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

Change 797266 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Update JsSelectToInput::class to use namespaces

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

Change 801378 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Use MessageWebImporter::class with namespace

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

Change 803234 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/Translate@master] Move HTMLJsSelectToInputField::class to namespace

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

Change 803234 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Move HTMLJsSelectToInputField::class to namespace

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