javascript icon indicating copy to clipboard operation
javascript copied to clipboard

fix(nextjs): Improve support for cacheComponents

Open panteliselef opened this issue 3 months ago • 12 comments

Description

Developers using cacheComponents in next v16, should position ClerkProvider further down the tree.

<html>
  <body>
    <ClerkProvider>
      {children}
    </ClerkProvider>
  </body>
</html>

This PR also prevents keylessDriftDetection from firing as an action when the RSC variant is used.

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:

Summary by CodeRabbit

  • New Features

    • Added an option to disable keyless drift detection in the Clerk provider.
  • Improvements

    • Better support for Next.js cache components with conditional suspense behavior.
    • Drift detection is now lazily loaded to reduce startup work.
    • Telemetry for keyless usage is now tracked per key to improve accuracy.

panteliselef avatar Oct 31 '25 20:10 panteliselef