Choosing the right node version & ES2015
- Node was just on 0.12 a year ago and now we’re talking about version 6. What node version should I be running in production?
- ES2015 (aka ES6) seems to be here now, but not all ES2015 features are available on every platform. What new ES2015 features can I start using?
The reason node jumped from 0.12 to 4 overnight is a side effect of the node/io.js merger. And now node has a release schedule for versions.
This is important! Know this before you upgrade:
- Even number versions (currently 4 and 6) will be released with new features and then after a time window they will be maintained as “Long Term Support” meaning there will not be huge changes, just small changes and security patches. Stability like this is good if you are building a business.
- Odd numbers (currently 5 and 7) will be released with newer features but they will not be maintained for the long term. This is bad if you are running a business.
If you’re building a business: build it on the current active LTS version. This means for right now it is Node 4 and when Node 6 goes into LTS in October upgrade to Node 6.
If you really want the bleeding edge ES2015 features, you can use a transpile tool like babel or traceur and add another build step. For now, that sounds a little aggressive, I’m gonna sit back and just use the ES2015 features that my node version natively supports and give babel and traceur a little more time before I jump in and commit to using yet another tool in my build process.
Here’s the playbook I recommend:
- Look at node.green to see what features your version of node supports
- Use the features of ES2015 that your node version supports.
- Upgrade node versions as the latest LTS releases become available.
Update July 2016
We loved using ES2015 on the server side with node, and we wanted to leverage it on the client side too. So we ended up trying out babel. We’re now using babel on both our serverside and client side code with the es2015 preset and that is working out nicely. We’ll continue to use babel and we’ll continue to upgrade node versions as the latest LTS releases become available.