|
1 | 1 | # Migrating |
2 | | - |
3 | | -Version 5.0.0 of `feathers-hooks-common` is compatible with Feathers v4 and up. |
4 | | - |
5 | | -## Deprecations |
6 | | - |
7 | | -The following hooks and utilities have been deprecated and replaced with different named alternatives, Feathers v4 or Lodash functionality: |
8 | | - |
9 | | -### Hooks |
10 | | - |
11 | | -- `callback-to-promise` - Use `async/await`, native Promises or NodeJS [utils.promisify](https://nodejs.org/api/util.html#util_util_promisify_original) |
12 | | -- `client` - Use [paramsFromClient](hooks#paramsfromclient) instead |
13 | | -- `disable` - Use [disallow](hooks#disallow) instead |
14 | | -- `disable-multi-item-change` - Use the database adapter `multi` option instead. See the [Feathers v4 migration guide](https://docs.feathersjs.com/guides/migrating.html) for more information. |
15 | | -- disable-multi-item-create - Use the database adapter `multi` option instead. See the [Feathers v4 migration guide](https://docs.feathersjs.com/guides/migrating.html) for more information. |
16 | | -- `pluck` - Use `iff(isProvider('external'), keep(...fieldNames))` instead |
17 | | -- `pluckQuery` - Use [keepQuery](hooks#keepquery) instead |
18 | | -- promiseToCallback - No longer necessary since callbacks have been deprecated in Feathers v3 and later |
19 | | -- `removeQuery` - Use [discardQuery](hooks#discardquery) instead |
20 | | -- `setCreatedAt` - Use [setNow](hooks#setnow) instead |
21 | | -- `setUpdatedAt` - Use [setNow](hooks#setnow) instead |
22 | | -- `skipRemainingHooks` - Use conditional hook chains with [iff](hooks#iff) instead |
23 | | -- `skipRemainingHooksOnFlag` - Use conditional hook chains with [iff](hooks#iff) instead |
24 | | -- `softDelete2` - Use Feathers v4 database adapters and the new [softDelete](hooks#softdelete) instead |
25 | | - |
26 | | -### Utilities |
27 | | - |
28 | | -Several utility methods have been replaced by [Lodash](https://lodash.com) methods which are thoroughly tested and performance optimized in many different environments. |
29 | | - |
30 | | -- `existsByDot` - Use [\_.has()](https://lodash.com/docs/latest#has) |
31 | | -- `deleteByDot` - Use [\_.omit](https://lodash.com/docs/latest#omit) |
32 | | -- `getByDot` - Use [\_.get()](https://lodash.com/docs/latest#get) |
33 | | -- `setByDot` - Use [\_.set()](https://lodash.com/docs/latest#set) |
34 | | - |
35 | | -## Safe mutations |
36 | | - |
37 | | -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. |
38 | | - |
39 | | -## stashBefore |
40 | | - |
41 | | -## softDelete |
42 | | - |
43 | | -## setField |
44 | | - |
45 | | -Moved to [feathers-authentication-hooks](https://github.com/feathersjs-ecosystem/feathers-authentication-hooks#setfield) |
0 commit comments