-
Notifications
You must be signed in to change notification settings - Fork 95
Fix circular import #647
base: master
Are you sure you want to change the base?
Fix circular import #647
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
|
@googlebot I signed it! |
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
8707c3f to
d749fb5
Compare
|
@draffensperger and @hekike what do you think about this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, though I think it's important to comment why this is needed.
| SpanKind, | ||
| TraceOptions, | ||
| } from '@opencensus/core'; | ||
| import 'http'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment for why this line is needed to avoid the circular import? And similar for the other case below?
This PR fixes the circular import problems occurring when you load
http2orhttpsmodule beforehttpmodule.For example, the following code reproduces a problem
@opencensus-instrumentation-httpmodule doesn't load properly.The process of problem is as follows schematically:
http2module.require-in-the-middleload@opencensus-instrumentation-http2module.@opencensus-instrumentation-http2load@opencensus-instrumentation-httpmodule.@opencensus-instrumentation-httploadhttp.require-in-the-middletry to load@opencensus-instrumentation-http, but loading of@opencensus-instrumentation-httpis already in progress. Therefore require statement return partial@opencensus-instrumentation-http.