Вопрос

I am using Komodo 8 and trying to generate cix files for dojo 1.8.1+, so I have 2 questions :

1) if I finally generate a cix file, will it work with the amd loader ? I mean will it display methods if I write that :

define(['dojo/dom-construct'], function(cons){
   cons.// <- oh it is nicely displaying list of dom-construct module methods
});

2) if first answer is yes, how I can generate a cix file ? I tried the php file dojo/util/docscripts/makeCix.php but it is full of errors, and even I correct them (quickly, no dived deeply), I get a very small file compared to the native dojo 1.3 catalog file provided. Considering the comments in makeCix.php, I suspect this file to be an old and dirty attempt, maybe before amd loader (dojo 1.7). It is a pity there are a bunch of php and pythons tools in dojo/util and Komodo macros but I am not very experienced with these...

Это было полезно?

Решение

1) No, the cix file will not work with the AMD loader. A CIX file is used to describe a visible namespace, e.g. "dojo.byId", providing the signature and documentation.

2) The dojo cix generator is quite old, so the dojo documentation format may have changed, as well as the methodology (i.e. AMD loader). Normally you can use a JSDoc comment to override what the type information Komodo thinks it is:

  define(['dojo/dom-construct'], function(cons){
     /** @type String */
     var lcons = cons;
     lcons
  });
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top