Skip to content

Commit 1da9837

Browse files
committed
docs: add migrating to v5 topic
1 parent 6d27e3f commit 1da9837

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,6 @@ See the :doc:`/model/spec` of what is required from the model passed to :doc:`/a
8585

8686
misc/extension-grants
8787
misc/pkce
88+
misc/migrating-v5
8889
misc/migrating-v2-to-v3
8990

docs/misc/migrating-to-v5.rst

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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

Comments
 (0)