
Node.js v6.0 Released - JoshGlazebrook
https://nodejs.org/en/blog/announcements/v6-release/?release
======
altano
For anyone using TypeScript to build your Node.js code, you can now switch
your target to es6/es2015 in your tsconfig.json:

    
    
        {
            "compilerOptions": {
                "target": "es2015",
                "module": "commonjs"
            }
        }
    

Assuming you're not using that 7% ([http://node.green/](http://node.green/))
:)

Just make sure to update your package.json to take a hard dependency on Node
6+ if you do that:

    
    
        { "engines" : { "node" : ">=6.0.0" } }
    

This will make it so that ES6-compat is assumed and TS won't transpile ES6
functionality, but it will use commonjs for modules, which means your TS will
almost be a 1:1 mapping with the compiled JS and everything should just work.

~~~
jkrems
Personal pet peeve: Please don't set the node engine field in npm packages. It
potentially breaks your package whenever there's a new release candidate
because `node@7.0.0-rc.1` is less than (!) `node@6.0.0` when it comes to npm's
handling of this field.

~~~
kodfodrasz
node.js and JavaScript in general make PHP look a well designed decent
language and ecosystem.

I cannot grok how can people chose this stack to create any product in it.

~~~
homogeneous
What does this type of condescending bile add to the discussion? Thousands of
companies successfully use PHP and node to write excellent software every day.
If you despise node so fervently, why are you even engaging in a thread about
the latest node release?

Personally, I prefer ruby whenever its an option, but I've worked with node in
the past and it's a decent platform that worked very well for the company (a
commercial app servicing about 840k api and page requests per month).

I just don't understand the hate.

~~~
aviraldg
So negative opinions about '*' should never be expressed?

JavaScript is a terrible language, and imho es2015 fixes a lot of broken stuff
in the only backwards-compatible way it can. That said, I find the entire
micropackage culture around npm and node, coupled with the hundreds of
packages that typically constitute build scripts for even a smallish node
project make me realize just how brittle it is compared to competing
platforms.

~~~
homogeneous
"Negative opinions" are fine. Heaping on condescending substance-free
exclamations of ridicule in the middle of a thread about a specific issue
regarding a platform you don't even use is just toxic arrogance.

Your "micropackage" complaint is daft; if you don't like small modules don't
use them. Why is the language to blame for _free_ , open-source code that _you
don 't have to use_? How is this even a legitimate complaint? You don't _need_
hundreds of packages for anything and you can find examples of this in any
language.

------
latimer
FYI for anyone looking for the downloads, v6.0 technically hasn't been
released yet. It will most likely be out within a few hours.

Edit: of course right after I say it isn't released, it is released. :)

