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

chore(nextjs): Decrease frequency of logs related to Keyless #4953

Merged
merged 10 commits into from
Jan 21, 2025

Conversation

panteliselef
Copy link
Member

@panteliselef panteliselef commented Jan 21, 2025

Description

On nextjs during development, we need to "log once" at most every X minutes. Our logger from @clerk/shared/logger will not work, because variables defined at a module scope get re-initialized when HMR runs.

To address that I created global.__clerk_internal_keyless_logger, currently is intended to be used only for the keyless feature, but we can generalise it later if and when another part of our integration can benefit from it.

I considered using unstable_cache for this which works, but the api is unstable, and will be transitioning to "use cache" in the future.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@panteliselef panteliselef self-assigned this Jan 21, 2025
Copy link

changeset-bot bot commented Jan 21, 2025

🦋 Changeset detected

Latest commit: b4aae34

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

This PR includes changesets to release 1 package
Name Type
@clerk/nextjs 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 Jan 21, 2025

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

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ⬜️ Skipped (Inspect) Jan 21, 2025 1:57pm

@panteliselef panteliselef marked this pull request as ready for review January 21, 2025 12:20
@panteliselef panteliselef merged commit 71e971a into main Jan 21, 2025
29 checks passed
@panteliselef panteliselef deleted the elef/actls-60-reduce-keyless-logs branch January 21, 2025 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants