opentracing / opentracing-javascript

OpenTracing API for Javascript (both Node and browser). 🛑 This library is DEPRECATED! https://github.com/opentracing/specification/issues/163
http://opentracing.io
Apache License 2.0
1.09k stars 145 forks source link

Fix circular dependency in mock_context #154

Closed jdmoody closed 3 years ago

jdmoody commented 3 years ago

There seems to be a legitimate circular dependency here that causes problems when I build this library using Snowpack:

  1. ./index.ts imports ./mock_tracer/index.ts
  2. ./mock_tracer/index.ts imports ./mock_tracer/mock_tracer.ts
  3. ./mock_tracer/mock_tracer.ts imports ./mock_tracer/mock_context.ts
  4. ./mock_tracer/mock_context.ts imports ./index.ts

I think it should be fixed by simply importing SpanContext directly rather than importing the full ./index.ts.

coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 88.889% when pulling 386e6ad5dfd73225a37bb3d520c94de0eac97477 on jdmoody:fix-mock-context-cycle into 07e847fe95e05ffc5a2e40ce3f0215b889807dc9 on opentracing:master.

jdmoody commented 3 years ago

Thanks for the quick review + merge! 🙏

I'd love to get a patch version with this out, if possible. I believe anyone trying to use opentracing with Snowpack will run into this, otherwise.

yurishkuro commented 3 years ago

Released as v0.14.15