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 full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  6. by The Company

    View full-size slide

  7. waterline
    v1.0
    v0.13
    The Company

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  11. v1.0
    performance
    and stability

    View full-size slide

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

    View full-size slide

  13. v1.0
    Machine specification
    waterline
    v0.13

    View full-size slide

  14. v1.0
    SQL transactions

    View full-size slide

  15. v1.0
    Strong data types

    View full-size slide

  16. Type-dependent base values:
    • empty string

    • zero

    • false

    • null
    (why?)

    View full-size slide

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

    View full-size slide

  18. v1.0
    Federated hooks

    View full-size slide

  19. 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 full-size slide

  20. 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 full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  24. weird tricks (2 of 3)
    performing
    benchmarks

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  31. Questions?
    @mikermcneil
    sailsjs.com

    View full-size slide