Skip to content

Commit 7dd3732

Browse files
authored
esm: remove support for deprecated hooks
Those have been deprecated for a while, it's time. PR-URL: #47580 Reviewed-By: Jacob Smith <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Geoffrey Booth <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent f509f10 commit 7dd3732

File tree

3 files changed

+0
-87
lines changed

3 files changed

+0
-87
lines changed

lib/internal/modules/esm/hooks.js

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

33
const {
4-
ArrayPrototypeJoin,
54
ArrayPrototypePush,
65
FunctionPrototypeCall,
76
Int32Array,
@@ -661,45 +660,9 @@ function pluckHooks({
661660
globalPreload,
662661
resolve,
663662
load,
664-
// obsolete hooks:
665-
dynamicInstantiate,
666-
getFormat,
667-
getGlobalPreloadCode,
668-
getSource,
669-
transformSource,
670663
}) {
671-
const obsoleteHooks = [];
672664
const acceptedHooks = { __proto__: null };
673665

674-
if (getGlobalPreloadCode) {
675-
globalPreload ??= getGlobalPreloadCode;
676-
677-
process.emitWarning(
678-
'Loader hook "getGlobalPreloadCode" has been renamed to "globalPreload"',
679-
);
680-
}
681-
if (dynamicInstantiate) {
682-
ArrayPrototypePush(obsoleteHooks, 'dynamicInstantiate');
683-
}
684-
if (getFormat) {
685-
ArrayPrototypePush(obsoleteHooks, 'getFormat');
686-
}
687-
if (getSource) {
688-
ArrayPrototypePush(obsoleteHooks, 'getSource');
689-
}
690-
if (transformSource) {
691-
ArrayPrototypePush(obsoleteHooks, 'transformSource');
692-
}
693-
694-
if (obsoleteHooks.length) {
695-
process.emitWarning(
696-
`Obsolete loader hook(s) supplied and will be ignored: ${
697-
ArrayPrototypeJoin(obsoleteHooks, ', ')
698-
}`,
699-
'DeprecationWarning',
700-
);
701-
}
702-
703666
if (globalPreload) {
704667
acceptedHooks.globalPreload = globalPreload;
705668
}

test/es-module/test-esm-loader-obsolete-hooks.mjs

Lines changed: 0 additions & 28 deletions
This file was deleted.

test/fixtures/es-module-loaders/hooks-obsolete.mjs

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)