Subject was: Update Gadgets extension on WMF wikis This part of the thread is hereby forked to discuss MediaWiki:Common.js. I do not believe MediaWiki:Common.js should be deleted (atleast not yet), I'm merely curious what usecases people have for it which may or may not be useful to be taken into account during the upcoming revision of ResourceLoader and Gadgets.
Ildefons Stułbia wrote: > 2011/6/7 Leo Koppelkamm <diebu...@gmail.com>: >> There's usually some code (general utility fn's, some legacy >> remappings etc.) in common.js that could break a lot of stuff if >> missing. +1 on moving optional stuff to gadgets > > It depends on project. General utility functions should be available > as modules, which can be loaded when there is such need (as a > dependency to a gadget or by user/script explicitly). It makes easier > to port gadget to other projects and maintain them, when its > dependencies are well defined, so all changes can be easily tracked. > Separate modules can be directly imported, which is impossible with > overbloated MediaWiki:Common.js. > > Regards, > Ildefons Stułbia Indeed. Regardless of what it's most common purpose has become (and nobody blames anybody for any of that, becaus wikis simple do what they must, with the tools they're given).. most things that are in Common.js should not be. I think only a few things (if at all) should eventually stay in MediaWiki:Common.js. I'm having a hard time coming up with examples, but basically only stuff that is truly specific to that particular wiki and not related to end-users in any way. For example custom config variables (wgFooBar) or central enhancements such as * scripts to move custom icons to the top of the page next to the title * some kind of interaction on the Main Page that is dependant But then again, I can imagine the top-icon-script being a gadget that would be imported to our central wiki as a "global gadget" that local wikis can enable/disable and, in most cases, set to "default": "on". And something that does awesome things to the main page ? Probably something that is useful and could be made more generic for use in other wikis. So in more cases than one might think, gadgets are or will be better suited for almost anything. For example javascript libraries or jquery plugins should be stored as gadget modules that are indicated as "hidden" (or "private", the name hasn't been decided yet), which other gadgets can register as a dependancy. ie. Gadget-foo (dependancies: somelib, jquery.foobar, gadget-loremipsum) Question: Do you think MediaWiki:Common.js has future-proof usecases given the current plans ? If so, please share them in this thread. Again, nobody is threatening the existance of MediaWiki:Common.js, even if it would just be for legacy reasons (because millions of wikis are using it), it will not be removed any time in near or far future. Thanks, – Krinkle _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l