From 9917d7601b36068d2408b0be3f9b6ac5a781fed0 Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Wed, 29 Nov 2017 19:15:47 -0600 Subject: [PATCH 1/3] doc: import() is supported now --- doc/api/esm.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/api/esm.md b/doc/api/esm.md index c352c24aa1c56d..1dcf77fb8c8aea 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -33,15 +33,14 @@ node --experimental-modules my-app.mjs ### Supported Only the CLI argument for the main entry point to the program can be an entry -point into an ESM graph. In the future `import()` can be used to create entry -points into ESM graphs at run time. +point into an ESM graph. `import()` can also be used to create entry points +into ESM graphs at run time. ### Unsupported | Feature | Reason | | --- | --- | | `require('./foo.mjs')` | ES Modules have differing resolution and timing, use language standard `import()` | -| `import()` | pending newer V8 release used in Node.js | | `import.meta` | pending V8 implementation | ## Notable differences between `import` and `require` From 128196b3e6441ecfacfb3843d09a7a34a89e5d46 Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Fri, 1 Dec 2017 09:53:38 -0600 Subject: [PATCH 2/3] Update esm.md --- doc/api/esm.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/esm.md b/doc/api/esm.md index 1dcf77fb8c8aea..829599eef8142e 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -33,14 +33,14 @@ node --experimental-modules my-app.mjs ### Supported Only the CLI argument for the main entry point to the program can be an entry -point into an ESM graph. `import()` can also be used to create entry points +point into an ESM graph. Dynamic import can also be used to create entry points into ESM graphs at run time. ### Unsupported | Feature | Reason | | --- | --- | -| `require('./foo.mjs')` | ES Modules have differing resolution and timing, use language standard `import()` | +| `require('./foo.mjs')` | ES Modules have differing resolution and timing, use dynamic import | | `import.meta` | pending V8 implementation | ## Notable differences between `import` and `require` From 88fae53eb5fb25aae8d74affe75beedbc6300d28 Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Tue, 5 Dec 2017 20:16:21 -0600 Subject: [PATCH 3/3] add flag --- doc/api/esm.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/esm.md b/doc/api/esm.md index 829599eef8142e..d6883d45622454 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -33,8 +33,8 @@ node --experimental-modules my-app.mjs ### Supported Only the CLI argument for the main entry point to the program can be an entry -point into an ESM graph. Dynamic import can also be used to create entry points -into ESM graphs at run time. +point into an ESM graph. Dynamic import can also be used with the flag +`--harmony-dynamic-import` to create entry points into ESM graphs at run time. ### Unsupported