From 5c9fe47f5a65b509526a094e09b6ca244b71f912 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 15 Nov 2023 18:30:53 +0100 Subject: [PATCH 1/4] doc: document non-node_modules-only runtime deprecation We already have this special kind of runtime deprecation for Buffer constructors which does not fit into the original description of runtiem deprecations. Document this kind of deprecation separately. --- doc/api/deprecations.md | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 607678ebbfba95..f1673819f90723 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -10,10 +10,11 @@ Node.js APIs might be deprecated for any of the following reasons: * An improved alternative API is available. * Breaking changes to the API are expected in a future major release. -Node.js uses three kinds of Deprecations: +Node.js uses four kinds of Deprecations: * Documentation-only -* Runtime +* Runtime (non-`node_modules` code only) +* Runtime (all code) * End-of-Life A Documentation-only deprecation is one that is expressed only within the @@ -25,10 +26,17 @@ deprecations below. Documentation-only deprecations that support that flag are explicitly labeled as such in the [list of Deprecated APIs](#list-of-deprecated-apis). -A Runtime deprecation will, by default, generate a process warning that will -be printed to `stderr` the first time the deprecated API is used. When the -[`--throw-deprecation`][] command-line flag is used, a Runtime deprecation will -cause an error to be thrown. +A Runtime deprecation for only non-`node_modules` code will, by default, +generate a process warning that will be printed to `stderr` the first time +the deprecated API is used in code that's not loaded from `node_modules`. +When the [`--throw-deprecation`][] command-line flag is used, a Runtime +deprecation will cause an error to be thrown. When +[`--pending-deprecation`][] is used, warnings will also be emitted for +code loaded from `node_modules`. + +A runtime deprecation for all code is similar to the runtime deprecation +for non-`node_modules` code, except that it also emits a warning for +code loaded from `node_modules`. An End-of-Life deprecation is used when functionality is or will soon be removed from Node.js. @@ -140,7 +148,7 @@ changes: description: Documentation-only deprecation. --> -Type: Runtime (supports [`--pending-deprecation`][]) +Type: Runtime (non-`node_modules` code only) The `Buffer()` function and `new Buffer()` constructor are deprecated due to API usability issues that can lead to accidental security issues. From 4dca046ac804976c54b571804ba4c5399955da71 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Mon, 20 Nov 2023 18:44:02 +0100 Subject: [PATCH 2/4] fixup! doc: document non-node_modules-only runtime deprecation Co-authored-by: Geoffrey Booth --- doc/api/deprecations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index f1673819f90723..ed465eef16547b 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -10,7 +10,7 @@ Node.js APIs might be deprecated for any of the following reasons: * An improved alternative API is available. * Breaking changes to the API are expected in a future major release. -Node.js uses four kinds of Deprecations: +Node.js uses four kinds of deprecations: * Documentation-only * Runtime (non-`node_modules` code only) From 567303066ddb6c5bff0e8f3ce7656193e6028b28 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Mon, 20 Nov 2023 18:45:02 +0100 Subject: [PATCH 3/4] fixup! doc: document non-node_modules-only runtime deprecation Co-authored-by: Geoffrey Booth --- doc/api/deprecations.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index ed465eef16547b..9ba54c9c1318b7 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -13,7 +13,7 @@ Node.js APIs might be deprecated for any of the following reasons: Node.js uses four kinds of deprecations: * Documentation-only -* Runtime (non-`node_modules` code only) +* Application (non-`node_modules` code only) * Runtime (all code) * End-of-Life @@ -26,7 +26,7 @@ deprecations below. Documentation-only deprecations that support that flag are explicitly labeled as such in the [list of Deprecated APIs](#list-of-deprecated-apis). -A Runtime deprecation for only non-`node_modules` code will, by default, +An Application deprecation for only non-`node_modules` code will, by default, generate a process warning that will be printed to `stderr` the first time the deprecated API is used in code that's not loaded from `node_modules`. When the [`--throw-deprecation`][] command-line flag is used, a Runtime From ae5ecf59fef2eb593c0e16b5b0f0ddb15b895ff5 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sat, 25 Nov 2023 01:21:53 +0100 Subject: [PATCH 4/4] fixup! doc: document non-node_modules-only runtime deprecation Co-authored-by: Chengzhong Wu --- doc/api/deprecations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 9ba54c9c1318b7..16962ff77b7faa 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -148,7 +148,7 @@ changes: description: Documentation-only deprecation. --> -Type: Runtime (non-`node_modules` code only) +Type: Application (non-`node_modules` code only) The `Buffer()` function and `new Buffer()` constructor are deprecated due to API usability issues that can lead to accidental security issues.