-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Work with optional dependencies #2
base: esbuild-plugin
Are you sure you want to change the base?
fix: Work with optional dependencies #2
Conversation
Thanks so much for this fix! Would you mind adding a test for a mongo span being emitted in |
I would love to do that, but it's problematic. Unlike |
Oh I see, didn't realize that. In my local fork of this I had been spinning up redis/localstack in containers that my CI job could talk to, but I also didn't see a precedent for that in the OTel repos. I can't think of a better solution than this. What would you think of leaving a comment as something that would be nice to add in the future but we can merge as is? |
Sure, I'll leave a comment. BTW have you researched the CodeQL issue. I saw you commented about it in that PR. I think CodeQL has no supression mechanism, but maybe we can "fix" the issue. I mean apply some code change that would result in that no longer triggering. |
I have not, if you're up for a way to get around it that'd be awesome, but also fine with me if you want to merge as is and I can handle it in the destination branch |
Also add a TODO about mongodb test move code around move code around Import instead of require make prettier happy prettier test remove commented code
cc62cad
to
715d18a
Compare
@drewcorlin1 I think this PR is ready I was able to make CodeQL understand that we have rate limiting by chaining the |
Some libraries have option dependencies which they
require
in atry
. For examplemongodb
requiresmongodb-client-encryption
this way here: https://github.com/mongodb/node-mongodb-native/blob/main/src/deps.ts#L277With the current implementation of
esbuild-node-plugin
usingmongodb
leads to a bundling error:Catching the error thrown in
extractPackageAndModulePath
and letting the blunder continue resolves the problem.There is an issue about providing esbuild plugins with better ways to handle this evanw/esbuild#1127, but for now I don't see better alternatives.
Side note: this PR will make code using
mongodb
bundle successfully and work in runtime, but it doesn't make themongodb
instrumentation work. I'll submit a fix for in the next PR.