Task #1938

Investigate Grunt support

Added by Jeff Thompson about 7 years ago. Updated over 6 years ago.

Start date:
Due date:
% Done:


Estimated time:


Once the feross branch is merged into master, create a new branch to investigate Grunt support as described by Ryan Bennett:

A lot of weird idioms emerge with our custom 'require' semantics since we're using commonJS functions and variables in a way that is very ndn-js specific. Hence the shim files to guarantee waf/commonJS cross compatibility.
A potential solution: Grunt (a node.js taskrunner), in combination with browserify and uglify plugins, is more than capable of being configured to generate a single compiled and minified ndn-js, ready for inclusion as a script tag, that would export all library functions as a single object. This has some advantages over waf:

  • remove need for awkward shims
  • reduce head-scratching for javascript developers wishing to contribute by adopting a familiar build-chain
  • avoid polluting the global scope
  • clarify separation between ndn-js and dependant code

Grunt can also be configured to generate HTML documentation via JSdoc (js binding to javadoc). HTML browser tests can be streamlined significantly by utilizing mocha coupled with grunt; and can be set to autotest both node and refresh browser tests on file-change events.


Updated by Felix Rabe almost 7 years ago

I find Grunt incredibly cumbersome to work with. I'd rather use either:


Updated by Jeff Thompson almost 7 years ago

  • Tracker changed from Feature to Task

Updated by Jeff Thompson over 6 years ago

Hi Ryan. Since August 2014, we have implemented a "browswerify" approach and npm support in NDN-JS. Do you think it would still be useful to investigate Grunt?


Updated by Ryan Bennett over 6 years ago

Grunt is still a viable build system for sure. Since this issue was originally raised, I've also done some work with Gulp, as suggested by Felix, and I must say I'm impressed. It's a lot quicker than grunt when chaining multiple tasks together, and has all the plugins that we'd need. Either way, I maintain that moving towards a pure JS test and build system using Node.js is probably healthy for the project.

Also available in: Atom PDF