From ad90f4ad99c4c73f1ad0a336793f7283798079b7 Mon Sep 17 00:00:00 2001 From: Geoffrey Booth Date: Sun, 18 Dec 2016 23:25:01 -0800 Subject: [PATCH] Update introduction for CoffeeScript 2 --- documentation/sections/coffeescript_2.md | 5 +++++ documentation/sections/introduction.md | 4 +--- documentation/v2/body.html | 3 +++ documentation/v2/sidebar.html | 3 +++ package.json | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 documentation/sections/coffeescript_2.md diff --git a/documentation/sections/coffeescript_2.md b/documentation/sections/coffeescript_2.md new file mode 100644 index 00000000..b8d545a6 --- /dev/null +++ b/documentation/sections/coffeescript_2.md @@ -0,0 +1,5 @@ +## CoffeeScript 2 + +CoffeeScript 2 generates JavaScript that uses the latest ES2015+ features. It is your responsibility to ensure that your target JavaScript runtime(s) support all these features, or that you pass the output through another transpiler like [Babel](http://babeljs.io/), [Rollup](https://github.com/rollup/rollup) or [Traceur Compiler](https://github.com/google/traceur-compiler). In general, [CoffeeScript 2’s output is fully supported by Node.js 7+](http://node.green/), although async functions require the `--harmony` or `--harmony-async-await` flags; and ES2015 modules require an additional transpiler. Output JavaScript intended for browsers generally requires additional transpilation. + +If you’re looking for a single tool that takes CoffeeScript input and generates JavaScript output that runs in any JavaScript runtime, assuming you opt out of certain newer features, stick to the [CoffeeScript 1.x branch](v1/). CoffeeScript 2 [breaks compatibility](https://github.com/jashkenas/coffeescript/wiki/%5BWIP%5D-Breaking-changes-in-CoffeeScript-2) with certain CoffeeScript 1.x features in order to conform with the ES2015+ specifications, and generate more idiomatic output (a CoffeeScript `=>` becomes an ES `=>`; a CoffeeScript `class` becomes an ES `class`; and so on). diff --git a/documentation/sections/introduction.md b/documentation/sections/introduction.md index 0f460cf2..ccca3c79 100644 --- a/documentation/sections/introduction.md +++ b/documentation/sections/introduction.md @@ -1,8 +1,6 @@ **CoffeeScript is a little language that compiles into JavaScript.** Underneath that awkward Java-esque patina, JavaScript has always had a gorgeous heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way. -The golden rule of CoffeeScript is: _“It’s just JavaScript”_. The code compiles one-to-one into the equivalent JS, and there is no interpretation at runtime. You can use any existing JavaScript library seamlessly from CoffeeScript (and vice-versa). The compiled output is readable, pretty-printed, and tends to run as fast or faster than the equivalent handwritten JavaScript. - -The CoffeeScript compiler goes to great lengths to generate output JavaScript that runs in every JavaScript runtime, but there are exceptions. Use [generator functions](#generator-functions), [`for…from`](#generator-iteration), or [tagged template literals](#tagged-template-literals) only if you know that your [target runtimes can support them](http://kangax.github.io/compat-table/es6/). If you use [modules](#modules), you will need to [use an additional tool to resolve them](#modules-note). +The golden rule of CoffeeScript is: _“It’s just JavaScript.”_ The code compiles one-to-one into the equivalent JS, and there is no interpretation at runtime. You can use any existing JavaScript library seamlessly from CoffeeScript (and vice-versa). The compiled output is readable, pretty-printed, and tends to run as fast or faster than the equivalent handwritten JavaScript. **Latest Version:** [<%= fullVersion %>](http://github.com/jashkenas/coffeescript/tarball/<%= fullVersion %>) diff --git a/documentation/v2/body.html b/documentation/v2/body.html index 4eb29606..aadfd66d 100644 --- a/documentation/v2/body.html +++ b/documentation/v2/body.html @@ -15,6 +15,9 @@ <%= htmlFor('introduction') %> <%= htmlFor('overview') %> +
+ <%= htmlFor('coffeescript_2') %> +
<%= htmlFor('installation') %>
diff --git a/documentation/v2/sidebar.html b/documentation/v2/sidebar.html index e24e1620..ba66041b 100644 --- a/documentation/v2/sidebar.html +++ b/documentation/v2/sidebar.html @@ -3,6 +3,9 @@ + diff --git a/package.json b/package.json index 779acd13..15040bbd 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "version": "2.0.0-alpha", "license": "MIT", "engines": { - "node": ">=6.9.1" + "node": ">=7.2.1" }, "directories": { "lib": "./lib/coffee-script"