Skip to content

Commit 56e4180

Browse files
Anna Henningsenrefack
Anna Henningsen
authored andcommitted
lib: remove unintended access to deps/
This brings DEP0084 to End-of-Life. It is unlikely that this has received much public usage in the first place, so removing should be okay. PR-URL: nodejs#25138 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent 172f11f commit 56e4180

File tree

4 files changed

+7
-80
lines changed

4 files changed

+7
-80
lines changed

doc/api/deprecations.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -1670,16 +1670,19 @@ the client and is now unsupported. Use the `ciphers` parameter instead.
16701670
### DEP0084: requiring bundled internal dependencies
16711671
<!-- YAML
16721672
changes:
1673+
- version: REPLACEME
1674+
pr-url: https://github.com/nodejs/node/pull/25138
1675+
description: This functionality has been removed.
16731676
- version: v10.0.0
16741677
pr-url: https://github.com/nodejs/node/pull/16392
16751678
description: Runtime deprecation.
16761679
-->
16771680
1678-
Type: Runtime
1681+
Type: End-of-Life
16791682
16801683
Since Node.js versions 4.4.0 and 5.2.0, several modules only intended for
1681-
internal usage are mistakenly exposed to user code through `require()`. These
1682-
modules are:
1684+
internal usage were mistakenly exposed to user code through `require()`. These
1685+
modules were:
16831686
16841687
- `v8/tools/codemap`
16851688
- `v8/tools/consarray`

lib/internal/bootstrap/loaders.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,7 @@ NativeModule.isDepsModule = function(id) {
220220
};
221221

222222
NativeModule.requireForDeps = function(id) {
223-
if (!NativeModule.exists(id) ||
224-
// TODO(TimothyGu): remove when DEP0084 reaches end of life.
225-
NativeModule.isDepsModule(id)) {
223+
if (!NativeModule.exists(id)) {
226224
id = `internal/deps/${id}`;
227225
}
228226
return NativeModule.require(id);

test/parallel/test-require-deps-deprecation.js

-56
This file was deleted.

tools/js2c.py

-18
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,6 @@ def ReadMacros(lines):
214214
);
215215
"""
216216

217-
DEPRECATED_DEPS = """\
218-
'use strict';
219-
process.emitWarning(
220-
'Requiring Node.js-bundled \\'{module}\\' module is deprecated. Please ' +
221-
'install the necessary module locally.', 'DeprecationWarning', 'DEP0084');
222-
module.exports = require('internal/deps/{module}');
223-
"""
224-
225217
def JS2C(source, target):
226218
modules = []
227219
consts = {}
@@ -265,15 +257,11 @@ def AddModule(module, source):
265257
lines = ExpandConstants(lines, consts)
266258
lines = ExpandMacros(lines, macros)
267259

268-
deprecated_deps = None
269-
270260
# On Windows, "./foo.bar" in the .gyp file is passed as "foo.bar"
271261
# so don't assume there is always a slash in the file path.
272262
if '/' in name or '\\' in name:
273263
split = re.split('/|\\\\', name)
274264
if split[0] == 'deps':
275-
if split[1] == 'node-inspect' or split[1] == 'v8':
276-
deprecated_deps = split[1:]
277265
split = ['internal'] + split
278266
else:
279267
split = split[1:]
@@ -293,12 +281,6 @@ def AddModule(module, source):
293281
else:
294282
AddModule(name.split('.', 1)[0], lines)
295283

296-
# Add deprecated aliases for deps without 'deps/'
297-
if deprecated_deps is not None:
298-
module = '/'.join(deprecated_deps).split('.', 1)[0]
299-
source = DEPRECATED_DEPS.format(module=module)
300-
AddModule(module, source)
301-
302284
# Emit result
303285
output = open(str(target[0]), "w")
304286
output.write(

0 commit comments

Comments
 (0)