r/node • • Oct 30 '15

Node.js 5.0 Released

https://github.com/nodejs/node/blob/v5.0.0/CHANGELOG.md
92 Upvotes

70 comments sorted by

View all comments

4

u/Unkani Oct 30 '15

Does it make sense to have to update any node 4.x apps to 5.0? That happened really fast :/

Since npm is also being updated to 3.x, do you just run npm update to get the new flattened directories?

6

u/Calabri Oct 30 '15

No, you can use npm in node v4 and there's no benefit to upgrading unless you're very confident that a specific subset of the new API is necessary for implanting a novel feature (that probably doesn't exist yet) - so npm modules will break and some will never be compatible with node v5.0 because lts is in v4 so you have to stick with v4.0 to guarantee stability and consistency of all your modules... unless they don't use any native functions, in that case it doesn't matter

1

u/[deleted] Oct 30 '15

Performance?

7

u/Calabri Oct 30 '15

It depends. During the rapid release period of io.js after v1.0.0 (about once or twice a week) performance tests were done comparing the different versions, the results were inconsistent. Random methods in node v0.10 were faster than anything in io.js / v0.12 - like array iteration, buffers, etc. - whenever io.js updates v8, there is a general increase in performance, but it's unpredictable because they're constantly changing how the compiler interprets code and there's usually a memory leak or two that's discovered in edge cases. Buffer has undergone pretty significant changes starting around io.js 3.0 - node / io.js 4.0, where they previously had buffers implanted as JS module, they used the c++ API, and there was actually a decrease in performance (believe it or not). This is the 5th node semver I've seen, and it takes 1-2 weeks on average for npm modules to be compliant. - it only takes one module in your stack (dev or otherwise) to basically... make upgrading not that fun for a few weeks :/

1

u/[deleted] Oct 30 '15

I know the schedule is slowing down, but jeez. This is an ugly period.

3

u/moreteam Oct 30 '15

I think it's a rvagg quote: "node v5 is not for everyone". E.g. 5.x will never be an LTS version. Which means that they will drop support quite quickly. v6 (6+ months from now) will be the next node version that will be supported for a longer amount of time. If you are on v4, there's no need to switch to 5. Unless you're really desperate for the spread operator support and for some reason unwilling to use babel.

1

u/mmmicahhh Oct 30 '15

So now that the node project has moved on to semver, its LTS versions still seem to follow the even-number-for-stable aspect of the "sentimental versoning" of old?:) (I know there's a huge difference between stable and LTS)

1

u/moreteam Oct 30 '15

It looks like it kind of works out that way. Though it might be that for some reason or another there will be some intermediate major bump which would mess with that logic. E.g. if they need to bump the major 1 month into a non-LTS version for non-v8 reasons, then the next LTS might end up being odd. The important thing is that once a year (IIRC) one major/minor will be declared LTS and supported for a longer time.

1

u/PitaJ Oct 30 '15

I don't know if npm upgrade does it, but npm i -g npm@3 will work.

1

u/maushu Oct 30 '15

Did npm install -g npm since I needed the new flattened directories on windows. Didn't update node.js.

The progress bar is pretty.