Page MenuHomePhabricator

Review and update the Examples extension
Closed, ResolvedPublic

Description

Other than ContentAction, which was touched during GCI, the code in the Examples extension hasn't really been touched for a few years. It would be nice to give it a spring clean, updating code to follow modern coding practices for MediaWiki extensions.

Additional cleaning up to-do

See Also: T97105: BoilerPlate extension should show latest coding practices

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

This project is selected for the Developer-Wishlist voting round and will be added to a MediaWiki page very soon. To the subscribers, or proposer of this task: please help modify the task description: add a brief summary (10-12 lines) of the problem that this proposal raises, topics discussed in the comments, and a proposed solution (if there is any yet). Remember to add a header with a title "Description," to your content. Please do so before February 5th, 12:00 pm UTC.

@srishakatux: The current title and description of this task are clear enough for anyone who understands what this is about. As for solutions, it's an open-ended task which can be marked resolved when someone decides that the Examples extension follows modern practices.

Related to this would also be to maintain something like MWStew to make initialising extensions easy and up to date.

Aklapper updated the task description. (Show Details)

Change 452854 had a related patch set uploaded (by D3r1ck01; owner: Alangi Derick):
[mediawiki/extensions/examples@master] Update Example extension to mordern coding practice of MW extensions

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

xSavitar added a subscriber: Qgil.

So following modern practices, the extension name would be changed from "examples" to "Example" extension to match the naming of the documentation here: https://www.mediawiki.org/wiki/Extension:Example.

Should the name be Example or Examples? Cc @Qgil, @srishakatux, your inputs please :)

Just poked around a little bit and found some inconsistency with the naming. In some places, I see that the name is examples[1] and in some I see Example[2] and in some, I see Examples[3]. So which one are we going in for see below;

[1] https://gerrit.wikimedia.org/g/mediawiki/extensions/examples
[2] https://www.mediawiki.org/wiki/Extension:Example
[3] MediaWiki-extensions-Examples

Not something that Qgil is invoked with hence removing. Thanks for working on this!

Okay @Aklapper, so could you give a helping hand with the naming? Should we go for examples, example, Examples or Example and why? Also, if we choose Example or Examples, some places (such as; Extension doc page depending on the name) would need some renaming. Thanks

Looking at the current state of the extension, one can see a trend. It seems the extension would want to have sub-extensions inside for demonstration (examples?), if so, I think the best name would be Examples. In the parent extension structure, I can see sub-extension for demo such as; ContentAction, DataPages, and Example.

In T156568#4503422, @D3r1ck01 wrote:

So following modern practices, the extension name would be changed from "examples" to "Example" extension to match the naming of the documentation here: https://www.mediawiki.org/wiki/Extension:Example.

Should the name be Example or Examples? Cc @Qgil, @srishakatux, your inputs please :)

Just poked around a little bit and found some inconsistency with the naming. In some places, I see that the name is examples[1] and in some I see Example[2] and in some, I see Examples[3]. So which one are we going in for see below;

[1] https://gerrit.wikimedia.org/g/mediawiki/extensions/examples
[2] https://www.mediawiki.org/wiki/Extension:Example
[3] MediaWiki-extensions-Examples

I personally would go for Examples it seems to make most sense and also fits common naming rules. When you finished with updating the code, renaming could be taken care of. Since it's not really deployed anywhere it shouldn't be too hard.

Change 454593 had a related patch set uploaded (by D3r1ck01; owner: Alangi Derick):
[mediawiki/extensions/examples@master] Add license file to the repository

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

Change 454596 had a related patch set uploaded (by D3r1ck01; owner: Alangi Derick):
[mediawiki/extensions/examples@master] Add documentation to missing keys in qqq.json

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

Change 454598 had a related patch set uploaded (by D3r1ck01; owner: Alangi Derick):
[mediawiki/extensions/examples@master] Add README.md file to the repository

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

Change 454599 had a related patch set uploaded (by D3r1ck01; owner: Alangi Derick):
[mediawiki/extensions/examples@master] Add package.json to the repository

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

Change 454602 had a related patch set uploaded (by D3r1ck01; owner: Alangi Derick):
[mediawiki/extensions/examples@master] Add extension.json file for extension's configs

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

Change 454604 had a related patch set uploaded (by D3r1ck01; owner: Alangi Derick):
[mediawiki/extensions/examples@master] Add JS task runner file "Gruntfile.js"

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

Change 454607 had a related patch set uploaded (by D3r1ck01; owner: Alangi Derick):
[mediawiki/extensions/examples@master] Add linter files for project configs

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

Change 452854 abandoned by D3r1ck01:
Update Example extension to mordern coding practice of MW extensions

Reason:
Broken into smaller patches: I610b44ba904e72, Iee97f1aa2ca5f3, I77684c1e97492e, Ia8c3638fe82c7f, Ifdcf1e2fb2168a, I89ff1de40eae1e and I505aa259a524e1.

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

xSavitar raised the priority of this task from Low to Medium.Aug 23 2018, 5:54 PM

Change 454596 merged by jenkins-bot:
[mediawiki/extensions/examples@master] Add documentation to missing keys in qqq.json

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

Change 454599 abandoned by D3r1ck01:
Add package.json to the repository

Reason:
Merged into this commit: Iee97f1aa2ca5f33e1878.

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

Change 454602 abandoned by D3r1ck01:
Add extension.json file for extension's configs

Reason:
Merged into this for proper CI tests: Iee97f1aa2ca5f33e18.

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

Change 454607 merged by jenkins-bot:
[mediawiki/extensions/examples@master] Add linter files for project configs

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

Change 454604 merged by jenkins-bot:
[mediawiki/extensions/examples@master] Add JS task runner file "Gruntfile.js"

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

Change 454593 merged by jenkins-bot:
[mediawiki/extensions/examples@master] Add license file to the repository

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

Change 455580 had a related patch set uploaded (by D3r1ck01; owner: Alangi Derick):
[mediawiki/extensions/examples@master] Port of extensions registration to more recent format

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

Change 454598 merged by jenkins-bot:
[mediawiki/extensions/examples@master] Add README.md file to the repository

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

Change 455580 merged by jenkins-bot:
[mediawiki/extensions/examples@master] Update Example extension with various best practices

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

Tgr updated the task description. (Show Details)
Tgr updated the task description. (Show Details)

Nitpick: why rename from Example to Examples and not the other way around? It's an example extension.

Nitpick: why rename from Example to Examples and not the other way around? It's an example extension.

Nice point @Tgr, but from what I see, it seems like it's a combination of different example(s), hence Examples. Take a look at the extension ATM to see what I'm talking about or maybe I'm missing something?

Oh, you are right, I did not realize that from looking at the patch.

xSavitar removed a project: Patch-For-Review.

I've performed a few tasks listed in the task description here. This leaves us with:

Anyone here understanding enough basics of MediaWiki extensions to be able to update the docs at https://www.mediawiki.org/wiki/Extension:Examples ?