Skip to content
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

Make trace() noop in production build #3709

Merged
merged 1 commit into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fifty-rivers-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"mobx": patch
---

Make trace() noop in production build
2 changes: 1 addition & 1 deletion packages/mobx/src/api/trace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export function trace(thing?: any, enterBreakPoint?: boolean): void
export function trace(enterBreakPoint?: boolean): void
export function trace(...args: any[]): void {
if (!__DEV__) {
die(`trace() is not available in production builds`)
return
}
let enterBreakPoint = false
if (typeof args[args.length - 1] === "boolean") {
Expand Down