ResourceLoader/Migration guide (users): Difference between revisions
Appearance
Content deleted Content added
→mw.loader: copyedit |
→Dependencies: heh |
||
Line 132: | Line 132: | ||
Note that this has been that way since day one that MediaWiki 1.17 was deployed. The only reason scripts appeared to work without declaring dependencies was that until now, it was more likely that – before your module loads –, another module has loaded which has the same dependencies as your module. |
Note that this has been that way since day one that MediaWiki 1.17 was deployed. The only reason scripts appeared to work without declaring dependencies was that until now, it was more likely that – before your module loads –, another module has loaded which has the same dependencies as your module. |
||
With MediaWiki 1.19, modules and scripts are loaded in a more |
With MediaWiki 1.19, modules and scripts are loaded in a more efficient way, therefore it is important to declare your dependencies so that ResourceLoader will make sure to load those first. Otherwise, your script will fail because any of the 100+ modules you might refer to in your code may not be loaded yet, or are never loaded at all. |
||
Two base modules are always loaded and need not be declared. These are <tt>mediawiki</tt> and <tt>jquery</tt>. |
Two base modules are always loaded and need not be declared. These are <tt>mediawiki</tt> and <tt>jquery</tt>. |