Migrating
Version 5.0.0 of feathers-hooks-common
is compatible with Feathers v4 and up.
Deprecations
The following hooks and utilities have been deprecated and replaced with different named alternatives, Feathers v4 or Lodash functionality:
Hooks
callback-to-promise
- Useasync/await
, native Promises or NodeJS utils.promisifyclient
- Use paramsFromClient insteaddisable
- Use disallow insteaddisable-multi-item-change
- Use the database adaptermulti
option instead. See the Feathers v4 migration guide for more information.- disable-multi-item-create - Use the database adapter
multi
option instead. See the Feathers v4 migration guide for more information. pluck
- Useiff(isProvider('external'), keep(...fieldNames))
insteadpluckQuery
- Use keepQuery instead- promiseToCallback - No longer necessary since callbacks have been deprecated in Feathers v3 and later
removeQuery
- Use discardQuery insteadsetCreatedAt
- Use setNow insteadsetUpdatedAt
- Use setNow insteadskipRemainingHooks
- Use conditional hook chains with iff insteadskipRemainingHooksOnFlag
- Use conditional hook chains with iff insteadsoftDelete2
- Use Feathers v4 database adapters and the new softDelete instead
Utilities
Several utility methods have been replaced by Lodash methods which are thoroughly tested and performance optimized in many different environments.
Safe mutations
Most hooks have been updated to safely delete or add properties by replacing the object on the context with a new object instead of mutating it. This should prevent difficult to debug situations where e.g. params
or params.query
get changes in nested hooks when passed along.
stashBefore
softDelete
setField
Moved to feathers-authentication-hooks