0x010C / LiveRC2

GNU General Public License v2.0
3 stars 0 forks source link

What are the benefits of writing a MediaWiki extension? #2

Open Arkanosis opened 5 years ago

Arkanosis commented 5 years ago

I understand the benefits of writing a MediaWiki extension when special access is required for the tool to function, but I fail to see which is needed for LiveRC. Do you have any in mind? I believe EventStream and the Action API is all that is needed, and that are public APIs.

I have to confess that I'm not well versed at all in JavaScript packaging for MediaWiki, so I might very well have missed something important, but…

Developing LiveRC as a user script / gadget has an immense benefit, which is to be testable and hackable by pretty much anybody with only very basic JavaScript skills. You copy the code in your common.js, you press F5 and that's it. Setting up a MediaWiki extension is way above the actionability threshold for pretty much anybody apart from MediaWiki developers.

The way I see it (and I'm open to criticism), the new LiveRC is built with modern tooling (git, JS frameworks, possibly even TypeScript), but remains deployable, testable and if needed hackable by anybody. That's something I think is quite easily achievable with a tool like webpack: write code in JavaScript, TypeScript, SASS, you name it, spread it across hundreds of files if it makes it easier to manage, package it to pure JavaScript + CSS using webpack, and then anybody can deploy it as a user script. No need to be a sysop. No need to be an interface administrator. No need to be a developer. No need to be a WMF system administrator.

Local gadgets go through ResourceLoader anyway, so I don't think any approach is more efficient than the other.

Thanks!

0x010C commented 5 years ago

This is a good point. In fact, I think it will never be installed on Wikimedia wikis (because it goes in the opposite direction with the actual UI/UX directives, and it will be seen as a duplicate from the new [[Special:RecentChanges]] page).

I'm still writing this as if it was a MW extension for three reasons:

  1. It offers a pretty good code structure in my opinion;
  2. If someone in this universe outside the Wikimedia mouvment want to deploy it on its wiki, he can do it easily by just copy-pasting the entire folder in his MW instance;
  3. It allows me to test any changes really fast:
    • If I developed this as a gadget, I would have to develop everything in the MediaWiki code editor (and thus having many tabs opened in firefox, urgh...) or do a bunch of copy-paste (pfff...), save the page (and do ~4269 edits a day), re-open the code editor,...
    • I've all the files open in my code editor (which also allows me to lint my code); when I press the save button, the edited file is uploaded through SFTP on a server on which is installed a testing instance of MediaWiki with the LiveRC extension included. I've just to save a file and reload this page to test any edit.

The only server-side part is here to load the JS modules on a specific special page (and it will not go any further). That still permit to use tools like webpack to package it for the gadget deployment :)

Does this seems legit to you ?