https://bugzilla.wikimedia.org/show_bug.cgi?id=33746
--- Comment #4 from Krinkle <[email protected]> 2012-01-16 09:16:23 UTC --- Declaring dependencies is not part of the code migration. The moment mw.util came into existance is also when ResourceLoader, dependencies, mw.loader et al came into existance. Just like a dependency on 'jquery.cookie', 'jquery.ui.dialog' had to be declared last year, it's no different for 'mediawiki.util' or 'mediawiki.user'. It seems to become part of migration for 1.18 because in 1.18 modules load faster and missing dependencies are more obvious. In 1.17 modules loaded less asynchronous so modules could lack a 'jquery.cookie' dependency declaration because some random extension's module (e.g. Vector's collapsible sidebar portlets) was also loading it and it happened to load just before the gadget. And that is as bad as it sounds, a concurrency problem. Contrary to PHP developers, the current status quo around JS is mostly * "it doesn't throw exceptions all over so we need not do anything" * "if I copy the line that does X to a different environment and context it does the same" (e.g. copying 2 lines from a gadget without looking at the rest of the gadget or the registry in MediaWiki:Gadgets-definition) Nobody is to blame for that but it needs to change now that gadgets are modules and not just a few lines of code. The reason gadgets are missing those dependencies is probably because things were copied and pasted out of context and it "happened to work". The syntax for dependencies is documented on Extension:Gadgets [1] - Krinkle [1] https://www.mediawiki.org/wiki/Extension:Gadgets#Format -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
