DataDog / dd-trace-js

JavaScript APM Tracer
https://docs.datadoghq.com/tracing/
Other
638 stars 301 forks source link

Export plugins interface #691

Open dustinblackman opened 4 years ago

dustinblackman commented 4 years ago

Overview

Currently the Plugins interface is marked as hidden. It looks like this was done when porting over from jsdoc, but I don't see an obvious reason why (maybe to avoid noise?). At the moment I'm not using dd-trace-js directly, but rather wrapping it with default configs for other searches which can be extended later. It'd be nice to have the type checking capabilities for plugins on my wraper, and the easiest way to do that is using that interface.

If no objections, I'm down for the one liner PR.

rochdev commented 4 years ago

The main issue is that it's an internal API that never went through a proper design review. There is also no guarantee at the moment that the API will not change without notice. We want to eventually expose it, but we want to improve it first.

One thing that could potentially be done in the meantime, is split the definitions in multiple files. Then even if the index.d.ts doesn't expose it as being public, it could still be required on its own. This would allow you to use internal types.

gabegorelick commented 1 year ago

This is still an issue. It makes building typesafe wrappers around methods like tracer.use impossible.