gax-nodejs icon indicating copy to clipboard operation
gax-nodejs copied to clipboard

Make gax-nodejs an ESM compatible package

Open josephperrott opened this issue 3 years ago • 2 comments

Thanks for stopping by to let us know something could be better!

Is your feature request related to a problem? Please describe. Currently this library does not integrate into other ESM usages cleanly

Describe the solution you'd like gax-nodejs publishes new versions which are ESM compatible.

Describe alternatives you've considered Nothing is really available as an alternative, besides staying on CJS. Unfortunately this is not an option long term as the ecosystem moves forward.

josephperrott avatar Apr 21 '23 14:04 josephperrott

@alexander-fenster, what would you think about releasing this as dual-format, CJS and ESM? If so, we'd need to do it in the next major bump.

@josephperrott, FYI we wouldn't be able to make this just ESM, or else it would break consumers of this library (gapics). But it would potentially be possible for us to publish this in dual-format.

sofisl avatar Apr 27 '23 19:04 sofisl

A possible alternative would be to release into two separate packages, one for ESM, another one for CJS, but it's not really clear how we would manage that in the libraries unless we also publish each of them separately as both ESM and CJS (which we probably won't do).

I'm assuming the only way forward here is to publish a combined package (2x code size), and then drop CJS in some later major version bump.

alexander-fenster avatar May 02 '23 19:05 alexander-fenster