snowflake-connector-nodejs icon indicating copy to clipboard operation
snowflake-connector-nodejs copied to clipboard

SNOW-1293653: ESM (ESModule) support

Open cjnoname opened this issue 2 years ago • 7 comments

What is the current behavior?

This package does not support ESM (ESModule)

What is the desired behavior?

This package should suport both CommonJS and ESModule

How would this improve snowflake-connector-nodejs?

More and more new projects are adopting ESM

cjnoname avatar Apr 02 '24 06:04 cjnoname

thank you for submitting this enhancement idea - team will consider it for later, as it is not in the plans for the near future.

sfc-gh-dszmolka avatar Apr 02 '24 07:04 sfc-gh-dszmolka

thank you for submitting this enhancement idea - team will consider it for later, as it is not in the plans for the near future.

Thanks dude!

cjnoname avatar Apr 25 '24 04:04 cjnoname

Would you accept a PR for this?

bienzaaron avatar Jun 13 '24 20:06 bienzaaron

as it is not in plans for the foreseeable future, if you however have the resources then it's indeed very much appreciated !

sfc-gh-dszmolka avatar Jun 14 '24 08:06 sfc-gh-dszmolka

Since most modern JS/TS codebases leverage ES Modules, could you at least provide documentation on how to update build config using commonjs/polyfill to be compatible?

EDIT: For those of you struggling to get this lib building and running in an ES Module based project. I'd recommend checking out Sequelize with their Snowflake experimental support. It uses this lib under the hood but provides good quality of life features on top of it such as using ESModule out of the box, it enables the use of async/await so you don't have to manage promise wrapping yourself (longest running feature request since 2018 on this lib) + you get the added benefit of adding types to your query results which is useful in Typescript based projects.

maxtuzz avatar Jul 08 '24 22:07 maxtuzz