qlik-oss / qlik-api-ts

Typescript types and Javascript library for consuming Qlik API's
https://qlik.dev
ISC License
8 stars 3 forks source link

CommonJS #59

Open HaTiIn opened 4 months ago

HaTiIn commented 4 months ago

Hi,

could you please release this module as a CommonJS module, i.e. with the help of "dual-publish" ?

Best regards, Hans

nilzona commented 4 months ago

We have decided to do ES-module javascript only on this library.

What is your use case?

HaTiIn commented 4 months ago

That is a pity. I have already tried to migrate my application to ESM. After several days I gave up because there were so many hurdles for which I could not find a solution. Many other developers seem to have had the same experience if you look at the daily downloads of “ESM”-only modules. From my point of view, CommonJS is the standard used in NodeJS.

nilzona commented 4 months ago

and the support for using dynamic import to load es-modules from commonjs will not help you here?

HaTiIn commented 4 months ago

I tried several fixes, but it ends in ERR_REQUIRE_ESM. If I manage to load the qlik-ap-ts module, then it fails with one of its dependencies: nanoid.

HaTiIn commented 4 months ago

see: https://github.com/ai/nanoid/issues/365

nilzona commented 3 months ago

@HaTiIn .. coming back to this. In your ES-module update journey. Was it only @qlik/api that gave you these issues?

The nano-id issue can be fixed by bundling the code from that specific dependency.

HaTiIn commented 3 months ago

Was it only @qlik/api that gave you these issues?

Yes. I solved it by forking your project and babel it to CommonJS with nano-id 3.

nilzona commented 3 months ago

so would it help you to have the nano-id code bundled inside @qlik/api ?

HaTiIn commented 3 months ago

no