Uh oh!
There was an error while loading. Please reload this page.
module: bootstrap module loaders in shadow realm - #48655
Conversation
Review requested:
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
e1e63e3 to
23a9cb4CompareRebased on the tip of the main branch and removed dependencies on #48510 (with known limitation on memory leaks). Marking as ready to be reviewed. This PR would unblock the verification of built-in modules support in the shadow realm. |
nodejs-github-bot
commented
Aug 15, 2023
Uh oh!
There was an error while loading. Please reload this page.
23a9cb4 to
f1f3986Comparenodejs-github-bot
commented
Aug 17, 2023
GeoffreyBooth
commented
Aug 17, 2023
We’re working on eventually removing the CommonJS loader, leaving only the ESM loader as the single module loader (as it can load both CommonJS and ESM code). Is it possible to refactor this so that |
legendecas
commented
Aug 17, 2023
@GeoffreyBooth The ShadowRealm interface only exposes ESM Are you suggesting this PR didn't load modules in |
GeoffreyBooth
commented
Aug 17, 2023
I was just responding to the PR description, “This bootstraps ESM and CJS module loaders in the ShadowRealm.” Did what you mean to say that it allows for loading ESM and CJS modules in the ShadowRealm? I don’t really follow what a lot of the code in this PR does. If its only internal interactions with module loaders are through the ESM loader, then we’re good. |
legendecas
commented
Aug 17, 2023
Yes, CJS support in ShadowRealm is enabled by ESM loaders. It seems that the PR description is misleading somehow, I've fixed the wording. |
We had a similar situation with Also please make sure that the string is interpreted as a file URL and not as a path, because |
Uh oh!
There was an error while loading. Please reload this page.
This bootstraps ESM loaders in the ShadowRealm with `ShadowRealm.prototype.importValue` as its entry point and enables loading ESM and CJS modules in the ShadowRealm. The module is imported without a parent URL and resolved with the current process's working directory. PR-URL: #48655 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Avoid the realm being strongly referenced by the process binding data. PR-URL: #48655 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: #48655 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: #48655 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: #48655 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
The flag is always true and can be determined by isLoaderWorker solely. PR-URL: #48655 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This bootstraps ESM loaders in the ShadowRealm with `ShadowRealm.prototype.importValue` as its entry point and enables loading ESM and CJS modules in the ShadowRealm. The module is imported without a parent URL and resolved with the current process's working directory. PR-URL: #48655 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Notable changes: crypto: * update root certificates to NSS 3.95 (Node.js GitHub Bot) #50805 deps: * add simdjson (Yagiz Nizipli) #50322 fs: * add c++ fast path for writeFileSync utf8 (CanadaHonk) #49884 module: * merge config with `package_json_reader` (Yagiz Nizipli) #50322 * (SEMVER-MINOR) bootstrap module loaders in shadow realm (Chengzhong Wu) #48655 * (SEMVER-MINOR) remove useCustomLoadersIfPresent flag (Chengzhong Wu) #48655 src: * (SEMVER-MINOR) add `--disable-warning` option (Ethan Arrowood) #50661 * move package resolver to c++ (Yagiz Nizipli) #50322 * (SEMVER-MINOR) create per isolate proxy env template (Chengzhong Wu) #48655 * (SEMVER-MINOR) create fs_dir per isolate properties (Chengzhong Wu) #48655 * (SEMVER-MINOR) create worker per isolate properties (Chengzhong Wu) #48655 * (SEMVER-MINOR) make process binding data weak (Chengzhong Wu) #48655 PR-URL: #50954
Notable changes: crypto: * update root certificates to NSS 3.95 (Node.js GitHub Bot) #50805 deps: * add simdjson (Yagiz Nizipli) #50322 fs: * add c++ fast path for writeFileSync utf8 (CanadaHonk) #49884 module: * merge config with `package_json_reader` (Yagiz Nizipli) #50322 * (SEMVER-MINOR) bootstrap module loaders in shadow realm (Chengzhong Wu) #48655 * (SEMVER-MINOR) remove useCustomLoadersIfPresent flag (Chengzhong Wu) #48655 src: * (SEMVER-MINOR) add `--disable-warning` option (Ethan Arrowood) #50661 * move package resolver to c++ (Yagiz Nizipli) #50322 * (SEMVER-MINOR) create per isolate proxy env template (Chengzhong Wu) #48655 * (SEMVER-MINOR) create fs_dir per isolate properties (Chengzhong Wu) #48655 * (SEMVER-MINOR) create worker per isolate properties (Chengzhong Wu) #48655 * (SEMVER-MINOR) make process binding data weak (Chengzhong Wu) #48655 PR-URL: #50954
Notable changes: crypto: * update root certificates to NSS 3.95 (Node.js GitHub Bot) #50805 fs: * add c++ fast path for writeFileSync utf8 (CanadaHonk) #49884 module: * (SEMVER-MINOR) bootstrap module loaders in shadow realm (Chengzhong Wu) #48655 * (SEMVER-MINOR) remove useCustomLoadersIfPresent flag (Chengzhong Wu) #48655 src: * (SEMVER-MINOR) add `--disable-warning` option (Ethan Arrowood) #50661 * (SEMVER-MINOR) create per isolate proxy env template (Chengzhong Wu) #48655 * (SEMVER-MINOR) create fs_dir per isolate properties (Chengzhong Wu) #48655 * (SEMVER-MINOR) create worker per isolate properties (Chengzhong Wu) #48655 * (SEMVER-MINOR) make process binding data weak (Chengzhong Wu) #48655 PR-URL: #50954
Notable changes: crypto: * update root certificates to NSS 3.95 (Node.js GitHub Bot) #50805 fs: * add c++ fast path for writeFileSync utf8 (CanadaHonk) #49884 module: * (SEMVER-MINOR) bootstrap module loaders in shadow realm (Chengzhong Wu) #48655 * (SEMVER-MINOR) remove useCustomLoadersIfPresent flag (Chengzhong Wu) #48655 src: * (SEMVER-MINOR) add `--disable-warning` option (Ethan Arrowood) #50661 * (SEMVER-MINOR) create per isolate proxy env template (Chengzhong Wu) #48655 * (SEMVER-MINOR) create fs_dir per isolate properties (Chengzhong Wu) #48655 * (SEMVER-MINOR) create worker per isolate properties (Chengzhong Wu) #48655 * (SEMVER-MINOR) make process binding data weak (Chengzhong Wu) #48655 PR-URL: #50954
Avoid the realm being strongly referenced by the process binding data. PR-URL: #48655 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: #48655 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This bootstraps ESM loaders in the ShadowRealm with
ShadowRealm.prototype.importValueas its entry point and enables loading ESM and CJS modules in the ShadowRealm. The module is imported without a parent URL and resolved with the current process's working directory.