Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Things I learned taking a team into NodeJS

Joseph Heck
December 10, 2014

Things I learned taking a team into NodeJS

NodeJS retrospective on building a product entirely in NodeJS, and getting it running into customer's hands

Joseph Heck

December 10, 2014

More Decks by Joseph Heck

Other Decks in Technology


  1. @heckj Joe Heck Cofounder and VP of Engineering at Renasar

    Technologies Prior worlds: • Python • Java • Objective-C
  2. Renasar Started Python, C# We knew it, was fast Web-service

    with different focus - started into Angular, hosting on Heroku Wow, we really get stuff done fast! Changed product direction in May, moved to NodeJS
  3. Dipping a toe Yeah, weekend project turned all out effort

    Full transfer for major code in June (mostly from C#) No deep team experience in NodeJS, just moved quickly What we are building is very asynchronous network oriented
  4. Learning in Anger Tools that teach us JSHint Webstorm IDE

    Load of VIM plugins Jenkins driving EVERYTHING, have it yell at us
  5. The Obvious Things Prototype inheritance Javascript, The Good Parts Where’s

    my damn list comprehensions!?!? Thank god for underscore, lodash Dynamic language vs. static compiled languages testing as a priority, assert-plus Functional scope vs. Object scope
  6. The Subtle Things All the calls are asynchronous. No, Really!

    Nested callback hell to guarantee sequencing Promises! there’s SO many to choose from - we use Q Hierarchical module imports in NodeJS
  7. rewrite lots of constructors to pass in more and more

    things configuration, logging, etc… Finally - di.js What’s the scope for that function? Rewriting to be able to test functions otherwise hidden via scoping
  8. NodeJS is young… Caveat Emptor on libraries! Greater variability than

    I expected from other languages Don’t like that way of doing it? That’s ok, probably have of JS developers don’t either and made another way of doing it Node.js, IO.js
  9. ES6 NodeJS on the server, browser implementation pieces - all

    sorts of convoluted Transpilers and build tools galore Make, Grunt, and Gulp Yoeman
  10. WTFBBQ?!?! DHCP server - listens on raw socket for broadcasts

    NodeJS doesn’t appear to support the full raw socket API - can’t bind to a specific interface, end up having to bind to to get it to work Corner case for most, but surprised the hell out of us! To-do on our list to patch or expose and submit upstream
  11. Libraries Machina, postal, Q, nconf, lru-cache And more commonly known

    ones: lodash express request mongoose commander
  12. Testing Started with Jasmine, switched to Mocha Chai, Sinon, chai-as-promised,

    sinon-as-promised Mockery, istanbul JSDoc, APIdoc memwatch, strongloop, statsd
  13. Refinement Mongoose -> Waterline Validation and CRUD lifecycle migrations, adapters

    to different backends API management Swagger: JSON-Schema ++ for APIs Multi-language library support
  14. Releasing NPM is great, but multi-repo can be a pain

    Debian and RPM packaging dependency management in packages is ugly Deploying updates Linux OS conventions for hosting NodeJS
  15. 6 months, code in the wild Damn, we get a

    lot of stuff done quickly! Asynchronous has been beautiful, if occasionally painful Reaping the scaling, multi-protocol benefits Q/Promises making a huge difference Peer review and tools to suggest critical issues