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

refactor: drop usage of util.inspect #627

Merged
merged 9 commits into from
Mar 1, 2024
Merged

Conversation

juliusmarminge
Copy link
Collaborator

Closes #626

Copy link

changeset-bot bot commented Feb 20, 2024

🦋 Changeset detected

Latest commit: fb32b1f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
uploadthing Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Feb 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-uploadthing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 1, 2024 8:25pm

Copy link
Contributor

A new canary is available for testing. You can install this latest build in your project with:

pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add [email protected]

@github-actions github-actions bot removed the release canary Trigger a canary release to npm label Feb 20, 2024
@juliusmarminge juliusmarminge changed the title refactor: browser exports condition instead of require in try-catch refactor: drop usage of util.inspect Mar 1, 2024
// fallback to JSON.stringify if inspect fails e.g. if runtime doesn't have util module
return JSON.stringify(arg, null, 4);
}
return JSON.stringify(arg, null, 4);
Copy link
Collaborator Author

@juliusmarminge juliusmarminge Mar 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

downside is if we attempt to log classes Response it will just output an empty object, but we don't do that anywhere today and according to my tests, logs looks good with JSON.stringify + we don't have to be concerned about runtime support:

CleanShot 2024-03-01 at 21 21 12@2x

@juliusmarminge juliusmarminge merged commit 1bafd62 into main Mar 1, 2024
10 checks passed
@juliusmarminge juliusmarminge added the release canary Trigger a canary release to npm label Mar 3, 2024
Copy link
Contributor

github-actions bot commented Mar 3, 2024

A new canary is available for testing. You can install this latest build in your project with:

pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add [email protected]

@github-actions github-actions bot removed the release canary Trigger a canary release to npm label Mar 3, 2024
@juliusmarminge juliusmarminge deleted the logger-no-require branch March 3, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor: make logger not use require
2 participants