Skip to content

Conversation

@brkalow
Copy link
Member

@brkalow brkalow commented Oct 29, 2025

Description

This PR introduces the useWaitlist() hook, a new signal-backed hook in @clerk/react that enables developers to build custom waitlist UIs with reactive state management. It follows the pattern of useSignIn() and useSignUp(), exposing waitlist (resource), errors, and fetchStatus.

The Waitlist resource in @clerk/clerk-js has been integrated with the signal system, providing a WaitlistFuture instance for reactive updates. The State class now manages a lazily initialized, singleton Waitlist instance, ensuring its independence from the Client resource and proper signal propagation.

An integration test has been added to validate the hook's functionality, including joining the waitlist, error handling, and loading states.

To test the changes, run the new integration test:
pnpm playwright test integration/tests/custom-flows/waitlist.test.ts

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:

Open in Cursor Open in Web

cursoragent and others added 3 commits October 29, 2025 16:53
This commit introduces the Waitlist resource, enabling users to join a waitlist via email. It includes new hooks for accessing and interacting with the waitlist functionality in React applications.

Co-authored-by: bryce <bryce@clerk.dev>
Co-authored-by: bryce <bryce@clerk.dev>
Co-authored-by: bryce <bryce@clerk.dev>
@cursor
Copy link

cursor bot commented Oct 29, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@changeset-bot
Copy link

changeset-bot bot commented Oct 29, 2025

⚠️ No Changeset found

Latest commit: 8af2285

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@vercel
Copy link

vercel bot commented Oct 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Oct 30, 2025 8:56pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 29, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cursor/implement-waitlist-hook-with-signal-primitives-3ad1

Comment @coderabbitai help to get the list of available commands and usage tips.

Co-authored-by: bryce <bryce@clerk.dev>
Comment on lines 51 to 57
get __internal_waitlist() {
if (!this._waitlistInstance) {
this._waitlistInstance = new Waitlist(null);
this.waitlistResourceSignal({ resource: this._waitlistInstance });
}
return this._waitlistInstance;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

The proxy layer needed a way to access a waitlist instance, and so this property was added. It would be nice if there was a way to avoid having to do this though... 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants