-
Notifications
You must be signed in to change notification settings - Fork 396
feat(tanstack-react-start): Add experimental export #6957
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
Conversation
🦋 Changeset detectedLatest commit: 5623d8b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughAdds a new experimental export surface for tanstack-react-start, exposing useSignIn and useSignUp hooks by aliasing Clerk’s experimental signals. Updates package.json exports and files to publish the new entry point. Includes a changeset entry documenting the new module and hooks. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant App as App (Consumer)
participant TRS as @clerk/tanstack-react-start/experimental
participant CRX as @clerk/clerk-react/experimental
participant Clerk as Clerk Services
App->>TRS: import { useSignIn, useSignUp }
note over TRS: Aliased re-exports of signals
TRS->>CRX: useSignInSignal / useSignUpSignal
CRX->>Clerk: Initiate sign-in/sign-up flows
Clerk-->>CRX: Auth state / results
CRX-->>App: Signals update (success/error)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/elements
@clerk/clerk-expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/clerk-react
@clerk/react-router
@clerk/remix
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/themes
@clerk/types
@clerk/upgrade
@clerk/vue
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
.changeset/tame-tips-own.md
(1 hunks)packages/tanstack-react-start/package.json
(2 hunks)packages/tanstack-react-start/src/experimental.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (8)
.changeset/**
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Automated releases must use Changesets.
Files:
.changeset/tame-tips-own.md
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use Prettier for consistent code formatting
Files:
packages/tanstack-react-start/package.json
packages/tanstack-react-start/src/experimental.ts
packages/*/package.json
📄 CodeRabbit inference engine (.cursor/rules/global.mdc)
All publishable packages should be placed under the packages/ directory
packages/*/package.json
: All publishable packages must be located in the 'packages/' directory.
All packages must be published under the @clerk namespace on npm.
Semantic versioning must be used across all packages.
Files:
packages/tanstack-react-start/package.json
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
**/*.{js,jsx,ts,tsx}
: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels
Files:
packages/tanstack-react-start/src/experimental.ts
packages/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
TypeScript is required for all packages
Files:
packages/tanstack-react-start/src/experimental.ts
packages/**/*.{ts,tsx,d.ts}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Packages should export TypeScript types alongside runtime code
Files:
packages/tanstack-react-start/src/experimental.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use proper TypeScript error types
**/*.{ts,tsx}
: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoidany
type - preferunknown
when type is uncertain, then narrow with type guards
Useinterface
for object shapes that might be extended
Usetype
for unions, primitives, and computed types
Preferreadonly
properties for immutable data structures
Useprivate
for internal implementation details
Useprotected
for inheritance hierarchies
Usepublic
explicitly for clarity in public APIs
Preferreadonly
for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Useconst assertions
for literal types:as const
Usesatisfies
operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports:import type { ... } from ...
Noany
types without justification
Proper error handling with typed errors
Consistent use ofreadonly
for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)
Files:
packages/tanstack-react-start/src/experimental.ts
**/*.{js,ts,tsx,jsx}
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.
Files:
packages/tanstack-react-start/src/experimental.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (28)
- GitHub Check: Integration Tests (billing, chrome)
- GitHub Check: Integration Tests (custom, chrome)
- GitHub Check: Integration Tests (nextjs, chrome, 15)
- GitHub Check: Integration Tests (react-router, chrome)
- GitHub Check: Integration Tests (nextjs, chrome, 14)
- GitHub Check: Integration Tests (localhost, chrome)
- GitHub Check: Integration Tests (machine, chrome)
- GitHub Check: Integration Tests (handshake, chrome)
- GitHub Check: Integration Tests (nuxt, chrome)
- GitHub Check: Integration Tests (elements, chrome)
- GitHub Check: Integration Tests (expo-web, chrome)
- GitHub Check: Integration Tests (handshake:staging, chrome)
- GitHub Check: Integration Tests (tanstack-react-start, chrome)
- GitHub Check: Integration Tests (vue, chrome)
- GitHub Check: Integration Tests (sessions:staging, chrome)
- GitHub Check: Integration Tests (sessions, chrome)
- GitHub Check: Integration Tests (generic, chrome)
- GitHub Check: Integration Tests (astro, chrome)
- GitHub Check: Integration Tests (express, chrome)
- GitHub Check: Integration Tests (quickstart, chrome)
- GitHub Check: Integration Tests (ap-flows, chrome)
- GitHub Check: Publish with pkg-pr-new
- GitHub Check: Unit Tests (22, **)
- GitHub Check: Unit Tests (18, --filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@c...
- GitHub Check: Static analysis
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
packages/tanstack-react-start/package.json (2)
46-49
: LGTM!The experimental export configuration follows the established pattern used by other exports in this package (server, errors, webhooks). The structure correctly specifies both TypeScript types and the default export path.
58-59
: LGTM!Adding "experimental" to the files array ensures the new export will be included in the published package. The placement is consistent with the other export entries.
packages/tanstack-react-start/src/experimental.ts (1)
1-1
: Verify module exports
Confirm thatuseSignInSignal
anduseSignUpSignal
are actually exported by your installed version of@clerk/clerk-react/experimental
; otherwise these re-exports will break at runtime.
@@ -0,0 +1,5 @@ | |||
--- | |||
'@clerk/tanstack-react-start': patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use "minor" version bump for new feature.
According to semantic versioning, a "patch" bump is for backward-compatible bug fixes, while a "minor" bump is for backward-compatible new functionality. Since this PR adds new exports and hooks, it should be a minor version bump.
Apply this diff:
-'@clerk/tanstack-react-start': patch
+'@clerk/tanstack-react-start': minor
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
'@clerk/tanstack-react-start': patch | |
'@clerk/tanstack-react-start': minor |
🤖 Prompt for AI Agents
In .changeset/tame-tips-own.md around line 2, the release type is set to 'patch'
but this PR introduces new exports/hooks so it must be a 'minor' bump; edit the
file to replace 'patch' with 'minor' for the '@clerk/tanstack-react-start' entry
(save the changes and commit them).
@@ -0,0 +1 @@ | |||
export { useSignInSignal as useSignIn, useSignUpSignal as useSignUp } from '@clerk/clerk-react/experimental'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
Add JSDoc documentation for public API.
These exported hooks constitute a public API surface and should be documented with JSDoc comments explaining their purpose, usage, and relationship to the underlying experimental signals.
As per coding guidelines
Apply this diff to add JSDoc:
+/**
+ * Experimental hook that provides access to the sign-in flow state and methods.
+ * This is an alias for `useSignInSignal` from `@clerk/clerk-react/experimental`.
+ * @experimental This API is experimental and may change in future versions.
+ */
export { useSignInSignal as useSignIn, useSignUpSignal as useSignUp } from '@clerk/clerk-react/experimental';
Alternatively, document both hooks separately:
+/**
+ * Experimental hook that provides access to the sign-in flow state and methods.
+ * This is an alias for `useSignInSignal` from `@clerk/clerk-react/experimental`.
+ * @experimental This API is experimental and may change in future versions.
+ */
+export { useSignInSignal as useSignIn } from '@clerk/clerk-react/experimental';
+
+/**
+ * Experimental hook that provides access to the sign-up flow state and methods.
+ * This is an alias for `useSignUpSignal` from `@clerk/clerk-react/experimental`.
+ * @experimental This API is experimental and may change in future versions.
+ */
+export { useSignUpSignal as useSignUp } from '@clerk/clerk-react/experimental';
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In packages/tanstack-react-start/src/experimental.ts around line 1, the exported
re-exports for useSignIn and useSignUp lack JSDoc comments; add JSDoc above each
export (or a grouped JSDoc if you prefer) describing the hook purpose, basic
usage, parameters/return shape (if applicable), and that they are thin
re-exports of the experimental signals from @clerk/clerk-react/experimental;
include tags like @public and a brief note about experimental stability and a
pointer to the underlying implementation package or docs.
Description
Checklist
pnpm test
runs as expected.pnpm build
runs as expected.Type of change
Summary by CodeRabbit