{"id":24235,"date":"2012-03-02T09:23:11","date_gmt":"2012-03-02T14:23:11","guid":{"rendered":"https:\/\/blogs.jetbrains.com\/idea\/?p=6817"},"modified":"2012-03-02T09:23:11","modified_gmt":"2012-03-02T14:23:11","slug":"javascript-version-selector","status":"publish","type":"idea","link":"https:\/\/blog.jetbrains.com\/fr\/idea\/2012\/03\/javascript-version-selector","title":{"rendered":"New in 11.1: JavaScript.next syntax support"},"content":{"rendered":"<p><em style=\"padding: 0.5em 0 0; display:block\">This is a cross-post from <a href=\"https:\/\/blog.jetbrains.com\/webide\/2012\/03\/javascript-version-selector\/\">WebStorm &amp; PhpStorm blog<\/a>, originally posted by Konstantin Ulitin.<\/em><\/p>\n<p>As you may know, there are different versions of the JavaScript language. Each JavaScript engine implementation adds some nice features that others don&#8217;t have. To make sure that you only use features suitable for targeted environments, choose the appropriate one in <em>Settings | Javascript<\/em>.<\/p>\n<p><a href=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2012\/02\/webide-JSLanguageLevel.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-6743\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2012\/02\/webide-JSLanguageLevel.png\" alt=\"JavaScript Language version setting\" width=\"700\" height=\"127\"\/><\/a><\/p>\n<p><!--more-->When you use language feature that isn&#8217;t supported by the currently selected JavaScript version, IntelliJ IDEA will notify you and suggest a Quick-Fix:<\/p>\n<p><a href=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2012\/02\/webide-UnsupportedJSLangLevelAfter.png\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-3303 alignnone\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2012\/02\/webide-UnsupportedJSLangLevelAfter.png\" alt=\"QuickFix suggestion\" width=\"382\" height=\"140\" \/><\/a><\/p>\n<p>For those who prefer to stay one step ahead, IDE presents experimental support of a new ongoing <strong>ECMAScript version code-named Harmony<\/strong>. New language features are poorly supported natively by browsers [<a href=\"#footnote1\">1<\/a>], but there are third-party tools for translating new syntax constructs into their JavaScript equivalents.<\/p>\n<p>We take\u00a0<a href=\"http:\/\/code.google.com\/p\/traceur-compiler\/\" target=\"_blank\" rel=\"noopener\">Traceur compiler<\/a> as a basis. The full list of supported features can be found on its\u00a0<a href=\"http:\/\/code.google.com\/p\/traceur-compiler\/wiki\/LanguageFeatures\" target=\"_blank\" rel=\"noopener\">wiki<\/a>.<\/p>\n<p>To try out new features, set\u00a0<em>ECMAScript Harmony<\/em> to be the JavaScript language version in settings. There are two ways to use new language features with your web project. One is to\u00a0<a href=\"http:\/\/code.google.com\/p\/traceur-compiler\/wiki\/CompillingOffline\" target=\"_blank\" rel=\"noopener\">compile<\/a> ecmascript harmony files before deployment. Another is to provide link on your html page to javascript sources of Traceur compiler, so that ecmascript harmony files are translated to JavaScript on each request. Instructions and an example\u00a0can be found\u00a0<a href=\"http:\/\/code.google.com\/p\/traceur-compiler\/wiki\/GettingStarted\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n<p>To help you with the new syntax, we&#8217;ve added the possibility to preview files\u00a0compiled\u00a0with Traceur. Simply right-click in the editor and select<em> Compile ES6 file with Traceur<\/em>:<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2012\/02\/webide-TraceurPreview.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2012\/02\/webide-TraceurPreview.png\" alt=\"Traceur compiled preview\" width=\"640\" height=\"528\" \/><\/a><\/p>\n<p style=\"text-align: left;\"><a href=\"http:\/\/confluence.jetbrains.net\/display\/IDEADEV\/IDEA+11.1+EAP\" target=\"_blank\" rel=\"noopener\">Download IntelliJ IDEA 11.1\u00a0EAP<\/a>. We&#8217;d also love to get your feedback in the\u00a0<a href=\"http:\/\/youtrack.jetbrains.com\/issues\/WI#newissue=yes\" target=\"_blank\" rel=\"noopener\">issue tracker<\/a> ;)<\/p>\n<p><a name=\"footnote1\"><\/a>Chromium project recently\u00a0<a href=\"http:\/\/blog.chromium.org\/2012\/02\/future-of-javascript-take-peek-today.html\" target=\"_blank\" rel=\"noopener\">announced<\/a> that implements some ECMAScript Harmony features. Firefox&#8217;s JavaScript engine already contains\u00a0<a href=\"https:\/\/developer.mozilla.org\/en\/New_in_JavaScript_1.7\" target=\"_blank\" rel=\"noopener\">many of them<\/a> and some\u00a0<a href=\"https:\/\/developer.mozilla.org\/en\/New_in_JavaScript_1.8.5\" target=\"_blank\" rel=\"noopener\">more<\/a>.<\/p>\n","protected":false},"author":63,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","categories":[826],"tags":[2945,197,3031],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/idea\/24235"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/idea"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/types\/idea"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/comments?post=24235"}],"version-history":[{"count":0,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/idea\/24235\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/media?parent=24235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/categories?post=24235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/tags?post=24235"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/cross-post-tag?post=24235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}