GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — esm: remove support for deprecated hooks · nodejs/node@ca20f59

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/modules/esm
    • hooks.js
  • test
    • es-module
      • test-esm-loader-obsolete-hooks.mjs
    • fixtures/es-module-loaders
      • hooks-obsolete.mjs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/modules/esm/hooks.js‎

Copy file name to clipboardExpand all lines: lib/internal/modules/esm/hooks.js
-37Lines 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,
@@ -658,45 +657,9 @@ function pluckHooks({
658657
globalPreload,
659658
resolve,
660659
load,
661-
// obsolete hooks:
662-
dynamicInstantiate,
663-
getFormat,
664-
getGlobalPreloadCode,
665-
getSource,
666-
transformSource,
667660
}) {
668-
const obsoleteHooks = [];
669661
const acceptedHooks = { __proto__: null };
670662

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

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

Copy file name to clipboardExpand all lines: test/es-module/test-esm-loader-obsolete-hooks.mjs
-28Lines changed: 0 additions & 28 deletions
This file was deleted.
Collapse file

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

Copy file name to clipboardExpand all lines: test/fixtures/es-module-loaders/hooks-obsolete.mjs
-22Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.