Live data from Hacker News

Node v7.5.0 Released

github.com

11–20 of 142 posts

Re: Node v7.5.0 Released

#11
post #3

There is a lot to like about Node. I had a look a couple of years ago but lack of a definitive library to handle callback hell put me off. How is the situation these days?

Whole standard api is still using callbacks so you would need to write your wrappers around it to not use callbacks.. And async/await is not solving anything because your definitions of fuctions will still need callbacks/promises under the hood anyway (unless you use libraries that do it for you). I like how Go solves that, gorutines and you write your code as it would be normal sync code.

Re: Node v7.5.0 Released

#12
post #11
post #3

There is a lot to like about Node. I had a look a couple of years ago but lack of a definitive library to handle callback hell put me off. How is the situation these days?

Whole standard api is still using callbacks so you would need to write your wrappers around it to not use callbacks.. And async/await is not solving anything because your definitions of fuctions will still need callbacks/promises under the hood anyway (unless you use libraries that do it for you). I like how Go solves that, gorutines and you write your code as it would be normal sync code.

There is a V8 API to expose Promises directly from native modules, and that can eventually be used to make async functions first-class citizens.

async functions using promises and generators under the hood is a good thing because it allows easy usage between the two forms.

Re: Node v7.5.0 Released

#13
post #3

There is a lot to like about Node. I had a look a couple of years ago but lack of a definitive library to handle callback hell put me off. How is the situation these days?

The async library has been a definitive resource for years.

Re: Node v7.5.0 Released

#14
post #3

There is a lot to like about Node. I had a look a couple of years ago but lack of a definitive library to handle callback hell put me off. How is the situation these days?

Async/await is a really wonderful addition to JavaScript !

Re: Node v7.5.0 Released

#15
> Use system CAs instead of using bundled ones

Does this make the npmrc config for cafile redundant now in my MITM environment? The amount of projects that just can't handle the CA or worse, a proxy setting, is very irritating.

Will we not have to make a separate config for every app that also bundles node (e.g. vscode) or anything that uses node to get a file (vue-cli, node-pre-gyp, etc)?

Re: Node v7.5.0 Released

#16

> Use system CAs instead of using bundled ones Does this make the npmrc config for cafile redundant now in my MITM environment? The amount of projects that just can't handle the CA or worse, a proxy setting, is very irritating. Will we not have to make a separate config for every app that also bundles node (e.g. vscode) or anything that uses node to get a file (vue-cli, node-pre-gyp, etc)?

You can specify your own CA store or revert to the OpenSSL one with `--use-openssl-ca`, `SSL_CERT_DIR` and `SSL_CERT_FILE`. See: https://github.com/nodejs/node/blob/master/doc/api/cli.md#--...

The PR is pretty good: https://github.com/nodejs/node/pull/8334/files

Re: Node v7.5.0 Released

#17
post #12
post #11

Earlier quoted context omitted.

Whole standard api is still using callbacks so you would need to write your wrappers around it to not use callbacks.. And async/await is not solving anything because your definitions of fuctions will still need callbacks/promises under the hood anyway (unless you use libraries that do it for you). I like how Go solves that, gorutines and you write your code as it would be normal sync code.

There is a V8 API to expose Promises directly from native modules, and that can eventually be used to make async functions first-class citizens. async functions using promises and generators under the hood is a good thing because it allows easy usage between the two forms.

This still doesn't solve what I wrote about api, libuv (event loop + IO) that node.js use is also based on callbacks in C, last time i checked discussion about it, there was no plans to change that.

Re: Node v7.5.0 Released

#18
post #11
post #3

There is a lot to like about Node. I had a look a couple of years ago but lack of a definitive library to handle callback hell put me off. How is the situation these days?

Whole standard api is still using callbacks so you would need to write your wrappers around it to not use callbacks.. And async/await is not solving anything because your definitions of fuctions will still need callbacks/promises under the hood anyway (unless you use libraries that do it for you). I like how Go solves that, gorutines and you write your code as it would be normal sync code.

I imagine the likes of Babel currently hide all of this in the Node context, but is there a move to either change the standard API to async/await, or provide a standard mirror API?

Either option sounds full of compatibility / maintainability headaches, so how does Node get from its current state of callback hell out the box to async / await?

goroutines aren't magically turning async calls into sync, just hiding them deeper "under the hood"; there must be hope for Node.

Re: Node v7.5.0 Released

#19
post #3

There is a lot to like about Node. I had a look a couple of years ago but lack of a definitive library to handle callback hell put me off. How is the situation these days?

The Koa web framework built by the guys behind Express is pretty neat. You can do stack like calls with it, rather than callbacks, via generator functions.

Not sure what the uptake is like but you can find more at http://koajs.com.

Post reply on HN