Skip to content

Confusing Node.js version support #1066

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vitaly-t opened this issue Jun 28, 2016 · 3 comments
Closed

Confusing Node.js version support #1066

vitaly-t opened this issue Jun 28, 2016 · 3 comments

Comments

@vitaly-t
Copy link
Contributor

vitaly-t commented Jun 28, 2016

The library itself is being tested against Node.js 0.10, till the latest, while everything has been moved to use the new pg-pool, which uses ES6 promises, and restricts you to Node.js 4.x and later.

This creates confusion among users, and presumably a mess during deployment when the target server suddenly has a pre-4.x version of Node.js.

Check out another recent question I answered: error in pg-pool module when using postgres module with nodejs and heroku.


I believe that for this library it is very important to continue supporting Node.js 0.10 fully, which is still used by many, and will be for some time.

As for the promises, if somebody really wants to use them properly - you can tell them to use pg-promise, which will work under any Node.js version. I honestly don't think that promises should be used on this level, which is essentially a kernel for other libraries, and should remain to be that way 😉

@brianc
Copy link
Owner

brianc commented Jun 28, 2016

Thanks! I will include instructions in the pg-pool library on how to
polyfill a promise implementation if they're on an older version of node
that doesn't have one.

node-postgres and therefore pg-pool both should support node back to
0.10.x. The tests still pass in Travis for nide-postgres, which uses
pg-pool in 0.10, I just had to polyfill a promise implementation. I'll
make that more clear!

On Tuesday, June 28, 2016, Vitaly Tomilov [email protected] wrote:

The library itself is being tested against Node.js 0.10, till the latest,
while everything has been moved to use the new pg-pool, which uses ES6
promises, and restricts you to Node.js 4.x and later.

This creates confusion among users, and presumably a mess during
deployment when the target server suddenly has a pre-4.x version of Node.js.

Check out another recent question I answered: error in pg-pool module
when using postgres module with nodejs and heroku
http://stackoverflow.com/questions/38061325/error-in-pg-pool-module-when-using-postgres-module-with-nodejs-and-heroku/38069371#38069371

.

I believe that for this library it is very important to continue
supporting Node.js 0.10, which is still used by many.

As for the promises, if somebody really wants them properly - send them to
use pg-promise, which will work under any Node.js version.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1066, or mute the thread
https://github.com/notifications/unsubscribe/AADDoTXVFK019YFLVfgA9hi_eHTLnEJsks5qQXLsgaJpZM4JAb7C
.

@brianc
Copy link
Owner

brianc commented Jul 3, 2016

I've updated the pg-pool readme with better instructions on how to use it in versions of node which do not support Promises natively, and I've made the tests pass in older versions of node by removing the es6 stuff in the tests! Thanks. 😄

@brianc brianc closed this as completed Jul 3, 2016
@vitaly-t
Copy link
Contributor Author

vitaly-t commented Jul 3, 2016

Great job! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants