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

"Be not afraid!"

Mike McNeil
November 07, 2018

"Be not afraid!"

In the era of async/await, the grass has never been greener over here in Node.js-land. But 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 mistakes our team sees in real-world Node.js applications. And then he'll explain why it's actually fine... why, despite all that, Node.js is even more of an awesome choice for your application in 2019.

Mike McNeil (@mikermcneil) has been an avid business user and evangelist for Node.js for the last seven 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

November 07, 2018
Tweet

More Decks by Mike McNeil

Other Decks in Programming

Transcript

  1. Austin Node.js meetup
    November 2018
    @

    View Slide

  2. Thank you!

    View Slide

  3. The Company
    Mike McNeil
    @mikermcneil
    founder & CEO of sails co.
    digital studio
    (a.k.a. design/dev/product shop)
    open-source MVC framework for Node.js
    creator of

    View Slide

  4. "Be not afraid!"
    @mikermcneil

    View Slide

  5. What's wrong with
    Node.js?

    View Slide

  6. What's wrong with
    some Node.js apps?

    View Slide

  7. 1. Not using await

    View Slide

  8. 1(A). Throwing in callbacks

    View Slide

  9. 1(B). Ignoring errors in
    callbacks or in promise chains

    View Slide

  10. 1(C). Not using await...
    on purpose
    (drinking performance kool-aid)

    View Slide

  11. 1(D). Not using await...
    on accident

    View Slide

  12. 2. Not handling 'error' events

    View Slide

  13. 3. Lack of structure

    View Slide

  14. 3(A). Named functions being
    declared all over the place

    View Slide

  15. (in our server-side Node.js code, if
    we give a function a name, then we
    also give it its own file)

    View Slide

  16. 3(B). Not having a way of
    figuring out all the places
    where a given function is
    being called from

    View Slide

  17. (can you grep for it?)

    View Slide

  18. 3(C). Insufficient abstraction

    View Slide

  19. (express is a fantastic "build your
    own framework" framework)

    View Slide

  20. 4. Fetching WAAAAYYY
    too many things
    at the same time

    View Slide

  21. 5. Fetching a normal amount
    of things…but WAAAYYYY
    too many times

    View Slide

  22. @mikermcneil
    Questions?

    View Slide