-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ref(node): Only show instrumentation warning when tracing is enabled #12141
ref(node): Only show instrumentation warning when tracing is enabled #12141
Conversation
cd1e4c7
to
2855d9b
Compare
@@ -48,12 +50,19 @@ export const setupConnectErrorHandler = (app: ConnectApp): void => { | |||
}); | |||
} | |||
|
|||
if (!isWrapped(app.use) && isEnabled()) { | |||
if (!isWrapped(app.use) && isEnabled() && hasTracingEnabled()) { |
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 we maybe extract this into a utility and re-use this? Could be something like this:
function ensureIsWrapped(maybeWrappedModule: unknown, name: string): void {
if (!isWrapped(maybeWrappedModule) && isEnabled() && hasTracingEnabled()) {
// ...
}
}
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.
Extracted, could you please have another look 🙏
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.
very nice!
b1b8402
to
e123f24
Compare
e123f24
to
239817f
Compare
size-limit report 📦
|
Also gives a better warning in ESM mode with a helpful link to the docs.