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

--- Comment #11 from Erwin Dokter <[email protected]> 2012-01-16 21:49:47 UTC 
---
(In reply to comment #10)
> 
> I doubt that. There has never been an automatic dependency on anything.

That's because we never had ResourceLoader before.

> Remember the report last year from IE6/IE7 users about $.cookie being 
> undefined
> in Vector.js on en.wikipedia ? (I think Edokter discovered that one) That was
> very odd as it only happened to some users, but it turns out not to be a bug.
> That was a race condition and a missing dependency, IE6/7 loaded a bit slower.
> It was fixed then by not using $.cookie but the proper fix wouldl've been to
> simply add that module to do the dependencies.

I made a comment to that bug (bug 29384) just today. I think we can close that
now we know what casues it.

> (In reply to comment #9)
> > But... Since MediaWiki:Common.js is *itself* a module, surely a dependency 
> > on
> > mediawiki.util can be declared when *it* loads?
> 
> Sure it could be added as a dependency. And we probably should since so many
> users forgot to do it, but this is a very bad habbit to go into. I'd rather
> avoid it.

Note that my suggestion would only apply to MediaWiki:Common.js/User:common.js,
*because* it is the only module that has no mechanism for declaring
dependancies (I just loathe the inline wrapping method). Declaring dependencies
in MediaWiki:gadgets-defenition is fine with me, as was evidently necessary
from the start.

> I think its safe to say that there are no high usage site scripts or gadgets
> currently in production missing dependencies or document-ready hooks, 
> otherwise
> we would've had complaints already as that code is technically broken as it 
> is.

I doubt that. There are plenty of gadgets on enwiki that use ResourceLoader
without declaring there dependencies. With declaring those becoming mandatory,
that is when we will see the most problem. And I do agree they need to be
declared. But that is easy to fix. My only beef remains common.js.

If we aren't going to pre-declare mediawiki.util for common.js, I still like to
know if wrapping the entire file is absolutely necessary? Is mw.loader.using()
asynchronous or synchronous. The documentation says to use "two or three
parameter", but the source reveals that both callback parameters are optional.
So would simply putting the line "mw.loader.using('some.module');" not be
adequate? If not, would it be hard to make .using synchronous and make it
simply use return(); on completion if no callback is passed?

-- 
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

Reply via email to