On 01/27/2013 07:58 PM, S Page wrote:
> How can an extension have a soft requirement on a module, so that it
> only adds that module to its ResourceLoader dependencies if the
> extension providing that module is loaded?
> 
> For example, there's no sense in depending on ext.eventLog if the wiki
> doesn't load Extension:EventLogging, but if it's available then you
> want the module sent to the browser along with your code. (Obviously
> your JS would check to see if the module's functions are available
> before invoking them.)

That's one design decision, but I don't think it's the obvious one.  In
fact, it's rather uncommon.

The way most loggers are used, you can always call the log function
(without checking, or defining your own shim), and it's up to the
logging library to be a no-op or actually log.

Matt Flaschen

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to