Skip to content
Pat Mächler edited this page Feb 27, 2017 · 11 revisions

Some questions keep popping up. Here are the canonical answers.

Q: I'm using Ext JS 4 in sandbox mode and JSDuck fails to auto-detect MyExt.define()

A: Use the --ext-namespaces=Ext,YourNamespace option to make the parser understand both Ext.define() and YourNamespace.define().

Q: JSDuck doesn't support @my_favorite_tag.

A: First off, see if you can extend JSDuck by by yourself by implementing custom tags.

If this didn't work out, or you think it would be a generally useful feature, post a new issue and try to convince us that JSDuck should support it. Is it supported by some other documentation tool? Tell us which one and link to the relevant documentation if possible. Is it used by some major JavaScript project? Again, give us examples and links.

Q: JSDuck doesn't support <my-favorite-language>.

A: JSDuck is focused on documenting JavaScript source code (with some rudimentary support for documentation in CSS and SCSS files), if you're trying to run JSDuck over the source code of any other language, you're just asking for trouble. JSDuck uses a full-blown JavaScript parser to understand the source code, so if you feed it something that's not valid JavaScript, it will just stop with an error.

Q: JSDuck doesn't support <my-favorite-character> in class/member name.

A: JSDuck expects all member names to be proper JavaScript identifier names. This means only 0...9, A...Z, a...z, _ and $. Class names can additionally contain dots (.). Anything else that happens to work should be considered a bug and not relied on.

Here's a separate article about the reasons for not supporting other characters.

Q: How to set up user commenting like the docs.sencha.com has?

A: The comments server is available as a separate project. See https://github.com/senchalabs/jsduck-comments

Q: Can I use JSDuck with non-ExtJS project?

Yes, you can, and some people already do. JSDuck will happily parse any valid JavaScript, but as its auto-detection capabilities are tuned for ExtJS, you'll probably need to document more things explicitly with @tags rather than relying on the auto-detection.

You should also consider whether JSDuck is a good fit for the kind of JavaScript you write. If you're structuring your code in OOP-manner (like Ext JS is structured) JSDuck is probably a good fit. But when you're structuring your code in functional style (like jQuery), you might be better off with a different tool.

Q: I'm using Ext JS 5 and I get a lot of class not found warnings for Ext classes.

A: Ext JS 5 divides it's classes between two directories, you need to include both: ext/src and ext/packages/sencha-core.