documentation.js v3.0.0 Release Notes

  • ๐Ÿ“š The largest change to documentation.js so far.

    โฌ‡๏ธ Dropping streams

    ๐Ÿ“š This a major refactor of the documentation.js interface with a focus on ๐Ÿ“š simplifying the system. Up until this point, documentation.js was built around node.js streams, which are low-level representations of asynchronous series of data. While this abstraction was appropriate for the input and github streams, which are asynchronous, the ๐Ÿ“š majority of documentation.js's internals are simple and synchronous functions for which basic functional composition makes more sense than stream semantics.

    ๐Ÿ“š Documentation 3.0.0 uses simple functional composition for operations like parmameter inference, rather than streams.

    ๐Ÿ‘ Stronger support for ES6, ES7, and Flow

    ๐Ÿ“œ We've switched to Babel as our source code parser, ๐Ÿ‘ which means that we have much broader support of new JavaScript features, including import/export syntax and new features in ES6.

    ๐Ÿ“œ Babel also parses Flow type annotations, and new inference code means that we can infer

    • Parameter names & types
    • Return types

    Without any explicit JSDoc tags. This means that for many simple functions, ๐Ÿ“š we can generate great documentation with less writing.

    ๐Ÿ‘ Stronger module support

    ๐Ÿ“š Documentation.js now has much better inference for membership and names of symbols exported via exports or module.exports.

    ๐Ÿ‘Œ Support for nested symbols

    The parent/child relationship between symbols is now fully hierarchical, and symbols can be nested to any depth. For instance:

    /**
     * A global Parent class.
     */
    var Parent = function () {};
    
    /**
     * A Child class.
     */
    Parent.Child = function () {};
    
    /**
     * A Grandchild class.
     */
    Parent.Child.Grandchild = function () {};
    

    In addition, filtering by access is now applied to the entire hierarchy: if you mark a class as @private, neither it nor its children will be included in the 0๏ธโƒฃ output by default, regardless of the access specifiers of the children.

    mdast-based Markdown output

    We've switched from templating Markdown output with Handlebars.js to generating an abstract syntax tree of desired output and stringifying it with mdast. ๐Ÿ“š This lets documentation.js output complex Markdown without having to worry about escaping and properly formatting certain elements.

    โœ… Test coverage 100%

    ๐Ÿ“š documentation.js returns to 100% test coverage, so every single line โœ… of code is covered by our large library of text fixtures and specific tests.

    ๐Ÿ‘• --lint mode

    ๐Ÿ“š Specifying the --lint flag makes documentation.js check for non-standard types, like String, or missing namespaces. If the encountered files have ๐Ÿ–จ any problems, it pretty-prints helpful debug messages and exits with status 1, and otherwise exits with no output and status 0.

    ๐Ÿ’ฅ Breaking changes

    • The --version flag is now --project-version. --version now outputs documentation.js's version