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

Introducing Sails v1

Mike McNeil
February 23, 2017

Introducing Sails v1

Spanning Cloud Apps is generously supporting an evening in Austin, TX with Mike McNeil and Gabriel Schenker.

Mike will demonstrate the brand new release of the Sails framework and Waterline ORM, and show how to take advantage of some of the new features like strong data types and support for SQL transactions. He'll also discuss a few of the lessons and weird tricks he and the rest of the team learned along the way, including:

• the secret power of assertions (make your Node.js packages more stable, and faster to debug)
• the quickest way to run real-world benchmarks on your app or module (see how it performs at scale)
• three "low-hanging fruit" performance gotchas (avoid pitfalls and take advantage of V8 optimizations)

Gabriel is going to demonstrate how to containerize an existing Node JS application and deploy it to a Docker Swarm. He is also going to show how to setup the environment to reduce friction in the development process and how to make an application secure using secrets.

About Mike:

Mike is the creator of Sails.js, one of the most popular open-source frameworks for Node.js. He is also the CEO of its primary corporate sponsor, The Sails Company (YC W15). Mike's passion is to improve the day to day of software development, and to make it more accessible to people of all experience levels and backgrounds.

Mike has his roots in helping organizations design and implement custom web & mobile experiences, with an emphasis on realtime technology. Since 2012, he and the rest of the Sails core team (http://sailsjs.com/studio) have developed digital products and scalable APIs for startups, SMBs, and the Fortune 500. Earlier this year (2017), they launched Sails Flagship, a new platform on top of Sails which provides a suite of additional services, production-quality tools, and support for enterprise use cases.

About Gabriel:

Gabriel N. Schenker started his career as a physicist. Following his passion and interest in stars and the universe he chose to write his Ph.D. thesis in astrophysics. Soon after this he dedicated all his time to his second passion, writing and architecting software. Gabriel has since been working for over 25 years as a consultant, software architect, trainer. He has been nominated a Docker Captain and since January of this year he is working as Principal Curriculum Developer at Docker Inc (http://docker.com). Gabriel is working from home in Austin, Texas. Gabriel is passionate about software development and tries to make the life of developers easier by providing guidelines and frameworks to reduce friction in the software development process. During his spare time Gabriel likes hiking in the mountains, cooking and reading.

Mike McNeil

February 23, 2017
Tweet

More Decks by Mike McNeil

Other Decks in Technology

Transcript

  1. Austin Node.js Meetup
    February 2017
    @mikermcneil
    v1.0
    Introducing

    View Slide

  2. Mike McNeil
    CEO, The Sails Company
    @mikermcneil
    creator of

    View Slide

  3. the leading open-source
    MVC framework for Node.js

    View Slide

  4. View Slide

  5. What we’ve been up to
    (2016-2017)

    View Slide

  6. View Slide

  7. The Company

    View Slide

  8. The Company
    The
    (us)
    (customer)
    (Javascript app)

    View Slide

  9. by The Company

    View Slide

  10. waterline
    v1.0
    v0.13
    The Company

    View Slide

  11. A. What’s in Sails v1?
    B. Weird tricks

    View Slide

  12. v1.0
    What’s in Sails v1?

    View Slide

  13. v1.0
    What’s in Sails v1?
    waterline
    v0.13

    View Slide

  14. v1.0
    performance
    and stability

    View Slide

  15. v1.0
    Comprehensive security strategy (NS/Snyk)

    View Slide

  16. v1.0
    Machine specification
    waterline
    v0.13

    View Slide

  17. v1.0
    SQL transactions

    View Slide

  18. v1.0

    View Slide

  19. v1.0
    Strong data types

    View Slide

  20. v1.0

    View Slide

  21. Type-dependent base values:
    • empty string

    • zero

    • false

    • null
    (why?)

    View Slide

  22. v1.0
    Enterprise support
    and full-service studio

    View Slide

  23. v1.0

    View Slide

  24. v1.0

    View Slide

  25. v1.0
    Federated hooks

    View Slide

  26. v1.0

    View Slide

  27. What’s in Sails v1?
    v1.0
    SQL transactions
    Federated hooks Standalone/nested actions
    Dynamic database connections
    Revamped Redis adapter
    More flexible blueprints
    Projections (select / omit)
    actions2
    Better query performance
    XSS-safe data bootstrapping (exposeLocalsToBrowser)
    Richer plugin interface
    TypeScript
    Staging environment
    More flexible views
    Strong data types ES6 / ES7
    Command-line scripts
    Formal “helpers” API

    View Slide

  28. What’s in Sails v1?
    v1.0
    Better warnings & error messages
    Express 4 Enterprise support
    Upgraded dependencies
    Comprehensive security strategy (NS/Snyk)
    Low-level database access via standardized driver interface
    Compiled statements
    Knex integration
    Updated CORS implementation
    Exponentially more tests
    Better support for Windows developers
    Improved programmatic usage
    Improved auto-migrations
    Bolstered module ecosystem
    Architectural documentation
    Optimized sessions Official benchmarks
    Query sanitization

    View Slide

  29. A. What’s in Sails v1?
    B. Weird tricks

    View Slide

  30. weird tricks (1 of 3)
    the secret power of
    assertions

    View Slide

  31. weird tricks (1 of 3)
    assert(orm, ‘orm is required’);
    assert(_.isString(identity) && identity !== ‘’);

    View Slide

  32. weird tricks (2 of 3)
    performing
    benchmarks

    View Slide

  33. weird tricks (2 of 3)
    demo
    (parley :: npm run benchmarks)
    https://github.com/mikermcneil/parley

    View Slide

  34. weird tricks (3 of 3)
    performance
    “gotchas”

    View Slide

  35. weird tricks (3 of 3)
    performance
    “gotchas”
    i.e. a few things that actually like, matter
    (at least they did for us)

    View Slide

  36. weird tricks (3 of 3)
    var err = new Error(‘hi’);
    err.stack;

    View Slide

  37. weird tricks (3 of 3)
    Object.defineProperty(foo, ‘bar’, {
    value: ‘baz’
    });

    View Slide

  38. weird tricks (3 of 3)
    util.inspect(foo, {depth: null})
    util.inspect(foo);

    View Slide

  39. Questions?
    @mikermcneil
    sailsjs.com

    View Slide