|
| 1 | +=========================== |
| 2 | + Migrating to 5.x |
| 3 | +=========================== |
| 4 | + |
| 5 | +This guide covers the most breaking changes, in case you updated from an earlier version. |
| 6 | + |
| 7 | +------------------- |
| 8 | +Requires Node >= 16 |
| 9 | +------------------- |
| 10 | + |
| 11 | +Due to Node 14 reaching end of life (EOL; which implies no security updates) this version requires at least Node 16. |
| 12 | +Future versions of the 5.x major releases will update to a newer Node LTS, once the current one reaches EOL. |
| 13 | + |
| 14 | +Note, that we also won't regard any security patches to problems that are a direct consequence of |
| 15 | +using a Node version that reached EOL. |
| 16 | + |
| 17 | +------------------------ |
| 18 | +Removed callback support |
| 19 | +------------------------ |
| 20 | + |
| 21 | +With beginning of release 5.0.0 this module dropped all callback support and uses `async/await` |
| 22 | +for all asynchronous operations. |
| 23 | + |
| 24 | +This implies you either need to have a more recent Node.js environment that natively supports `async/await` |
| 25 | +or your project uses tools to support at least Promises. |
| 26 | + |
| 27 | +----------------- |
| 28 | +Update your model |
| 29 | +----------------- |
| 30 | + |
| 31 | +The model functions is now expected to return a Promise (or being declared as `async function`), |
| 32 | +since callback support is dropped. |
| 33 | + |
| 34 | +Note: Synchronous model functions are still supported. However, we recommend to use Promise or async, |
| 35 | +if database operations (or other heavy operations) are part of a specific model function implementation. |
| 36 | + |
| 37 | +------------------ |
| 38 | +Scope is now Array |
| 39 | +------------------ |
| 40 | + |
| 41 | +In earlier versions we allowed `scope` to be strings with words, separated by empty space. |
| 42 | +With beginning of 5.0.0 the scope parameter needs to be an Array of strings. |
| 43 | + |
| 44 | +This implies to requests, responses and model implementations where scope is included. |
0 commit comments