9 ms·
Node v6.6.0
- STRiDEX 10y agoBeen waiting for promises: Unhandled rejections now emit a process warning after the first tick. I'm not sure how useful the warning is though. Now using node v6.6.0 (npm v3.10.3) $ node > Promise.reject() Promise { <rejected> undefined } > (node:85928) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): undefined
- danneu 10y agoThis will save a lot of time across the Node ecosystem. Forgetting to handle rejection is probably the most common error I see when people post Promise snippets in #node.js. Silent failure is so deadly. "Why do my requests hang?"
- jamesrom 10y agoSometimes you just want an error to bubble up and be caught above. There's absolutely no reason to catch every rejection in the scope where the promise was created.
- deleted 10y ago[deleted]
- danneu 10y agoYeah, looks like it just checks on nextTick, so it only warns when you don't attach a handler synchronously. Versus warning only if it's unreachable (like on garbage collection). Though it does emit another message when rejection is handled asynchronously. > var p = new Promise((_, reject) => reject('lol')) \ setTimeout(() => p.catch(() => console.log('handled')), 0) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 5): lol PromiseRejectionHandledWarning: Rejection handled asynchronously (rejection id: 5) Consolation prize? Fortunately, most of the run of the mill promises I can think of off the top of my head get rejection handlers attached synchronously, like in upstream middleware. I might be drawing a blank, though.
- tlrobinson 10y agoIt will at least print the rejection value coerced to a string ("undefined" in your example), but line numbers would be nice.
- Noseshine 10y agoWhat will it give you what 'unhandledRejection' [0] doesn't? I don't mind that it also emits a warning, but AFAIK you could already get that information by subscribing to this more specific event? [0] https://nodejs.org/dist/latest-v6.x/docs/api/process.html#process_event_unhandledrejection https://nodejs.org/dist/latest-v6.x/docs/api/process.html#pr...
- _greim_ 10y agoIt will hopefully remind you that you forgot to register that event.
- bitroliest 10y agoLooking forward to node 6 being put in LTS later next month, we'll consider moving from node 4 then.
- michaelsbradley 10y agoIt seems generators and trampolines involve considerably more CPU overhead in the 6.x series vs. 5.x, while tail calls are now fully optimized and/or the default stack limit has grown considerably. Try running the following script with v5.12.0 and again with v6.6.0: https://gist.github.com/michaelsbradleyjr/d1b104137e8e00468d83 https://gist.github.com/michaelsbradleyjr/d1b104137e8e00468d... node --version && node --use_strict ./mutrec_vs_tramp_vs_gen.js
- jnbiche 10y ago> while tail calls are now fully optimized and/or the default stack limit has grown considerably That is great to hear. Now we can finally start really doing functional programming in JS. Too bad about the generators, though.
- michaelsbradley 10y agoWell, I'm not sure which one is the case, sorry to say (TCO or bigger stack limits, or both). I was only taking a guess as to why the mutual recursion example works for very large values in node v6.x but not in v5.x. But yes, if tail call optimization is guaranteed, then functional programming patterns can certainly shine the brighter for it.
- _greim_ 10y ago> tail calls are now fully optimized Can't remember where I heard this, but I'm given to understand they aren't optimized, just allowed. As in, recursive calls from tail position won't be super-fast or anything, they just won't blow out the call stack. Optimization may or may not be added to the engine at some future date.
- __pid_t 10y agoJust a quick question about this release. Has all use of pronouns been audited for the purpose of inclusivity? That is a major concern of mine.
- sctb 10y agoPlease stop posting deliberately inflammatory (troll) comments. We ban accounts that continue to do this.
- kristopolous 10y agoI think you may be mistaken here. Looking at the other comments, I don't believe they're trying to be inflammatory or just trying to get a rise out of people. The user could be say, intersex, physically disabled or both. Some people don't identify with a particular gender. I don't have any issue with my gender identity, but we just have to take the word of people who say they do. These can be legitimately sensitive things to some people and I'm of the opinion that a sincere adult response is not to silence their voices.
- erlich 10y agoCurious - what did the comment say before deleted?
- molloy 10y agoIf you go to your account settings and set showdead to yes it'll show up for you.
- dang 10y ago> we just have to take the word of people Unfortunately, that's a loophole large enough to drive a troll truck through, so it isn't workable. Moderation is guesswork. We guess wrongly sometimes, but at least it's usually easy to show us that we're wrong. In such cases we correct the mistake and say sorry.
- sciurus 10y agoNot much to see here. The release next month will be more notable; that's when the 6.x series becomes an LTS. https://github.com/nodejs/LTS https://github.com/nodejs/LTS
- afarrell 10y agoIf you use the Anaconda distribution of Python, you can install this with `conda install --channel amfarrell nodejs=6.6.0`
- kough 10y agoThis is sort of an insane suggestion. Why use a Python distribution to install Node?
- rawnlq 10y agoIt's pretty sane if you are also a python programmer. I personally can no longer keep track of how I installed/set up my environments and would much prefer everything under a single package manager (instead of pip, easy install, eggs, virtual env, apt-get, nvm, npm, docker, brew, macports, etc etc).
- rnhmjoj 10y agoThat's exactly what Nix [1] tries to accomplish. You should look into it. I have been using it for about six months and has worked very well for me, especially for haskell and python development. [1]: http://nixos.org/nix/ http://nixos.org/nix/
- afarrell 10y agoI came across it back in 2014 and have been meaning to check it out since. Do y'all have a how-to-build-a-package walkthrough?
- rnhmjoj 10y agoThe Nix manual is a good start: http://nixos.org/nix/manual/#chap-quick-start http://nixos.org/nix/manual/#chap-quick-start Then there are a lot tutorial about setting up a development environment for a particular language. See: go: http://lethalman.blogspot.it/2015/02/developing-in-golang-with-nix-package.html http://lethalman.blogspot.it/2015/02/developing-in-golang-wi... haskell: https://ocharles.org.uk/blog/posts/2014-02-04-how-i-develop-with-nixos.html https://ocharles.org.uk/blog/posts/2014-02-04-how-i-develop-... python: http://datakurre.pandala.org/2015/10/nix-for-python-developers.html http://datakurre.pandala.org/2015/10/nix-for-python-develope... node.js: http://sandervanderburg.blogspot.it/2014/10/deploying-npm-packages-with-nix-package.html http://sandervanderburg.blogspot.it/2014/10/deploying-npm-pa... I recommend reading Luca Bruno's blog for learning Nix internals and more advanced topics.
- gkya 10y agoThe last time I checked node it was 0.12.* . How did it become 6.* in a couple years time?
- Touche 10y agoThey adopted a different versioning system.
- angersock 10y agoThey adopted the correct versioning system. The old one was rubbish.
- deleted 10y ago[deleted]
- bdcravens 10y agoA bunch of folks unhappy with Joyent's progress on node forked it into io.js, they had an aggressive release schedule, and then when the 2 project reunited, they chose to use io.js's versioning. (io was at 3.3; the new unified release was 4.0)
- untog 10y agoIt now uses semantic versioning: http://semver.org http://semver.org
- dmh2000 10y agodang it i just installed 6.5 this morning
- tlrobinson 10y agoI recommend nvm on your dev machines. $ nvm install 6.6.0 Downloading https://nodejs.org/dist/v6.6.0/node-v6.6.0-darwin-x64.tar.xz... ######################################################################## 100.0% Now using node v6.6.0 (npm v3.10.3) $ node -v v6.6.0
- sotojuan 10y agoI second something like `nvm`. Even homebrew takes a long time to update their Node versions. That said, I use `n` because for some reason `nvm` makes my shell take more than a second to startup (I've tried tons of fixes and none work). https://github.com/tj/n https://github.com/tj/n
- diggan 10y agoI have a little trick that makes nvm not impact your overall startup time. First, put the version you commonly use in your path export PATH="${PATH}:/home/victor/.nvm/versions/node/v6.5.0/bin" Then, instead of sourching nvm when your shell starts, do it when you call an alias instead. export NVM_DIR="/home/victor/.nvm" alias n=". $NVM_DIR/nvm.sh" Now, you have a node+npm version by default, and you can do a quick flow if you want to change $ n $ nvm install 6.6.0 Now using node v6.5.0
- jessaustin 10y agoI thought the point of a package manager was not having to mess with stuff like that? "n" is simply better.
- diggan 10y agoYeah, sure, but sometimes you have to go a little bit extra to have it the best...