Skip to content

Releases: sailshq/machine-as-action

v7.0.11

22 Nov 21:15
4e33fde
Compare
Choose a tag to compare
# Changes:
#
# + Bump Lodash version to support ES6 arrow functions and ES7 async/await.
#
# And:
#
# a9ee4f5 (Mike McNeil, 6 days ago)
#    Fix bug in view rendering.  Then add support for custom response types, and
#    better error handling along the way.
#
# 9e65b08 (Mike McNeil, 6 days ago)
#    Rearrange and add ascii headings for clarity.
#
# 6356055 (Mike McNeil, 7 days ago)
#    Use res.status.
#
# e702fa5 (Mike McNeil, 7 days ago)
#    Add node 7 and 'node' (the latter to future proof for when the next version
#    of node is released)

v7.0.3

03 Oct 03:51
Compare
Choose a tag to compare

v6.1.3

07 Sep 20:44
Compare
Choose a tag to compare
  • Add protection against accidental double-wrapping
  • Add support for the E_DOUBLE_WRAP and E_INVALID_MACHINE error code
  • Undocumented/experimental tolerance of loose functions in machine-as-action is no longer supported.

v6.1.0

18 Aug 23:09
Compare
Choose a tag to compare

[email protected]

What's new

  • There's no reason actions that serve static views should have to worry about defining a fn: function (inputs, exits) { return exits.success(); } just to make some stupid header go away. So now, the X-Stub header is only automatically attached to responses if fake example data is being generated and sent to the response. Also, now anytime we add a X-Stub header, if you're in production (process.env.NODE_ENV==='production') we also log a warning to the console.
  • Somtimes it's nice to be able to send runtime output through a void exit. Like, especially if it's an Error instance. This makes it possible to have nice-looking stack traces, dynamic error messages, and supplemetary info that isn't built into the static response/exit definition. This has worked in the machine runner for a long time, but up until now machine-as-action was being a real big fuddy duddy. So we did some stuff. And now, if you send output through a void exit at runtime (e.g. exits.notFound(new Error('Now where did I put those '+pluralize(cookieStyle)+'?'));), that output will be logged to the console. It will still never get included in the response, because that would a security nightmare.
    • By "void exit", we mean an exit with an undefined outputExample.
    • Errors(/any other unexpected output) are logged to the console using sails.log.warn() if available. Otherwise, machine-as-action falls back to using console.warn().
    • To use your own custom logger instead, pass in a log function via the new logUnexpectedOutputFn option.
  • Speaking of options, we updated documentation in README.md to include all available options.