node-datadog-metrics icon indicating copy to clipboard operation
node-datadog-metrics copied to clipboard

adjust reporter to not import entire @datadog/datadog-api-client

Open kroney opened this issue 8 months ago • 3 comments

kroney avatar Mar 27 '25 15:03 kroney

@kroney Is there a problem this is solving?

Mr0grog avatar Mar 27 '25 17:03 Mr0grog

Right now we're always importing v1, v2 and client, which are all huge packages. My hope is that with this fix, the package can be better treeshaken

kroney avatar Mar 28 '25 06:03 kroney

Ah, I feel your pain there. But this would have to move to ESM syntax to get that kind of tree-shaking. A better solution to this particular issue is probably #132 and #144. (I started those near the end of last year, but some other things came up and I have not had time to return to them. I have not prioritized them since nobody has commented.)

Mr0grog avatar Mar 28 '25 15:03 Mr0grog