Skip to content

Commit 6df8f5f

Browse files
committed
Remove references to Node's experimental modules support
1 parent 776e7e5 commit 6df8f5f

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

docs/v2/index.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -893,8 +893,7 @@ <h3>What’s New In CoffeeScript 2?</h3>
893893
<h3>Compatibility</h3>
894894
<p>Most modern JavaScript features that CoffeeScript supports can run natively in Node 7.6+, meaning that Node can run CoffeeScript’s output without any further processing required. Here are some notable exceptions:</p>
895895
<ul>
896-
<li><a href="#jsx">JSX</a> always requires transpilation.</li>
897-
<li><a href="#modules">Modules</a> (<code>import</code> and <code>export</code> statements) are supported by Node 10+, provided you specify an output filename with an <code>.mjs</code> extension (or rename the extensions of the generated <code>.js</code> files) and execute such files via <code>node</code>, not <code>coffee</code>.</li>
896+
<li><a href="#modules">Modules</a> and <a href="#jsx">JSX</a> always require transpilation.</li>
898897
<li><a href="http://coffeescript.org/#splats">Splats, a.k.a. object rest/spread syntax, for objects</a> are supported by Node 8.6+.</li>
899898
<li>The <a href="https://github.com/tc39/proposal-regexp-dotall-flag">regular expression <code>s</code> (dotall) flag</a> is supported by Node 9+.</li>
900899
</ul>
@@ -4406,7 +4405,7 @@ <h2>Modules</h2>
44064405

44074406
</aside>
44084407
<div id="modules-note" class="bookmark"></div>
4409-
<p>Note that the CoffeeScript compiler <strong>does not resolve modules</strong>; writing an <code>import</code> or <code>export</code> statement in CoffeeScript will produce an <code>import</code> or <code>export</code> statement in the resulting output. It is your responsibility to <a href="#transpilation">transpile</a> this ES2015 syntax into code that will work in your target runtimes, unless you know that your code will be executed by a runtime that supports <a href="https://nodejs.org/api/esm.html">ES modules</a>. Node supports such modules only for files with <code>.mjs</code> extensions; you can generate such an extension via the <code>coffee</code> command for a single file via <code>--output</code>, as in <code>coffee --compile --output index.mjs index.coffee</code>. When compiling folders or globs, it is your responsibility to rename the generated <code>.js</code> files as needed.</p>
4408+
<p>Note that the CoffeeScript compiler <strong>does not resolve modules</strong>; writing an <code>import</code> or <code>export</code> statement in CoffeeScript will produce an <code>import</code> or <code>export</code> statement in the resulting output. It is your responsibility to <a href="#transpilation">transpile</a> this ES2015 syntax into code that will work in your target runtimes.</p>
44104409
<p>Also note that any file with an <code>import</code> or <code>export</code> statement will be output without a <a href="#lexical-scope">top-level function safety wrapper</a>; in other words, importing or exporting modules will automatically trigger <a href="#usage">bare</a> mode for that file. This is because per the ES2015 spec, <code>import</code> or <code>export</code> statements must occur at the topmost scope.</p>
44114410

44124411
</section>

documentation/sections/compatibility.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
Most modern JavaScript features that CoffeeScript supports can run natively in Node 7.6+, meaning that Node can run CoffeeScript’s output without any further processing required. Here are some notable exceptions:
44

5-
* [JSX](#jsx) always requires transpilation.
6-
* [Modules](#modules) (`import` and `export` statements) are supported by Node 10+, provided you specify an output filename with an `.mjs` extension (or rename the extensions of the generated `.js` files) and execute such files via `node`, not `coffee`.
5+
* [Modules](#modules) and [JSX](#jsx) always require transpilation.
76
* [Splats, a.k.a. object rest/spread syntax, for objects](http://coffeescript.org/#splats) are supported by Node 8.6+.
87
* The [regular expression `s` (dotall) flag](https://github.com/tc39/proposal-regexp-dotall-flag) is supported by Node 9+.
98

documentation/sections/modules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ codeFor('modules')
88

99
<div id="modules-note" class="bookmark"></div>
1010

11-
Note that the CoffeeScript compiler **does not resolve modules**; writing an `import` or `export` statement in CoffeeScript will produce an `import` or `export` statement in the resulting output. It is your responsibility to [transpile](#transpilation) this ES2015 syntax into code that will work in your target runtimes, unless you know that your code will be executed by a runtime that supports [ES modules](https://nodejs.org/api/esm.html). Node supports such modules only for files with `.mjs` extensions; you can generate such an extension via the `coffee` command for a single file via `--output`, as in `coffee --compile --output index.mjs index.coffee`. When compiling folders or globs, it is your responsibility to rename the generated `.js` files as needed.
11+
Note that the CoffeeScript compiler **does not resolve modules**; writing an `import` or `export` statement in CoffeeScript will produce an `import` or `export` statement in the resulting output. It is your responsibility to [transpile](#transpilation) this ES2015 syntax into code that will work in your target runtimes.
1212

1313
Also note that any file with an `import` or `export` statement will be output without a [top-level function safety wrapper](#lexical-scope); in other words, importing or exporting modules will automatically trigger [bare](#usage) mode for that file. This is because per the ES2015 spec, `import` or `export` statements must occur at the topmost scope.

0 commit comments

Comments
 (0)