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

❌ error 🖐️ling (Portland, OR)

❌ error 🖐️ling (Portland, OR)

PDXNode
Portland, OR
Aug 8, 2019

In the era of async/await, the grass has never been greener over here in Node.js-land. But when fostering a stable code base, there are still a few major gotchas you need to watch out for, and some of them are less than obvious. Mike will review the most common practical risks and annoyances teams tend to encounter in real-world #javascript applications, as well as his favorite best practices for avoiding those mistakes.

He'll pay special tribute to "parley" (https://lnkd.in/eezaxux), the highly-optimized #stability library that powers async/await usage in Sails & other Node.js packages. You'll learn best practices to streamline common pain points: error negotiation, tolerance (conditional swallowing), retries, timeouts, and interceptions (but, like, for upstream services ☁️, not 🏈).

Mike McNeil (@mikermcneil) has been an avid business user and evangelist for #nodejs for the last eight years. He's also the creator of Sails.js, a popular open-source MVC framework that's kind of like Rails for Node.js.

Mike McNeil

August 08, 2019
Tweet

More Decks by Mike McNeil

Other Decks in Programming

Transcript

  1. August 2019
    @

    View full-size slide

  2. The Company
    Mike McNeil
    @mikermcneil
    open-source MVC framework for Node.js
    creator of

    View full-size slide

  3. ❌ error ling
    @mikermcneil

    View full-size slide

  4. Everyone has this problem.

    View full-size slide

  5. Overly complex async logic
    Usually, you don't need this. Even at high
    scale, there are other, much more
    immediately-relevant performance and
    scalability bottlenecks.

    View full-size slide

  6. Dealing w/ upstream services
    3rd party APIs, servers maintained by
    other other internal teams

    View full-size slide

  7. What's wrong with
    try/catch?

    View full-size slide

  8. What's better than
    try/catch?

    View full-size slide

  9. …in a Sails app

    View full-size slide

  10. …in vanilla JavaScript
    Not using Sails?
    You can actually use the same
    approach, even in vanilla JavaScript.

    View full-size slide

  11. npm install parley

    View full-size slide

  12. .intercept()

    View full-size slide

  13. .timeout()

    View full-size slide

  14. sails.helpers.flow

    (if time allows)

    View full-size slide

  15. npm install flaverr

    (if time allows)

    View full-size slide

  16. Thank you!
    @mikermcneil
    @sailsjs
    sailsjs.com

    View full-size slide