https://bugzilla.wikimedia.org/show_bug.cgi?id=26814

--- Comment #3 from Krinkle <krinklem...@gmail.com> 2011-05-04 20:44:29 UTC ---
With legacy importScript('Namespace:Title') this tracking object and
"preventing doubles" was a easy solution for wikis to be loading scripts from
multiple places and making sure libraries and common scripts are only loaded
once (sort of a dependancy stack on top of scripts. They listed the depending
scripts on top inside importScript()).

Such as: Many scripts/gadgets on Commons have importScript('MD5.js');

For wiki-pages this is useful, but for URLs this sometimes introduced bugs,
such as:

* Dynamic content from static urls (ie. polling the recentchanges API, later
requests should not be ignored)
* Synchronous/on-the-fly resources that are order dependant will function wrong
if loaded (also) early.
* CSS may cascade the wrong way (rare though, likely result of bad practices)

I suggest WONTFIXing this. The dependancy tree and prevention of double-loading
will be taken care of by Gadgets.

Although there are a few ways to not including the same twice, here's an
example for the MD5.js library.
* It would be defined as a (hidden?) resource-loader gadget.
* For other gadgets: Remove importScript('MD5.js') and add [dependancies:MD5]
to the definition instead.
* For user scripts: Replace importScript('MD5.js') with mw.loader.using(
'ext.gadget.MD5', MyScript.initFunction );

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to