Release post:
[https://nodejs.org/en/blog/release/v6.0.0/](https://nodejs.org/en/blog/release/v6.0.0/)

~~~
rattray
Looks like there is not yet a Homebrew PR:
[https://github.com/Homebrew/homebrew-
core/pulls](https://github.com/Homebrew/homebrew-core/pulls)

Current formula still points to v5.11: [https://github.com/Homebrew/homebrew-
core/blob/master/Formul...](https://github.com/Homebrew/homebrew-
core/blob/master/Formula/node.rb)

EDIT: PR created: [https://github.com/Homebrew/homebrew-
core/pull/633](https://github.com/Homebrew/homebrew-core/pull/633)

~~~
ufmace
Looks like a PR was created ~4min ago.

Sidenote - was just messing with Homebrew a few days ago, and found it a
little bizarre that all of the recipes are in source control and require a
pull to update, rather than being on a server somewhere.

~~~
bytesandbots
Such things can get painful for github

[https://github.com/CocoaPods/CocoaPods/issues/4989#issuecomm...](https://github.com/CocoaPods/CocoaPods/issues/4989#issuecomment-193772935)

~~~
rattray
I think that's a different issue.

------
olalonde
On a related note, does anyone know if there's a way to tell Babel that your
compilation target is Node.js v6.0 and only have it compile stuff that isn't
natively supported yet?

Edit: Thanks for all the answers. I just went through the list of unsupported
features and as I'm not using any of the remaining 7%, I might be able to get
rid of Babel during development if I'm lucky.

Edit 2: Oops, still no es6 module support :(

~~~
benologist
Isn't Babel 93% redundant on the server side now? If you're not very dependent
on the last 7% I'd just remove it.

~~~
nostrademons
The big missing thing is modules, which aren't in the kangax compatibility
table.

~~~
tracker1
In fairness, the babel approach to module handling is probably better than an
in-browser es6 module implementation, or what may follow... compatibility with
npm packages (cjs) will be significant for a while.

~~~
nostrademons
My understanding is that V8 will provide hooks that parse the module imports,
then delegate to the embedder to fetch the actual source code and hand it back
to V8 to load. I'd expect that the Node implementation of these hooks would
work the same way as the existing require() machinery, so that existing
libraries will continue to work.

------
dchuk
Interesting how this is written as a traditional press release rather than
software release notes like most other open source projects

~~~
dkopi
Here's the changelog:
[https://raw.githubusercontent.com/nodejs/node/v6.x/CHANGELOG...](https://raw.githubusercontent.com/nodejs/node/v6.x/CHANGELOG.md)

Notable changes summarized here:
[https://github.com/nodejs/node/pull/6383](https://github.com/nodejs/node/pull/6383)

------
iMark
I've been a front end developer for, well, quite a while, and in that time
we've gone from cycles of around a decade (thank you IE6!) for new versions of
JS to something closer to a couple of years.

The future, as I see it, is incredibly bright.

------
rogerwang
NW.js v0.15.0 beta released with Node.js v6 :
[http://nwjs.io/blog/v0.15.0-beta1/](http://nwjs.io/blog/v0.15.0-beta1/)

------
empyrical
I'm really curious to see the kinds of things people will cook up with the new
Proxy object

------
pseudobry
And now available on Google App Engine (Flexible Environment).

Example app running v6.0.0:
[http://nodejs600.appspot.com/](http://nodejs600.appspot.com/)

------
hiphipjorge
Is there a plan for Node.js to get `import` any times soon? Will we need babel
in order to use this for months? years? ever?

~~~
inglor
There is/was a vote on this pretty soon. We are deciding how modules would
work - with a new file extension? With a module.json? With a separate entry
entry in package.json? Lots of decisions to be made :)

~~~
abritinthebay
Surely they should work the way they work in ES6?

Any solution that requires extra work (file extension, another file to
maintain) is a non-starter.

Frankly it should work how Babel transpiles it - because there's no reason for
it not to.

~~~
mudetroit
ES6 didn't define precisely how module loading worked, one of the reasons it
isn't actually implemented yet. And there are actual reasons why the method
babel currently uses won't precisely match the actual implementations (see
hierarchal v flat dependencies)

~~~
abritinthebay
Those problems are just as present in CJS as far as I'm aware though...?

Yet they were solved for that.

------
smithclay
For those curious about the performance improvements,
[https://benchmarking.nodejs.org](https://benchmarking.nodejs.org) has you
covered.

------
vinnymac
Any idea why the node-compat-table says 96%?
[http://node.green/](http://node.green/)

~~~
joekrill
Uncheck "requires harmony flag " and it falls to 92%. I'm guessing the extra
percent is a rounding issue.

------
mmaunder
I'm using webstorm to write a node app. I'm using ES6 and webstorm transpiles
it to 5.1. Details here:

[http://blog.jetbrains.com/webstorm/2015/05/ecmascript-6-in-w...](http://blog.jetbrains.com/webstorm/2015/05/ecmascript-6-in-
webstorm-transpiling/)

I'm using node 5.9.1 and webstorm creates a _-compiled.js and_
-compiled.js.map file for each transpiled file.

If I use Node 6 which I understand is now up to 95% support for ES6, do I
still need to transpile to ES5.1? Is anyone else using webstorm with ES6 and
are you also going through this transpiling step?

------
gbog
"Fastest Growing Platform"

Does this refer to growth in number of users or in number of modules? Or maybe
just counting the number of lines of code?

~~~
uptownJimmy
It makes me feel a little ill to think of all the new-ish devs jumping on the
Node train, thinking it's the Next Big Thing in server code. It's a cool
technology, and incredibly easy to get into, but then the curve gets so very
steep as you try to make it behave like any of the robust and fundamentally
sound language/framework app development ecosystems.

If I could offer any advice to anyone who is relatively new to all this, I
would say choose anything else: Ruby/Rails, PHP/Symfony, Python/Django,
Java/Spring, C#/.NET, whatever. You'll be doing yourself a favor. Learn how to
do things correctly, in an tech stack that actually exists and works properly
and makes sense, then see where things stand for JS on the server in a couple
years. The bad habits, mistaken assumptions, and rampant misinformation being
spread in the JS world these days is just amazing.

~~~
mjesuele
"Choose anything else" sounds like some FUD to me. I'm not an expert with all
the technologies you mentioned but I feel like Meteor has just recently truly
come into its own and I would pick it over Rails, Django, or anything PHP any
day.

I think another factor is the level of conservatism of the programmer in
question: would you rather work on stable but somewhat boring platforms at a
large enterprise, or do you want to be on that new-new at a hip startup?
(These options obviously exist on a spectrum.)

If you want to be in the fastest-moving, most exciting ecosystem around, it
seems to me that JS is the train you want to be on.

------
webo
This is a great news.

Are there any tools that statically or otherwise checks any potentially
breaking pieces in the Node v4+ codebase/dependencies?

------
gotofritz
Note that the require mechanism is quite flakey, and they are discussing a new
release or even reverting
[https://github.com/nodejs/node/issues/3402#issuecomment-2151...](https://github.com/nodejs/node/issues/3402#issuecomment-215166795)

------
lhorie
Released where? Download page still points to v4.4.3 (LTS)/v5.11 (current)

~~~
svieira
Release build failed -
[https://github.com/nodejs/node/pull/6383#issuecomment-214844...](https://github.com/nodejs/node/pull/6383#issuecomment-214844512)

New one is running, and should be out soon-ish.

~~~
lhorie
It's there now, awesome! Going to take it for a spin now

------
Scarbutt
Why doesn't tail call optimization get any love?

~~~
chr1
Unfortunately it get's lots of pushback instead. It seems very likely that
syntax will get changed to `return continue fn()`
[https://github.com/tc39/proposal-ptc-
syntax](https://github.com/tc39/proposal-ptc-syntax)

Somewhat related there is no optimization for passing arbitrary length arrays
with `...` to function having `...rest` as the last argument, which means
[].splice is still a footgun:(

~~~
jzwinck
That explicit tail recursion syntax is pretty gross. Is there a precedent in
any other language?

~~~
endgame
Clojure's recur is kinda-close, I guess?

~~~
preek
It is, but Clojure uses it, because it cannot really do Tail Call Optimization
due to constraints on the JVM. Therefore "recur" is required to keep the Stack
from overflowing.

------
therealmarv
Is it stupid to still use v0.12 ? Last time I've checked I've had
compatibility issues with all new (now old) io.js versions.

~~~
dhritzkiv
What sort of compatibility issues? Most packages update to work with new Node
releases fairly quickly. Usually the packages that have compatibility issues
are ones with native C++ bindings. If you `npm rm` the package and reinstall
it, it will usually build correctly for the latest Node/V8 release.

Further, if you have a project that for whatever reason is not feasible to
update to run on modern Current Node, you can use `nvm` or `n` to choose which
Node release you want to use: i.e. `nvm exec 0.12 node old-project.js` and
`nvm exec 6.0 node fresh-project.js`. v6 (and the versions that preceded it)
has made Javascript _really_ enjoyable to write.

~~~
Macha
Our biggest issue is to get off node 0.12, we need to get off protractor 2,
and some of our protractor tests fail on protractor 3 for reasons no one has
yet figured out. The only clue is a note saying selenium webdriver 2.48
changed how its control flow worked, but nowhere is what changed from 2.47 to
2.48 documented.

~~~
Havvy
You can't diff between 2.47 and 2.48 and see what changed? Or is that a binary
part you don't have source access to?

~~~
Macha
"Showing 930 changed files with 13,029 additions and 10,187 deletions. "

Feel free to try:
[https://github.com/SeleniumHQ/selenium/compare/selenium-2.47...](https://github.com/SeleniumHQ/selenium/compare/selenium-2.47.0...selenium-2.48.2?expand=1)

It's a dependency of a dependency with multiple language versions in the one
repository.

------
nemo1618
Is there a list of the remaining 7% features?

~~~
morgante
[http://node.green/](http://node.green/)

------
proyb
I like to see some benchmark for latency and throughput, as far as only
official benchmark is exist.

------
nikolay
Released where? It's not in the GitHub releases, not on the homepage either.

------
chowes
I'm assuming this is backwards-compatible with 5.X?

~~~
btmills
The major version bump indicates there are changes that could break some use
cases. There's a partial changelog [0] in the v6 release pull request.

[0]
[https://github.com/nodejs/node/pull/6383#issue-151012738](https://github.com/nodejs/node/pull/6383#issue-151012738)

------
known
Hope its not getting bloated

------
yuvalkarmi
Why is there a press release for this sort of thing?

~~~
tomcam
Do you have a problem with it?

------
ZLeviathan
interesting...considering JavaScript itself is a shaky language.

------
wrong_variable
babel sucks - I never though I could hate something so strongly.

Just today I had to deal with the fact that babel wraps ALL your generators in
some shit function.

Why ? just why ? generation function was supported in browsers longer then the
age all the babel maintainers combined.

The worst part is I do not use babel myself - I wouldn't touch it with a ten
foot pole but am forced to use it due to my stupid cowokers writing everything
using babel - ( why does babel need .babelrc file ?? - is babel such a
prominent part of your life that you need .rc files ?? and why does the .rc
file need to be specified in every freaking folder ! )

1) babel's docs are also terrible

2) The people maintaining babel seem to actively market babel and then at the
same time ignore questions and requests for better docs from the community.

3) Slowest compiler I have had the pleasure of dealing with - my babel watch
process consumes a grand total of 150 MB of memory !!

Edit - had to follow HN guidelines

~~~
themgt
I like the idea of Babel, but would prefer it as a sort of compile-for-
production step. The performance and debugging complexity don't seem worth it
as part of the development process. Seems like it'd now be possible w/ Node v6
and a modern browser to develop "live" in (93% of) ES6 and then just Babel-
compile to ES5 for backwards compat at the end?

Which unfortunately loses the ES7 features.

~~~
hzoo
You can use the env option to change the transforms per env
[http://babeljs.io/docs/usage/babelrc/#env-
option](http://babeljs.io/docs/usage/babelrc/#env-option)

