actionhero / next-in-actionhero

An example project that runs the Next.JS react server inside of ActionHero
4 stars 0 forks source link

Update actionhero to the latest version 🚀 #2

Closed greenkeeper[bot] closed 6 years ago

greenkeeper[bot] commented 6 years ago

Version 18.1.0 of actionhero was just published.

Dependency actionhero
Current Version 18.0.2
Type dependency

The version 18.1.0 is not covered by your current version range.

If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.

It might be worth looking into these changes and trying to get this project onto the latest version of actionhero.

If you have a solid test suite and good coverage, a passing build is a strong indicator that you can take advantage of these changes directly by merging the proposed change into your project. If the build fails or you don’t have such unconditional trust in your tests, this branch is a great starting point for you to work on the update.


Release Notes v18.1.0: Node.JS v9.x and better action validators.

Support for Node.js v9.x

ActionHero now support node.js v9.x, and we are running testing all new releases against it. The only change required was to support a change in how node handled parsedURL.search ( #1152).

Action validators which return nothing are valid

ActionHero changed the behavior of action's param validators to only mark a param as invalid if they return false or throw an error. Previously, validators which did not return (or returned null) would be marked as failing.

Fro example, these validators which return null (they don't return) on a passing param would mark the email and password {email: 'evan@evan.com', password: 'password123'} valid:

const {Action} = require('actionhero')

class ValidatedAction extends Action {
  constructor () {
    super()
    this.inputs = {
      email: {
        required: true,
        validator: this.emailValidator
      },
      password: {
        required: true,
        validator: this.passwordValidator
      }
    }
  }

  emailValidator (param) {
    if (param.indexOf('@') < 0) {
      throw new Error('that is not a valid email address')
    }
  }

  passwordValidator (param) {
    if (param.length < 4) {
      throw new Error('password should be at least 3 letters long')
    }
  }

  run (data) { 
    // ...
  } 
}

by @evantahler via #1158

connection.setStatusCode for web clients

  • Added a helper for the web type of connection to more easily set a custom status code in your actions. Remember that if you don't want to sent data back to the client, to use data.toRender = false:
// actions/custom404.js

const {Action} = require('./../index.js')

module.exports = class Custom404 extends Action {
  constructor () {
    super()
    this.name = 'custom 404 message'
    this.description = 'I return a 404 with a sassy message'
    this.outputExample = {}
  }

  async run ({connection, response}) {
    response.message = 'nope.'
    connection.setStatusCode(404)
  }
}

Increased verbosity for fatal error on handleMethod

If there was a fatal exception loading an initializer, you can now see what file & line number caused the problem

Commits

The new version differs by 17 commits.

  • 2b42dcd v18.1.0
  • b803be4 Merge pull request #1158 from actionhero/validtors-returning-nothing-is-ok
  • 0fa24b3 action validators which return nothing are valid
  • 65c85f0 Merge pull request #1157 from rakhnin/master
  • ef79860 increasing verbosity for fatal error on handleMethod
  • 1e91e30 Update package.json
  • fc956f9 Merge pull request #1154 from kytwb/master
  • 0f9a9be clean up learn-more link in default index.html
  • 7148b1b lock package.json to node v8 for now
  • 1b4e00c update dependancies
  • cd5b64d fix middleware-related typos in docs
  • 20aef7e Merge pull request #1153 from actionhero/node-v9
  • bcccc05 test node v9 and update parsedURL.search
  • 3f910f6 Merge pull request #1147 from actionhero/web-status-code-helper
  • c710ce4 docs for connection.setStatusCode

There are 17 commits in total.

See the full diff

FAQ and help There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new).

Your Greenkeeper bot :palm_tree: