Closed timcosta closed 6 years ago
I will update the plugin
I have decided for now not to update this module to work with hapi v17. The new API for returning responses seems to make this plugin unnecessary as the example usage below shows:
With hapi v17 and no plugins:
server.route({
method: 'GET',
path: '/resource/{id}',
handler: (request, h) => {
throw boom.notFound();
}
});
With a plugin for decorating the toolkit with boom functions:
server.route({
method: 'GET',
path: '/resource/{id}',
handler: (request, h) => {
return h.notFound();
}
})
There is very little difference in terms of verbosity, which was the main driver for creating this module in the first place. If anyone can convince me otherwise I am open to updating.
Without the plugin, you have to require boom in all your route files... const Boom = require('boom');
However, with the plugin - you just call it.. return h.notFound();
@BigWillie I'd done most of the work already so I've just gone and published a new version (4.0.0) for hapi 17.
Overview
If you are not aware yet, Hapi v17 is making the transition from callbacks to
async
/await
, as well as deprecating some other rarely used functionality. This is a breaking change that may make your plugin no longer compatible with the Hapi API.Changelog
Draft release notes can be found here: https://github.com/hapijs/hapi/issues/3658
Target Release
The target release date for v17 is the beginning of November.
Tasks
async
/await
compatible using thev17
branch from Hapi for testingPossible dev flow for updating
npm link
within the Hapi reponpm link hapi
within your plugin repov17
of Hapi branch for testsnpm
. Please use a major version increment as this will be a breaking change and it would be terrible for it to sneak into current versions of Hapi.Notes
<8.0.0
.v16
will continue to be supported for as long as there exists a Node LTS actively being supported that is not compatible withv17
.