node/tools
Joyee Cheung ad0bcb9c02
vm: support using the default loader to handle dynamic import()
This patch adds support for using
`vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER` as
`importModuleDynamically` in all APIs that take the option
except `vm.SourceTextModule`. This allows users to have a shortcut
to support dynamic import() in the compiled code without missing
the compilation cache if they don't need customization of the
loading process. We emit an experimental warning when the
`import()` is actually handled by the default loader through
this option instead of requiring `--experimental-vm-modules`.

In addition this refactors the documentation for
`importModuleDynamically` and adds a dedicated section for it
with examples.

`vm.SourceTextModule` is not supported in this patch because
it needs additional refactoring to handle `initializeImportMeta`,
which can be done in a follow-up.

PR-URL: https://github.com/nodejs/node/pull/51244
Fixes: https://github.com/nodejs/node/issues/51154
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2024-02-01 11:45:42 +00:00
..
actions
bootstrap
clang-format
configure.d
dep_updaters tools: set normalizeTD text default to empty string 2024-01-24 17:39:36 +00:00
doc vm: support using the default loader to handle dynamic import() 2024-02-01 11:45:42 +00:00
eslint-rules
github_reporter tools: update github_reporter to 1.5.4 2024-01-10 08:08:18 +00:00
gyp tools: update gyp-next to v0.16.1 2023-10-31 12:44:38 +00:00
icu deps: update icu to 74.1 2023-11-21 16:55:15 -05:00
inspector_protocol tools: update inspector_protocol to 83b1154 2024-01-11 04:41:26 +00:00
lint-md tools: update lint-md-dependencies to rollup@4.9.6 2024-01-30 00:45:49 +00:00
macos-installer
msvs
node_modules tools: update eslint to 8.56.0 2023-12-19 04:38:28 +00:00
pip
snapshot src: support configurable snapshot 2023-12-15 15:13:46 +01:00
v8
v8_gypfiles tools: fix loong64 build 2024-01-24 21:02:10 +00:00
zos
.eslintrc.yaml
build-addons.mjs node-api: segregate nogc APIs from rest via type system 2023-12-19 07:37:15 +00:00
certdata.txt crypto: update root certificates to NSS 3.95 2023-11-21 20:55:50 +00:00
checkimports.py tools: refactor checkimports.py 2023-10-15 15:14:57 +00:00
compress_json.py
copyfile.py
cpplint.py tools: remove deprecated python api 2024-01-06 20:58:03 -06:00
create_android_makefiles
create_expfile.sh
enable_fips_include.py
executable_wrapper.h
find-inactive-collaborators.mjs
find-inactive-tsc.mjs
gen_node_def.cc
generate_config_gypi.py v8,tools: expose necessary V8 defines 2023-11-25 04:30:50 +00:00
getarch.py
getendian.py
getmachine.py
getmoduleversion.py
getnapibuildversion.py
getnodeversion.py
getsharedopensslhasquic.py
gyp_node.py
gypi_to_gn.py doc: the GN files should use Node's license 2023-12-28 20:27:05 +00:00
install.py tools: add new V8 headers to distribution 2023-10-10 08:26:55 +02:00
js2c.cc
license2rtf.mjs
license-builder.sh doc: the GN files should use Node's license 2023-12-28 20:27:05 +00:00
lint-pr-url.mjs
lint-sh.mjs
lsan_suppressions.txt
macos-firewall.sh
make-v8.sh tools: limit parallelism with ninja in V8 builds 2024-01-17 17:56:46 +00:00
merge-wpt-reports.mjs
mk-ca-bundle.pl
mkssldef.py
osx-codesign.sh
osx-entitlements.plist
osx-notarize.sh tools: add macOS notarization verification step 2023-11-23 13:51:51 -05:00
osx-pkg-postinstall.sh
osx-productsign.sh
pseudo-tty.py
release.sh
run-valgrind.py
run-worker.js
search_files.py build: add GN build files 2023-11-11 09:51:05 +00:00
sign.bat win,tools: upgrade Windows signing to smctl 2023-12-08 21:58:17 +00:00
specialize_node_d.py
test-npm-package.js
test-v8.bat
test.py test: fix timeout of test-cpu-prof-dir-worker.js in LoongArch devices 2023-11-02 07:29:56 +00:00
update-timezone.mjs
utils.py test: fix timeout of test-cpu-prof-dir-worker.js in LoongArch devices 2023-11-02 07:29:56 +00:00
v8-json-to-junit.py
valgrind.supp