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

Krinkle <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Krinkle <[email protected]> ---
(In reply to comment #7)
> Should adding "loaderScripts" to a previously working stanza result in an
> emitted warning:
> 
>  Error: Unknown dependency: ext.abc

Yes, because defining loaderScripts means you take over responsibility of
registering the modules. If the files provided to loaderScripts don't actually
do that, then it is a missing dependency as it is unregistered and unknown.


> Maybe it is as easy as improving the error handling here.  The developer
> should be told something like "You used 'loaderScripts' but forgot to do X".

That would require the front-end to know all the different ways and sources
that can define modules in the back-end. To the frontend they are all the same
(mw.loader.register). And it can't be evaluated in the backend because it is
javascript code that does the registering if you have a custom loaderScript.

If you use the standard loaderScript (e.g. don't define that property in the
module stanza) then it all works fine.

Error handling could be better but in this case the changes requirement to do
that are not worth the overhead and cost, which is especially hard to justify
in a framework that tries to be as efficient as it can (the loader shouldn't
make loading harder, but faster and more efficient as without its presence).

I'm afraid that in this case it is simply a matter of using a feature that is
too low-level (overr-riding the entire loader script) and as such is  allowed
to cause all kinds of errors without a clear cause, because it bypasses that by
design.

While the error is not very descriptive, it is very consistent and should be
immediately noticeable if you happen to use loaderScripts by accident. Basic
debugging should quickly lead one back to the change that caused it.

--

I improved the documentation a bit by removing mentions from common examples
(to avoid accidental misuse), and in the places I did leave it, I elaborated
the description.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to