Skip to content

Commit 40ff567

Browse files
committed
added renaming of env var to deprecation warning
1 parent 563a0a8 commit 40ff567

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/Deprecator/Deprecations.js

+13-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,18 @@
88
* or set to an empty string if the current key will be removed without replacement.
99
* - `changeNewDefault`: Set the new default value if the key's default value
1010
* will change in a future version.
11+
* - `solution`: The instruction to resolve this deprecation warning. Optional. This
12+
* instruction must not include the deprecation warning which is auto-generated.
13+
* It should only contain additional instruction regarding the deprecation if
14+
* necessary.
1115
*
12-
* If there are no deprecations this must return an empty array anyway.
16+
* If there are no deprecations, this must return an empty array.
1317
*/
14-
module.exports = [{ optionKey: 'directAccess', changeNewDefault: 'true' }];
18+
module.exports = [
19+
{
20+
optionKey: 'directAccess',
21+
changeNewDefault: 'true',
22+
solution:
23+
"Additionally, the environment variable 'PARSE_SERVER_ENABLE_EXPERIMENTAL_DIRECT_ACCESS' will be deprecated and renamed to 'PARSE_SERVER_DIRECT_ACCESS' in a future version; it is currently possible to use either one.",
24+
},
25+
];

src/Deprecator/Deprecator.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ class Deprecator {
1616
// Scan for deprecations
1717
for (const deprecation of Deprecator._getDeprecations()) {
1818
// Get deprecation properties
19+
const solution = deprecation.solution;
1920
const optionKey = deprecation.optionKey;
2021
const changeNewDefault = deprecation.changeNewDefault;
2122

2223
// If default will change, only throw a warning if option is not set
2324
if (changeNewDefault != null && options[optionKey] == null) {
24-
Deprecator._log({ optionKey, changeNewDefault });
25+
Deprecator._log({ optionKey, changeNewDefault, solution });
2526
}
2627
}
2728
}

0 commit comments

Comments
 (0)