To complement the Coding style discussion, I've also been looking at our current namespacing for YUI modules.
In essence, this proposal seeks to move all YUI modules to the Y
namespace, whilst still keeping things short, and simple. It also attempts to rigidly codify the structure of this namespace so that you can determine the correct location for any code that you add.
We would benefit from moving all of our YUI Moodle code to the Y
namespace as this would give us improved code isolation between different Modules. That is to say that, if moodle-form-dateselector
adds a method to Y.Node, it is only present to moodle-form-dateselector
and not in any other use of Y.Node on the same page.
I've written a proposal on the developer wiki, and would appreciate any feedback others may have.
In brief, the proposal is to use a namespace of:
Y.M.<plugin_or_system_type>[_<component>].<YUI_modulename>[.<YUI_submodule>]
Examples include:
Y.M.core.dock
Y.M.core.dock.loader
Y.M.block_navigation.navigation
Y.M.mod_assign.inlinereply
Y.M.form.dateselector
I've raised an issue in the tracker to discuss this proposal in MDL-43216.
Thank you in advance,
Andrew
Those links again: