1248 points · by mmebane · 11y ago · 267 comments
The situation went from bad, to worse, to the best possible outcome, and that's remarkable to say the least.
Congratulations to everyone involved and thank you for the hard work.
Documentation is quickly out of date, libraries seem to have incompatibilities which only become obvious when they don't work, there's no 'recommended' approach for even basic tasks.
I won't pretend I'm speaking for everyone, as clearly there are lots of people doing great things with Node. However, it doesn't seem to be a language like Ruby or Python where I would feel comfortable using it for a small but important project.
I'm always grateful to everyone who works on open source projects, but I wouldn't hold Node up as a great example of the open source community.
The future has never looked more stable for Node, just take a peek at the names of the companies sitting on the board: https://nodejs.org/en/blog/announcements/foundation-elects-b...
As for no recommend approach - that's deliberate. I don't think most people working on Node want a Rails equivalent.
This is a useful way to understand what Node is. Node's core API is for building any sort of network service: A DNS server, an SMTP server, HTTP server, socket listener, etc. and so it applies to a wide and varied set of problems. Rails is for building a very specific type of database-backed web application.
There are plenty of libraries that provide whatever level of support you want, but one big reason people seem to use Node is for the ease of the DIY process. Honestly, I don't need an all-in-one system, because my system has needs that aren't easily modeled in ActiveRecord (or at least weren't during Rails 3 days when I moved over to Node). Instead, I am doing mix-and-match with smaller libraries to help database access, realtime (websocket) services, OAUTH, and a trad REST backend.
I also think it's fair to compare the release of node and the release date of ruby or python - it was really only then that we can start talking about needing frameworks for building web applications that run in the javascript language, whereas the other two languages could have done so right away (or ... later, once the web application world became more than just a cgi gateway on top of a c++ stack, like the lunch menu randomizer I had running back in 1995). Still, no matter how you slice it, node and server-side javascript are still relatively new on the scene, and not necessarily well-suited for an all-in-wonder, highly-opinionated framework.
Actually, no, it didn't. JavaScript was first introduced "on the server side" about 20 years ago in the Netscape web server[1].
We learn from history that we learn nothing
from history.
George Bernard Shaw[2]
1 - http://docs.oracle.com/cd/E19957-01/816-6411-10/getstart.htm2 - http://www.wisdomquotes.com/quote/george-bernard-shaw-19.htm...
Perhaps Go is a better comparison than Ruby and Python.
It wouldn't really be possible anyway. Async programming is hard and the shortcuts one can take with synchronous Ruby are impossible with Async Javascript. Nodejs has a "fibers" lib though , but it doesn't look like it is widely popular, but AFAIK it is the only to truly abstract async programming.
With Node for core and basic problems, I find myself thinking "Should I follow this blog post written by a highly respected developer but which is a year old and therefore forever in Node-land, or this blog post written last week by a nobody?". I don't like thinking that way about production code I'm writing for clients, so I use languages where I don't have to think that way.
Documentation is quickly out of date, libraries seem to have incompatibilities which only become obvious when they don't work, there's no 'recommended' approach for even basic tasks.
--
Do you have examples? My counter to your anecdotal evidence is my own--we've successfully built and managed multiple projects in production, that service millions of customers, which were written in nodejs, and have been doing so since 2013. The issues with Io led to no discernible conflicts to our businesses.
If you're reading the mailing lists, going to meetups, etc, these things might not seem like huge issues. But if you're just trying to run a small Node project as one amongst many bits of software in many languages, Node causes a disproportionate number of problems.
I've given a couple of examples below - Zombie switching to io.js, and the whole self-signed certificate debacle from a couple of years ago.
Not sure about your problems with node and the 'massive instability'issues you've had, or if they are related to a third party library and not the Node core.
Node has its place, and it's not for everything, but for quickly whipping together sturdy, flexible web APIs, it's great.
Not sure if this is what you meant, but I read the ancestor comment not as being about "will the process crash randomly?" but "will an upgrade break something in my app?"
It's just that I've seen whole comment threads go by with people tripping over this misunderstanding without ever acknowledging it.
Really? I mean, you probably could have made any other point and have it hold even the slightest amount of water.
OK, let's help you out on finding some good documentation on Ruby:
http://ruby-doc.com/docs/ProgrammingRuby/
https://en.wikibooks.org/wiki/Ruby_Programming
http://mislav.uniqpath.com/poignant-guide/book/chapter-1.htm...
[1] - https://nodejs.org/api/http.html#http_http_incomingmessage
- Python: 24 years old
- Node: 6 years old
Maybe your comparison is somewhat unfair...
- language
- io loop + vm
I'd use it for a personal project, or hackathon, but I'd be really cautious of developing mission-critical software in it.
I am so glad that gcc got its house in order. As a bonus the compiler got significantly better in pretty much all the ways it could (at least for users, no idea about internals.)
These interactions strongly mimic the interactions of the market. What's the true driving force?
"Lets hope the spork gets spooned so that no projects get knifed. If not then I guess we have to hope for a knork so we don't get stuck with a couple of chopsticks."
https://nodesource.com/assets/blog/essential-steps-lts/nodej...
From this NodeSource post:
https://nodesource.com/blog/essential-steps-long-term-suppor...
Joyent and the io.js team reconciled and merged their codebases, maintaining everyone's versions. Since io.js had used versions 1 - 3, the merged version number is 4.
I always found the naming-and-proclaiming of semver in the javascript community silly. Old style C libs have been doing what semver describes for decades, and while the js community talks it up like crazy, the compatibility and stability is terrible (and as a result they find the need for private recursive sub-dependencies, and the resulting thousands of unique libs/copies is impossible to audit or patch).
I believe the io.js community was in the "ship or get off the pot" camp, and found it silly that Node was a critical piece of infrastructure at firms like PayPal while still technically not having had a GM release. By forcing the issue, they got Joyent to commit to major version changes twice a year, which sounds like a reasonable compromise between everything-changing-all-the-time and we-can't-have-new-things-because-legacy.
Eventually Joyent recognised they were on the losing side, and so they agreed to merge back together, under a new foundation which was set up with the help of the Linux Foundation.
Node.js v4 is the first release from the newly merged projects and they used v4 as iojs had already made it to v3.
Nice, they're syncing up with the ubuntu release cycle. Should make updating servers a bit easier.
Otherwise the fact that engines bailout on optimizing ES6 features was kind of common knowledge when engines started to implement them.
Now I just need to be able to rely on these features being present in the browser so I can just write native ES6 everywhere and skip that build step entirely.
I hope it works like this
import {readFile} from 'fs';
import {clone} from 'lodash';
rather than explicitly providing "correct" URL to the modules.EDIT: edited the syntax.
import { readFile, writeFile } from 'fs';
import { clone } from 'lodash';Section 15.2.1.16 of the current stable ES6 specification specifies how the import syntax is resolved, and it doesn't use destructuring.
P.S. Sorry too lazy to get a clickable link from the spec :P see http://awal.js.org/especser/#15.2.1.16 if you really wanna read it
import clone from 'lodash/lang/clone'For anyone who wants to upgrade either from node 0.12 or iojs 3.30..all you have to do is re-install it with the GUI installer and you're good to go..for your personal computer at least!
[0] https://en.m.wikipedia.org/wiki/File:Desktop_on_Windows_Serv...
$ cat /etc/issue
Ubuntu 14.04.3 LTS \n \l
$ apt-cache showpkg nodejs | head
Package: nodejs
Versions:
0.10.25~dfsg2-2ubuntu1 (/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_trusty_universe_binary-amd64_Packages) (/var/lib/dpkg/status)
My package manager knows nothing of this mythical "bleeding edge" of which you speak... nvm install node --reinstall-packages-from=nodeEverything else is done over Github's super-secure HTTPS - so there's really nothing to be paranoid about.
And fix all the incompatible changes in your own code.
I see it's still shipping npm v2. Any news on when npm v3 will be "production-ready" and the default version?
Big thanks to all those who made this possible!!
Wget the tarball and tar -C /usr/local --strip-components 1 -xvf <tarball>
https://github.com/nodesource/distributions/#installation-in...
the new version number is using iojs instead of nodejs's existing version scheme, which is interesting too.
I just began a php device-configuration-management project and was strongly persuaded by a senior php developer that I should use nodejs instead, as he thinks nodejs _is_ the future and many big guns are using it for real deployment(netflix, linkedin,paypal...), just in time to try the fresh nodejs release for the new project.
Well, its a follow-on to both pre-merge iojs and pre-merge nodejs, and has breaking changes to both, so the most SEMVER consistent version number is the first major version greater than the greater of pre-merge iojs's last version number and pre-merge node's last version number -- which is exactly what they chose.
At any rate, if you ran into issues with 0.12, the best you can do is give 4.0 a go and report issues!
A quick glance at outstanding issues will show a number of integration bugs are still outstanding, and the new v8 was landed only a few days previously - incompatibilities with new versions of v8 can take a while to surface in node.
It's important to remember that semver makes no promises about stability. While we're used to "N.0" meaning "stable and ready for upgrade," that's a non-semver idea that is explicitly disregarded in the semver release model. Node moving from 3.* to 4.0.0 only indicates that there are breaking changes(1).
If you have concerns about stability, you should take signals on that from the node LTS group, and pick LTS releases.
1 - whether or not this is good, bad, or merely a different permutation of the things that are turning your hair grey, I leave as an exercise to the reader.
See this section of the node docs for a description of the different classifications of 'stability' within the API: https://nodejs.org/api/documentation.html#documentation_stab...
Now look what's happened to Node just in 6 years. And this is just the beginning.
PHP stalled in pre-6.0 land and then jumped straight to 7.0 because the release was just not going to happen. The closest thing in Node I can think of is ES4 (which failed, resulting in a jump to 5 and ActionScript diverging further).
Node stalled in pre-1.0 land with what was effectively a feature freeze before io.js split off and jumped to 1.0. Io then went on a regular release schedule strictly following semver leading to 2.0 and then 3.0. These aren't backwards incompatible in the sense that PHP 5 is to 4 or Python 3 is to 2 -- most code will likely still work; they mostly propagated breaking changes caused by updates to the underlying V8 engine, breaking some native extensions. The "jump" from 0.12 to 4.0 for Node is because instead of merging io.js back into Node, Node 0.12 was merged into io.js and io.js became the new Node 4.
I see that the levelDB implementation you pointed to can use a backend that uses IndexedDB. So theoretically this levelDB Api could provide an Api that work across both browser and server.
But argh. IndexedDB is a standardized api. It has a usable open source implementation in WebKit. Why not just go with that?? Why create a different API that does the same thing? I've been building an entire app around IndexedDB, but now I have to port it to a different Api to run on a server? Why?
I wrote https://github.com/dumbmatter/fakeIndexedDB which does run in Node (albeit really slowly and only in memory). It wouldn't be that much work to make it run on a real DB backend (LevelDB like Chrome, SQLite like Firefox, etc), at which point it would be everything you want. PRs are welcome :)
Is there more information on what's holding back this build?
https://ci.nodejs.org/job/iojs+release/168/nodes=pi1-raspbia...
It does look like it's very nearly done though, given that it's tar'ing stuff up at the moment.
The decision was made not to wait for it here - https://github.com/nodejs/node/issues/2522
Best versioning convention ever :)
0.12.7 -> 1.0.0 -> 1.0.1 -> 1.0.2 -> 1.0.3 -> 1.0.4 -> 1.1.0 -> 1.2.0 -> 1.3.0 -> 1.4.1 -> 1.4.2 -> 1.4.3 -> 1.5.0 -> 1.5.1 -> 1.6.0 -> 1.6.1 -> 1.6.2 -> 1.6.3 -> 1.6.4 -> 1.7.1 -> 1.8.1 -> 1.8.2 -> 1.8.3 -> 1.8.4 -> 2.0.0 -> 2.0.1 -> 2.0.2 -> 2.1.0 -> 2.2.0 -> 2.2.1 -> 2.3.0 -> 2.3.1 -> 2.3.2 -> 2.3.3 -> 2.3.4 -> 2.4.0 -> 2.5.0 -> 3.0.0 -> 3.1.0 -> 3.2.0 -> 3.3.0 -> 4.0.0
You just weren't paying attention.
So it's really 0.11.x -> 1.x -> 2.x -> 3.x -> 4.0.0. Except that 1.x, 2.x and 3.x weren't called "Node" at the time because Joyent owns the trademark and went on to release their own 0.x release(s) until the merge happened.