-
Notifications
You must be signed in to change notification settings - Fork 240
4.0 beta
(Updated for beta 2 release.)
JSDuck 4.0 beta is now out and brings with it a new JavaScript parser.
Using Esprima.js internally, JSDuck 4 has much improved auto-detection capabilities.
New tags @enum and @since bring on table completely new features.
/** My panel */
Ext.define("MyPanel", {
extend: "Ext.panel.Panel",
config: {
/**
* Title for the panel
*/
title: "Untitled"
},
inheritableStatics: {
/**
* Registers the panel globally.
* @param {MyPanel} panel
*/
register: function(panel) {
}
},
floating: false
});
From the above code JSDuck 4 detects config option title
, static method register
and private property floating
. In JSDuck 3 you would have needed to explicitly use @cfg + @accessor tags for the config option, @static + @inheritable tag for static method, and the private property would have needed a doc-comment with @private tag.
To install 4.0 beta, run:
$ gem install jsduck --pre
Additionally you should install therubyracer gem which provides a fast v8 bridge for running esprima.js:
$ gem install therubyracer
In Windows the easiest option is to download the jsduck-4.0.beta2.exe binary. It should work out of the box. (The previous beta also offered a JRuby version, but this was just an experiment, and has been discontinued.)
Alternatively you can install through rubygems, but you need to do some additional tweaks. First go and download therubyracer gem and v8 lib that stereobooster has built for windows. You need to install this special rubyracer version instead of the one from rubygems:
> gem install therubyracer-0.11.0beta1-x86-mingw32.gem
To make it actually work you need v8.dll
somewhere in your system. Extract the lib_v8.3.11.9.zip
take the v8.dll
inside it and place into the bin
directory of your Ruby installation (other dirs that are on your PATH can work too, but I've found this to be the most sensible place to put it). Now you're ready to install JSDuck:
> gem install jsduck --pre
See the Hacking guide.