Things I learned taking a team into NodeJS

Cb09f569d2572bd00baec8da68a88201?s=47 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

Cb09f569d2572bd00baec8da68a88201?s=128

Joseph Heck

December 10, 2014
Tweet

Transcript

  1. Things I learned taking a team into NodeJS

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

    Technologies Prior worlds: • Python • Java • Objective-C
  3. 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
  4. 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
  5. Learning in Anger Tools that teach us JSHint Webstorm IDE

    Load of VIM plugins Jenkins driving EVERYTHING, have it yell at us
  6. 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
  7. 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
  8. 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
  9. 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
  10. ES6 NodeJS on the server, browser implementation pieces - all

    sorts of convoluted Transpilers and build tools galore Make, Grunt, and Gulp Yoeman
  11. 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 0.0.0.0 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
  12. Libraries Machina, postal, Q, nconf, lru-cache And more commonly known

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

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

    to different backends API management Swagger: JSON-Schema ++ for APIs Multi-language library support
  15. 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
  16. 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
  17. Q&A HIRING! @heckj github.com/heckj joseph.heck@renasar.com