[dojo-contributors] dojo/has Tags

Bill Keese bill at dojotoolkit.org
Tue Jun 12 02:25:55 EDT 2012

On Mon, Jun 11, 2012 at 4:05 PM, Kitson Kelly <kitson.kelly at asseverate.co.uk
> wrote:

> One of the things that I thought I would table that might warrant further
> thoughts/consideration, is that we have the addition of has tags being
> added to the code base, which is good, but potentially in a non-organised
> fashion, nor, that I am aware of, an agreed standard.  With them
> distributed throughout the code, it is hard to tell where we
> might indadvertedly introduce regressions.  I did a grep against the
> current trunk and updated the reference-guide:
> http://livedocs.dojotoolkit.org/dojo/has.
> Does the Doc Parser (and the next version of the API document) properly
> recognise these and do we have something inline in the documentation that
> allows developers to properly comment what their tag does?

Rawld has a transform that pulls out the list of has() flags  but I don't
think the doc parser has anything... maybe it should since it's good at
parsing comments, but of course alternately we can just keep track of the
has() flags manually, like you've done.   I had to keep track of them
manually anyway, in order to create the webkitMobile build profile.

> Should we be more clear on how tags are introduced, named, managed, etc?

I'm definitely +1 on better managing the names of has() flags.   And it
might even be worse than inconsistent naming; I think we might even have
some duplicates.

>  I have noticed that some of the code base requires "dojo/sniff" and then
> calls it "has" as the return argument.  IMO, that makes for a bit of
> confusing code.

There was a long debate about that on dojo-contributors, because it's
convenient, but confusing.     Note that IIUC the code needs to say
has("ie") rather than sniff("ie") in order for the build tool to do it's
automatic replacement (for a build like webkitMobile), mapping has("ie") to

>  I see advantages of registering has tags in the modules that most relate
> to them, but I also potentially see benefits of loadable "library" of
> modules that are maintained in one area of the code base.
IIRC Kris was adamant about registering tags in the modules that use them,
rather than a central place, but that's assuming that only one module is
using them.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-contributors/attachments/20120612/75742ebf/attachment.htm 

More information about the dojo-contributors mailing list