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

--- Comment #4 from Krinkle <krinklem...@gmail.com> 2012-03-19 13:51:15 UTC ---
All resource loader modules loaded via mw.loader are executed from a closure,
that is correct.

However the 'site' (common.js & <skinname>.js) module and 'user' module
(common.js & <skinname>.js) are not loaded via mw.loader.load. This was done to
allow shared caching of the default load batch queue. But the site and user
module aren't just loaded outside the default queue, they aren't loaded via
mw.loader.load at all.

They are loaded with a separate <script> tag directly to
load.php?module=user&only=scripts
This allows 2 things:
* separating styles into a different load (namely a <link rel=stylesheet> on
top of the page, before the content to avoid a Flash Of Unstyled Content
(FOUC))
* executing JS in the global scope for backwards compatibility (many gadgets
ask users to put 'var foobar = 123;' in the user script to set certain
variables. Those would have to be updated to 'window.foobar = 123;' to do the
same.

-- 
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
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to