Note: Once 1.0.0 is out, hapi will obey semver rules where 1.x.x will never include breaking changes (until 2.0.0).
Changed:
request.rawBody renamed to request.rawPayload, and is now a Buffer, not a string. Use request.rawPayload.toString() to get the previously provided value (0.16 and older).
- Module root now case sensitive (Server, Pack, response, Composer, state, types, utils).
pack.version() changed to pack.version.
- Server config
views.cache and views.engines[ext].cache changed to isCached.
- Server config
views no longer includes a default handlebars handler. To get the same behavior add engines: { 'html': 'handlebars' } to the views object.
- If multiple view engines are defined, it will no longer try looking for all the extensions if template name is missing it. Set
views.defaultExtension when using multiple extensions engines.
- Route config
response moved to validate.response.
- Route
auth.tos changed from number to semver version.
- Cookie errors are logged when
state.cookies.failAction to to 'error'.
- Replaced
request.reply.payload().send() with just request.reply() (uses process.nextTick() to schedule an automatic send()). Added new hold() method to prevent next tick from sending the response, until send() is called.
request.reply.send() only available after calling request.reply().hold().
- Location header prefixed with
server.settings.location is set and value non-absolute (instead if using server.info.uri).
server.plugin renamed server.pack.
- Basic auth changed. Details in https://github.com/spumko/hapi/blob/master/docs/API.md#basic-authentication.
- Cookie auth
validateFunc changed. Details in https://github.com/spumko/hapi/blob/master/docs/API.md#cookie-authentication.
- In
server.helper(), options.generateKey function signature changed to pass the same arguments as the helper method instead of passing them as a single arguments object.
- Composer manifest no longer has root
permissions. Instead, pass [permissions, options] as the options value of each plugin key.
Removed:
- Cache
strict mode.
request.reply.raw() and the Raw response type. In node 0.10 it is trivial to create your own Readable stream and use that to achieve the same result.
- Oz auth scheme (but you were not supposed to use it anyway).
Hapi.response.generate() changed to private.
- Server config
views.engine. Use views.engines[ext].module instead.
- Route config
validate.response.failAction - ignore value.
request.reply.payload() and request.reply.stream() removed. Use request.reply() instead.
server.settings.host, server.settings.port, server.settings.uri. Moved to server.info.
server.settings.nickname.
request.removeTail().
Obsoleted:
request.addTail(). Use request.tail().
Note: Once 1.0.0 is out, hapi will obey semver rules where 1.x.x will never include breaking changes (until 2.0.0).
Changed:
request.rawBodyrenamed torequest.rawPayload, and is now a Buffer, not a string. Userequest.rawPayload.toString()to get the previously provided value (0.16 and older).pack.version()changed topack.version.views.cacheandviews.engines[ext].cachechanged toisCached.viewsno longer includes a default handlebars handler. To get the same behavior addengines: { 'html': 'handlebars' }to theviewsobject.views.defaultExtensionwhen using multiple extensions engines.responsemoved tovalidate.response.auth.toschanged from number to semver version.state.cookies.failActionto to'error'.request.reply.payload().send()with justrequest.reply()(usesprocess.nextTick()to schedule an automaticsend()). Added newhold()method to prevent next tick from sending the response, untilsend()is called.request.reply.send()only available after callingrequest.reply().hold().server.settings.locationis set and value non-absolute (instead if usingserver.info.uri).server.pluginrenamedserver.pack.validateFuncchanged. Details in https://github.com/spumko/hapi/blob/master/docs/API.md#cookie-authentication.server.helper(),options.generateKeyfunction signature changed to pass the same arguments as the helper method instead of passing them as a single arguments object.permissions. Instead, pass[permissions, options]as the options value of each plugin key.Removed:
strictmode.request.reply.raw()and theRawresponse type. In node 0.10 it is trivial to create your own Readable stream and use that to achieve the same result.Hapi.response.generate()changed to private.views.engine. Useviews.engines[ext].moduleinstead.validate.response.failAction-ignorevalue.request.reply.payload()andrequest.reply.stream()removed. Userequest.reply()instead.server.settings.host,server.settings.port,server.settings.uri. Moved toserver.info.server.settings.nickname.request.removeTail().Obsoleted:
request.addTail(). Userequest.tail().