This repository has been archived by the owner on Nov 21, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
125 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" class="faq"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta name="description" content="iojs"> | ||
<meta name="keywords" content="iojs, io.js, io js, javascript io, uv, libuv, node-forward, node forward, node, node.js, node.js forward, nodejs, nodejs forward, javascript"> | ||
<title>Javascript IO - FAQ</title> | ||
<link href="style.css" rel="stylesheet" type="text/css"> | ||
|
||
</head> | ||
|
||
<body> | ||
<h1 class="heading">ES6 on io.js</h1> | ||
|
||
<div class="description"> | ||
|
||
<p>io.js is built against modern versions of <a href="https://code.google.com/p/v8/">V8</a>. By keeping up-to-date with the latest releases of this engine we ensure new features from the <a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">JavaScript ECMA-262 specification</a> are brought to io.js developers in a timely manner, as well as continued performance and stability improvements.</p> | ||
<p>Version 1.0.0 of io.js ships with V8 3.31.71.4, which includes ES6 features well beyond version 3.26.33 that will be shipped with joyent/node@0.12.x.</p> | ||
</div> | ||
|
||
<div class="faq-item"> | ||
|
||
<h2 class="faq-title">No more --harmony flag</h2> | ||
<div class="faq-body"> | ||
<p>On joyent/node@0.12.x (V8 3.26), the <code>--harmony</code> runtime flag enabled all <strong>completed</strong>, <strong>staged</strong> and <strong>in progress</strong> ES6 features together, in bulk (with the exception of nonstandard/non-harmonious semantics for <code>typeof</code> which were hidden under <code>--harmony-typeof</code>). This meant that some really buggy or even broken features like <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy">proxies</a> were just as readily available for developers as <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*">generators</a>, which had very little or even no known-issues. As such, it was best practice to either enable only certain features by using specific runtime harmony feature flags (e.g. <code>--harmony-generators</code>), or simply enable all of them and then use a restricted subset.</p> | ||
<p>With io.js@1.x (V8 3.31+), all that complexity goes away. All harmony features are now logically split into three groups for <strong>shipping</strong>, <strong>staged</strong> and <strong>in progress</strong> features:</p> | ||
|
||
<ul class="task-list"> | ||
<li>All <strong>shipping</strong> features, the ones that V8 has considered stable, like <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*">generators</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/template_strings">templates</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla#Additions_to_the_String_object">new string methods</a> and many others are turned <strong>on by default on io.js</strong> and do <strong>NOT</strong> require any kind of runtime flag. </li> | ||
<li>Then there are <strong>staged</strong> features which are almost-completed features that haven't been completely tested or updated to the latest spec yet and therefore are not considered stable by the V8 team (e.g. there might be some edge cases left to discover). This is probably the equivalent of the state of <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*">generators</a> on 3.26. These are the "use at your own risk" type of features that now require a runtime flag: <code>--es_staging</code> (or its synonym, <code>--harmony</code>).</li> | ||
<li>Finally, all <strong>in progress</strong> features can be activated individually by their respective harmony flag (e.g. <code>--harmony_arrow_functions</code>), although this is highly discouraged unless for testing purposes.</li> | ||
</ul> | ||
</div> | ||
|
||
<h2 class="faq-title"> | ||
Which ES6 features ship with io.js by default (no runtime flag required)? | ||
</h2> | ||
<div class="faq-body"> | ||
<ul class="task-list"> | ||
<li>Block scoping</li> | ||
<ul class="task-list"> | ||
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let">let</a></li> | ||
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const">const</a></li> | ||
<li><code>function</code>-in-blocks (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode">strict mode only)</a></li> | ||
</ul> | ||
<li>Collections</li> | ||
<ul class="task-list"> | ||
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map">Map</a></li> | ||
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap">WeakMap</a></li> | ||
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set">Set</a></li> | ||
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet">WeakSet</a></li> | ||
</ul> | ||
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*">Generators</a></li> | ||
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Numeric_literals">Binary and Octal literals</a></li> | ||
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promises</a></li> | ||
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla#Additions_to_the_String_object">New String methods</a></li> | ||
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol">Symbols</a></li> | ||
<li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/template_strings">Template strings</a></li> | ||
</ul> | ||
|
||
<p>You can view a more detailed list, including a comparison with other engines, on the <a href="https://kangax.github.io/compat-table/es6/">compat-table</a> project page.</p> | ||
</div> | ||
</div> | ||
|
||
<div class="faq-item"> | ||
<h2 class="faq-title"> | ||
Which ES6 features are behind the --es_staging flag? | ||
</h2> | ||
<div class="faq-body"> | ||
<ul class="task-list"> | ||
<li><a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class">Classes</a> (strict mode only)</li> | ||
<li><a href="http://wiki.ecmascript.org/doku.php?id=harmony:object_literals">Object literal extensions</a></li> | ||
<li> | ||
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol"><code>Symbol.toStringTag</code></a> (user-definable results for <code>Object.prototype.toString</code>)</li> | ||
</ul> | ||
</div> | ||
</div> | ||
|
||
<div class="faq-item"> | ||
|
||
<h2 class="faq-title"> | ||
I have my infrastructure set up to leverage the --harmony flag. Should I remove it? | ||
</h2> | ||
<div class="faq-body"> | ||
<p>The current behaviour of the <code>--harmony</code> flag on io.js is to enable <strong>staged</strong> features only. After all, it is now a synonym of <code>--es_staging</code>. As mentioned above, these are completed features that have not been considered stable yet. If you want to play safe, especially on production environments, consider removing this runtime flag until it ships by default on V8 and, consequently, on io.js. If you keep this enabled, you should be prepared for further io.js upgrades to break your code if V8 changes their semantics to more closely follow the standard.</p> | ||
</div> | ||
</div> | ||
|
||
<div class="faq-item"> | ||
|
||
<h2 class="faq-title"> | ||
How do I find which version of V8 ships with a particular version of io.js? | ||
</h2> | ||
<div class="faq-body"> | ||
<p>io.js provides a simple way to list all dependencies and respective versions that ship with a specific binary through the <code>process</code> global object. In case of the V8 engine, type the following in your terminal to retrieve its version:</p> | ||
<div class="highlight highlight-sh"><pre>iojs -e <span class="pl-s1"><span class="pl-pds">'</span>console.log(process.versions.v8)<span class="pl-pds">'</span></span></pre></div> | ||
|
||
<p>E.g. output: <code>3.31.71.4</code>.</p> | ||
|
||
</div> | ||
</div> | ||
|
||
<div class="faq-item"> | ||
|
||
<h2 class="faq-title"> | ||
How frequently do you plan on updating V8? | ||
</h2> | ||
<div class="faq-body"> | ||
<p>A formal plan has not been discussed yet but the TC is looking into regular updates, especially if there are no breaking changes from V8's API.</p> | ||
</div> | ||
</div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8d22062
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marking this commit as relating to #20