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 Slide

  2. Thank you!

    View Slide

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

    View Slide

  4. ❌ error ling
    @mikermcneil

    View Slide

  5. Everyone has this problem.

    View Slide

  6. 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 Slide

  7. Swallowing

    View Slide

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

    View Slide

  9. the code

    View Slide

  10. What's wrong with
    try/catch?

    View Slide

  11. What's better than
    try/catch?

    View Slide

  12. …in a Sails app

    View Slide

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

    View Slide

  14. npm install parley

    View Slide

  15. View Slide

  16. .intercept()

    View Slide

  17. .tolerate()

    View Slide

  18. .retry()

    View Slide

  19. .timeout()

    View Slide

  20. sails.helpers.flow

    (if time allows)

    View Slide

  21. npm install flaverr

    (if time allows)

    View Slide

  22. questions?

    View Slide

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

    View Slide