Node.js 5.0 Released
github.com
github.com
What does a module author do? If my module uses an API that was changed in 5.x, do I only support 4.2.x, do I only support 5.x or do I write in some hacks to try and check between the two? What if 6.x comes in, say, 6 months and also breaks another API. Now I have 3 hacks or I only support 4.2.x or 6.x.
This is the first major version since the io.js and node.js merger so I'm not that concerned yet but if they continue this pace then I will be very concerned (just like I was concerned when npm was supporting io.js and node.js when they had differences in their APIs; it forces module developers to choose and limit their availability). I would like to see some path of deprecation for node.js APIs that take multiple major versions to get away from unless it's a major security risk.
Edit: just to clarify my worry: I'm not worried yet. But, and this is a big but, ECMAScript doesn't include any standard libraries for interacting with systems, http, etc so node.js has kinda assumed the role of a standard, defacto library for JavaScript when dealing with a system on a level outside of a web browser. So if the breaking API changes are going to occur every year or faster, to me that's like a language's standard libraries changing every year or sooner.
Yes it's kinda not fair as node.js is NOT a set of standard JavaScript libraries but that's the role it's essentially been given due to the lack of one in ECMAScript.
This may end up deviating a bit from semver, but node and npm have long done that themselves. Ideally, of course, one could simply avoid using unstable portions of the API. That's not always possible, but it should be possible to isolate that instability in a module like "readable-stream". Actually I suspect that any time one is tempted to use the "engines" option, it's time to break that specific API use out into a separate module.
PIP authors have python2/3, Julia pkg, ubuntu apt-get, ect. What's special about working with npm?
To me, Node community just release new versions fast and furious. If the committers won't, then there are people who jump out and fork the project.
Of course there are the other extreme of long release cycles like Debian but there are good reasons for that.
IMMO, a mature large community of an open source project community should always take the package ecosystem into considering when introducing new versions or breaking changes.
PS: I was pretty annoyed that one of the npm package I used a lot `aglio` is broken again on 5.0.0 after I filed a ticket for the compatibly issue with 4.2.1. This ticket has just been closed a few days ago and is only less than two weeks old!
First, JavaScript lacks a standard library that can interact with a system so node.js is essentially the defacto extension of the JavaScript language to work with a system. If you had a change where its standard libraries change every 6 months (plus or minus a few) it wouldn't be fun.
Second, npm supports specifying the engine but you need to be able to update all versions due to security concerns, etc. If it's iterating too quickly with breaking changes then people are going to have to keep a branch for every version and update each one when a security fix is required. That's not sustainable. Most people keep a LTS version and a bleeding edge version.
Python and other languages iterate but breaking changes in core APIs? Not very frequently.
'cause the actual changes that break between npm 1 and 2 are very small. (the changes to npm run, mostly, and the cache.) so it's Very Strange(tm) modules that break, and the new run behavior is much more useful
- npm team member
It's not really anything against npm itself and if the node team doesn't do this with high frequency then it won't be an issue. The 5.x coming so soon after 4.x was just jarring and everyone is speculating how frequently they're going to make breaking changes.
I realise this makes the package.json Node-specific, which might be something you want to avoid.
EDIT: to part-answer my own question, package.json has the "engines" field. Not sure if that means it automatically installs old versions in older versions of Node, though.
Basically, you get an error but it won't give you the proper version. If that has changed I'd love to know, however (it most certainly should install the latest version for your environment and give you a warning that it's not the latest. In my opinion anyway).
They could have though about version numbers last months, and choose 5.
A bit more conservative version numbering would be great. Nodejs up to 0.1x was to slow, and now it's way to fast - a application runtime is not a browser. Mind the library compatibility - not every dev has time to test for 0.1x, 4.x and now 5.
You know, it's pretty funny that all the io.js people (myself included) were complaining about how glacial the pace was from Joyent, and now here we are, seeing some grumbling about how quick the pace has picked up. :)
Changes in npm, on the other hand are a different story. Technically, npm is not part of Node core, it's a utility that we bundle with the core but it has it's own lifecycle, it's own process and it's own separate project. The "contract" between npm and node.js is still being worked out and this kind of feedback is extremely useful.
Considering there was 52 days between one major version cycle that criteria isn't really useful; I'd expect a timeframe more than a version cycle.
> Changes in npm, on the other hand are a different story. Technically, npm is not part of Node core, it's a utility that we bundle with the core but it has it's own lifecycle, it's own process and it's own separate project. The "contract" between npm and node.js is still being worked out and this kind of feedback is extremely useful.
I really should have said the main issue is really just writing code with node and sharing it; node has essentially been given the responsibility of being a standard set of libraries for JavaScript on the server and having standard libraries change APIs, even minor, in less than 2 months is typically indicative of a language pre 1.0.
But I'm hopeful you're right and things should continue working in most respects, it's just the edge cases that worry me. I don't want to spend a ton of time developing something that ends up simply not working in the very next version without a good path of providing my code that works with both.
1. There is no one forcing you to upgrade, 4.2 is LTS, you've got 2yrs+
2. 5.0 followed 4.0 so closely because 4.0 was the iojs/node merge and 5.0 was to correspond with the new V8 release, future major bumps will be closer to 6mo (to match V8)
In a real application, using ecosystem packages, it is fine to decide on a fixed target. But, if the core system is moving quickly, chances are the better packages will be moving quickly too. The fear is that there'll be a necessary change in a package (a security issue, or a bug that only surfaces under rare situations, for example), which can cause a cascading upgrade to the whole app. One that needs to be performed quickly.
This has happened to me once, and it wasn't pretty.
It is a concern for any platform, of course, but fast moving ones do 'feel' like they increase the risk. It's therefore a valid question to ask if there are people deploying code in long-term projects, and what the burden is in practice. Since we don't have empirical data (that I know about).
A lot of the Node community does seem to be made up of people creating apps, and enjoying the latest and greatest functionality. There is fewer information from folks running apps long term in mission critical scenarios. That's not a criticism, at all, just an observation: if you are in the latter camp, or considering whether to be, getting good information is harder.
Technical debt, in terms of platform choice, is important.
And in 2 years, when we take a peak we see that the changes amassed in between by the non LTS releases are so big we have to pretty much rewrite all of our codebase if we want to continue getting support....
Other apps that require binary add ons required me to install the latest versions from NPM -- one one of them required ANY changes to how the API was called and it was extremely minor.
Waiting 2 years to upgrade the engine your code is running on is not horrible and requires much less pain
I think I'll just add Node 5.0 to CI and see if it passes and that's all there is to it really.
More or Less, Joyent was mostly doing what they were doing for a reason. What the io.js team is doing also has validity but fundamentally you will always see these issues to some extent because of the philosophy behind it.
Because the target user community of what you are writing consists of the kind of users that are likely to use LTS releases.
> Most new packages will probably support the current version, and then your LTS window of 2 years doesnt mean much.
You don't choose LTS because you want support for every new packages that haven't been written yet on the day they come out, you choose LTS because you've got something for which you want to have a stable platform with bug fixes, rather than an unstable platform with breaking changes, and are willing to not have access to the newest platform features or the newest third-party libraries that depend on them to get that stability.
Turns out that despite pillorying Joyent for sticking to V8 major versions, it is the only reasonably-correct thing to do for the ecosystem to remain usable.
No?
Then take your scare quotes and bang your drum elsewhere, because from where I stand, the new boss is pretty much the same as the old boss.
I ended up opting for Flask and Python 3x instead, couldn't be happier. I had my API up and running within a day with no prior knowledge of Flask and some Python on and off. I've been able to discuss and teach other team members on it who were also able to pick it up easily.
And with tools like nvm, it's incredibly easy to swap out different versions and go for a test drive.
Plus you don't have to always upgrade to latest and greatest. If your app works fine in 4.2 and there's no crazy security issues you need to upgrade for, don't. 4.2 is LTS so it's going to get supported for a long time.
I have a built a small API using express and passport and so far these node changes have not impacted my code.
Another option for fast API development is Java 8 with SpringBoot and Jetty. People hate on Java and Spring, but the latest versions of both are very powerful and easy to get going. If you end up needing more it is there.
There's no way this is sustainable, but I'm at a loss of how to fix it, especially when the ECMAScript language itself is evolving at such a rapid pace. Any ideas?
JS being relatively fashionable and easy to write, it attracts all the younger devs that can't be bothered with backwards compatibility, stability, etc, and keep changing, restructuring etc their projects as they go along.
There are exceptions of course, e.g. anything by jashkenas, but this breakage happens a lot. Also with people adopting the latest shiny new framework every year or so (e.g. it feels like ages when Backbone was the shiny new thing, but it was merely 5 years ago -- since then we've had Ember, then Angular, then React take the spotlight).
• On the technical side, needs the equivalent of CPAN testers to automatically show where stuff breaks.
• On the social side, needs the fostering of a culture where breakage is considered ill-mannered, and module maintainers hence go to lengths to prevent it or fix it promptly.
Avoid Javascript on the server, problem fixed.
An incremental compile takes ~1-2s.
Yap good choice. Python to me is more readable (so I can understand my own code and others' better) and I find the echo system to be friendlier and more mature.
We use both ES5 and ES6 (via transpilation) where I work. I had to write a lot of the tooling to support ES6 because a lot of front-end engineers were asking for ES6. To this day, I have yet to hear one engineer justify their "need" for ES6 with one of the features that make something easy that is hard or cumbersome with ES5. Pretty much every feature engineers were wanting to use were simple sugary syntax features like the spread operator that is trivially dealt with with a library like `xtend` (the irony is seeing these same engineers continue to use _.each on arrays instead of Array.prototype.forEach)
There is a corollary to Wadler's Law in here somewhere: https://wiki.haskell.org/Wadler's_Law
In any debate on the merits of migrating to ES6, the
total number of times an ES6 feature is cited as
justification to migrate to ES6 is proportional to two
raised to the power of its position.
0. Semantic features
1. Syntax features
2. Lexical syntax features
3. Lexical syntax of comments featuresIf you're looking for solid, long term stability, you are perfectly fine sticking with v4.0.0, as its marked an "LTS" release. This means it'll be actively receiving minor- and patch-level updates for 18 months, then for 12 months thereafter it'll get updates for severe bugs and security problems (what they call "maintenance" mode) [2].
[1] https://twitter.com/rvagg/status/659871982670884864 [2] https://medium.com/@nodesource/essential-steps-long-term-sup...
I personally don't have an opinion on the quick release and am happy to just use the LTS but calling the developers "trolls" seems unnecessarily harsh for people voicing a reasonable concern, even if they were just misinformed.
Looking at the changelog, it looks like they decided to commit a bunch of breaking changes that were previously marked as deprecated. If your code was running before without warnings, upgrading shouldn't have a negative impact.
The pace of change is fast because node ES6 support is progressing fast enough to maintain near 1:1 feature parity with v8. A bunch of ES6 features still haven't been fully implemented in v8 but that's not the fault of the Node.js dev team.
If the dev team has committed to LTS for 4.2 that means they're likely planning to backport new features to the 4x branch. No reason to panic. Many of the more useful features of ES6 already work perfectly in 4.2.
Probably because you don't use any binary packages that haven't even made it to 4.x yet. My app requires one so I'm still stuck on node 0.12 until they update. I've filed a bug report but before they could even respond 5.0 is out. Not they have a quandary: do they support 4.x or 5.x when they update? Npm doesn't support forks, so they can't get one version for users of 4.x and one for 5.x.
The only sensible way to fix this that I can think of is to build in an extension layer into node so that binary packages don't use raw v8 APIs (since those seem to change a lot). Then that layer can be made (more) stable, even in the face of constant v8 upgrading.
That already exists, it's called nan: https://github.com/nodejs/nan
Things are really moving along at a good clip since the merge with io.js.
function foo(a=1, b=2, c=3) { return a * b * c;}
dict = {'b': 4, 'c': 6};
foo(...dict);You can still do something like:
foo(... Object.keys(dict).map(name => dict[name]))
(Maybe someday you might be able to use Object.values() to achieve the exact same thing without needing to use .map)However, the spread operator doesn't match the argument names to the object names. So the above call would mean the following:
foo(4, 6)
And not what you'd like: foo(undefined, 4, 6)
However, note that you can rest an object too: let x = { a : 1, b : 2, c : 3 };
let { a, ... rest } = x;
console.log( ... rest ); // { b : 2, c : 3 }[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... [2] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
const foo = ({ a = 2, b = 2, c = 3 } = {}) => a * b * c;
const dict = {b: 4, c: 6};
foo(); // 12
foo(dict); // 48Your dependencies will now be installed maximally flat. Insofar as is possible, all of your dependencies, and their dependencies, and THEIR dependencies will be installed in your project's node_modules folder with no nesting. You'll only see modules nested underneath one another when two (or more) modules have conflicting dependencies.
I'm not really sure why node doesn't use them internally to solve the issue.
Nodejs is a console application and can call system applications via command line/cmd.exe.
WinNT kernel and NTFS/ReFS have no such path limitations, that limitation comes from Win16 API and to make the job easier the Win32API and its subsystem (32-bit and 64-bit Windows since Win3.11 with Win32s addon and Win95) comes with such legacy restrictions.
Expect future major releases on a 6 month cadence with LTS releases every 12 months
https://nodesource.com/blog/essential-steps-long-term-suppor...
Really what has happened is that v4 was a bit behind, and v5 is right on schedule which is why it seems to be changing so fast.
Because that's when the planned functionality was coded, tested, and ready to deliver.
Node's development model is a form of the fairly common model where you avoid wasted work (that is, work not delivering value for customers that want it) by delivering features as soon as they are ready and tested, while periodically splitting off and committing to support long-term-support releases for customers that are more concerned with longer-term stability than having the latest and greatest the moment its ready to use.
I'd wager that the vast majority of Node APIs currently on 4.x could swap in 5.0 without any issues.
Moving fast is one thing and this is the first major version after the io.js and node.js merger so maybe this is a one-off thing; if they continue this pace with breaking changes then the ecosystem is either going to only be latest or are going to stick with 4.2.x forever.
If this happens, there will probably be compatibility modules like https://github.com/nodejs/readable-stream.
i reverted back to 4.0.0
Even non-semver version numbers are rarely decimal numbers, even though the major/minor distinction may be less clearly defined.
So talking about a 0.1 every n days inferred from the date of a 5.0 vs. A 4.2 release doesn't make any sense; if there were actual minor releases that frequently, it would, but that is a different thing.
(for semver at least)