[OpenAjaxIDE] more on <require>

Kin Blas jblas at adobe.com
Thu Jul 31 14:53:00 PDT 2008


> > 2. Both Kin and I think it's a little weird to specify a minVersion for
> > a library when the src is obviously a specific version. What are we
> > trying to convey with this attribute, that the IDE doesn't need to copy
> > the contents of the library folder if the user already has the
> > minVersion of the same library in his site? 
> >     - Do we not also need a version attribute for all require types
> > indicating what version the supplied file *is*?
> 
> Regarding minVersion, that attribute is part of the pair of attributes 
> which is 'name' and 'minVersion' for <require type="library" name="dojo" 
> minVersion="1.0"> and is 'library', 'minVersion' for the other <require> 
> constructions (e.g., <require type="javascript" library="dojo" 
> minVersion="1.0"). The idea is that different widgets might reference a 
> shared library from folders with different names (e.g., "dojo-release-
> 1.1.1" versus just plain "dojo") and different widgets might use slightly 
> different versions of the same library (e.g., "dojo-release-1.1.1" versus 
> "dojo-release-1.1.2"). The library's unique name (e.g., "dojo", unique due 
> to OpenAjax Registry) and its minimum version (e.g., "1.1.1" and "1.1.2") 
> would tell the IDE that two widgets could shared dojo 1.1.2.
> 
> But your comment about minVersion vs actual version is interesting. Maybe 
> we need two attributes, 'minVersion' and 'srcVersion', where 'minVersion' 
> tells the IDE that this widget can work with (e.g.,) dojo 1.1 or greater, 
> and 'srcVersion' tells the IDE exactly which version the 'src' attribute 
> is pointing to.


I was having a hard time parsing/understanding Jon's response so pardon my thinking out loud here.

The reason it seems strange to me that minVersion would be specified on a <require type="library"> tag is because my understanding of the intent for that tag/type is that the widget author is stating that any files I explicitly state as required, and tagged with the same name as this library declaration, can be found in this library's src directory.

Now I can certainly appreciate the intent of the minVersion attribute, but what does it actually mean when it is on a <require type="library"> tag? So far what I've heard is that it's supposed to convey to the consumer of the widget oam.xml file that the widget code requires functionality from a minimal version of this library. Ok, I get that, but what is the version of the library referred to in the src directory? Is there an assumption being made here that any library referred to by <require type="library> must have a library oam.xml file inside it with this versioning info? It would be much more convenient if the current version of the library being referred to was presented as an attribute <require type="library> tag so consumers don't have to traverse through the library directories. Also, we don't want to discourage widget developers that develop against libraries that haven't provided library oam.xml files yet, from producing widget oam.xml files, right?


So now let's talk about the minVersion attribute on a required file like <require type="javascript" library="dojo" ... >. How does the minVersion on a required file relate to the minVersion on the library it references? Do they have to match? If so, then it seems unnecessary to have minVersion on the actual file references. If they are allowed to be different, then what does it mean? The minVersion on the library reference must be greater or equal to the max minVersion of any file reference from that library? For example:

<require type="library" name="dojo" minVersion="1.1.2" src="dojo-1.1.2" />
<require type="javascript" library="dojo" minVersion="1.0.3" src="dojo.js" />
<require type="javascript" library="dojo" minVersion="1.1.2" src="src/data.js" />
<require type="javascript" library="dojo" minVersion="1.0.0" src="src/charting/chart.js" />

It's probably going to be easier for folks to grok if we just stick to a minVersion on the actual library <require> tag.


> > 3. Should we specify that any libraries must be listed before any
> > individual files that might be part of that library?
> 
> Regarding whether <require type="library"> having to appear before any 
> other <require> elements that use the library, I would like to hear from 
> implementers what they think. My guess is that implementers will tend to 
> parse the whole file at once (versus streaming the file) and therefore 
> when searching for elements that match <require type="library">, it is 
> easier to just look at the parsed DOM for all <require type="library"> 
> elements no matter whether they appear before or after the other <require> 
> elements that use the library.


I guess it depends on if you're trying to do something with each require file *as* you parse.

The safest bet is to read everything in and then make sense of everything.


--== Kin ==--



More information about the IDE mailing list