Remove the mysql2 package peer dependency #695
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This peer dependency was added to fix the build for the OpenTelemetry
mysql2 package instrumentation. In the TypeScript build it would import
the mysql2 types in the
@opentelemetry/instrumentation-mysql2
package.The
@opentelemetry/instrumentation-mysql2
package itself has nodependency on the mysql2 package, and neither does
@opentelemetry/auto-instrumentations-node
. Which got me interested tofind out how that package works if we're experiencing the problem
described in PR #688
Instead I've moved it to the devDependencies list to fix the build and
remove the dependency for users that do not use the mysql2 package in
their app.
The AppSignal package works without it as a peer dependency, even if the
mysql2 package is not a dependency of the user's app. I've also tested
this in a TypeScript app without any conditional loading for the
@opentelemetry/instrumentation-mysql2
package.