Skip to content

Conversation

@octoper
Copy link
Member

@octoper octoper commented Dec 3, 2025

Description

This PR fixes a type issue that was introduced in previous release that the types require for all tasks to have a custom url, this change make's sure to adjust that so even some of the tasks can have custom url's and not all of them

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

Bug Fixes

  • Task URL customization now allows you to configure URLs for individual tasks instead of requiring customization for all tasks at once, providing more granular control and flexibility.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-bot bot commented Dec 3, 2025

🦋 Changeset detected

Latest commit: 9c7bde6

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

This PR includes changesets to release 22 packages
Name Type
@clerk/shared Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/chrome-extension Patch
@clerk/clerk-js Patch
@clerk/elements Patch
@clerk/expo-passkeys Patch
@clerk/clerk-expo Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/clerk-react Patch
@clerk/remix Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/themes Patch
@clerk/types Patch
@clerk/vue Patch
@clerk/localizations 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

@vercel
Copy link

vercel bot commented Dec 3, 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 Dec 3, 2025 1:01pm

@octoper octoper requested a review from LauraBeatris December 3, 2025 13:01
@octoper octoper self-assigned this Dec 3, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 3, 2025

Walkthrough

A changeset entry documents a patch update to @clerk/shared. The ClerkOptions.taskUrls type is modified to accept partial records instead of complete records, allowing customization of individual task URLs rather than requiring all tasks to be specified.

Changes

Cohort / File(s) Summary
Changeset entry
.changeset/bright-islands-say.md
Patch version bump documentation for @clerk/shared describing the fix for flexible task URL customization
Type definition update
packages/shared/src/types/clerk.ts
ClerkOptions.taskUrls property type relaxed from Record<SessionTask['key'], string> to Partial<Record<SessionTask['key'], string>> to allow optional per-task URL customization

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • Verify the type change is backward-compatible and doesn't break existing implementations
  • Confirm the changeset entry accurately reflects the modification

Poem

🐰 Tasks once rigid, now they bend,
Pick and choose where URLs send,
Partial records, freedom's friend,
Flexibility we can commend!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: allowing task URL customization for specific tasks instead of requiring all tasks to have custom URLs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch vaggelis/make-tast-url-accept-only-one-task

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

@octoper octoper marked this pull request as ready for review December 3, 2025 13:02
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/shared/src/types/clerk.ts (1)

1180-1180: Excellent fix for the type regression!

The change from Record<SessionTask['key'], string> to Partial<Record<SessionTask['key'], string>> correctly addresses the issue. This makes each task URL optional, allowing developers to customize URLs for specific tasks without requiring all tasks to be specified.

This is a non-breaking change that makes the type more permissive and aligns perfectly with the PR objective.

Optional enhancement to JSDoc:

Consider updating the JSDoc comment (lines 1172-1179) to explicitly mention that individual task URLs can be customized. For example:

   /**
-   * Customize the URL paths users are redirected to after sign-in or sign-up when specific
-   * session tasks need to be completed.
+   * Customize the URL paths users are redirected to after sign-in or sign-up when specific
+   * session tasks need to be completed. You can specify custom URLs for individual tasks;
+   * any tasks not specified will use Clerk's default task flow URLs.
    *
    * When `undefined`, it uses Clerk's default task flow URLs.
    *
    * @default undefined
    */
📜 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 4f4924e and 9c7bde6.

📒 Files selected for processing (2)
  • .changeset/bright-islands-say.md (1 hunks)
  • packages/shared/src/types/clerk.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

All code must pass ESLint checks with the project's configuration

Files:

  • packages/shared/src/types/clerk.ts
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/shared/src/types/clerk.ts
packages/**/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/shared/src/types/clerk.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Follow established naming conventions (PascalCase for components, camelCase for variables)

Prefer importing types from @clerk/shared/types instead of the deprecated @clerk/types alias

Files:

  • packages/shared/src/types/clerk.ts
packages/**/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

packages/**/src/**/*.{ts,tsx,js,jsx}: Maintain comprehensive JSDoc comments for public APIs
Use tree-shaking friendly exports
Validate all inputs and sanitize outputs
All public APIs must be documented with JSDoc
Use dynamic imports for optional features
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
Implement proper logging with different levels

Files:

  • packages/shared/src/types/clerk.ts
**/*.ts?(x)

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

Files:

  • packages/shared/src/types/clerk.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)

**/*.{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
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Implement type guards for unknown types using the pattern function isType(value: unknown): value is Type
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details in classes
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Use mixins for shared behavior across unrelated classes in TypeScript
Use generic constraints with bounded type parameters like <T extends { id: string }>
Use utility types like Omit, Partial, and Pick for data transformation instead of manual type construction
Use discriminated unions instead of boolean flags for state management and API responses
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation at the type level
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Document functions with JSDoc comments including @param, @returns, @throws, and @example tags
Create custom error classes that extend Error for specific error types
Use the Result pattern for error handling instead of throwing exceptions
Use optional chaining (?.) and nullish coalescing (??) operators for safe property access
Let TypeScript infer obvious types to reduce verbosity
Use const assertions with as const for literal types
Use satisfies operator for type checking without widening types
Declare readonly arrays and objects for immutable data structures
Use spread operator and array spread for immutable updates instead of mutations
Use lazy loading for large types...

Files:

  • packages/shared/src/types/clerk.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). (2)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
.changeset/bright-islands-say.md (1)

1-5: LGTM! Changeset correctly documents the type fix.

The changeset appropriately categorizes this as a patch-level change and clearly describes the fix for the type regression.

@octoper octoper closed this Dec 3, 2025
@octoper octoper reopened this Dec 3, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 3, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7354

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@7354

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@7354

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@7354

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@7354

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@7354

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@7354

@clerk/clerk-expo

npm i https://pkg.pr.new/@clerk/clerk-expo@7354

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@7354

@clerk/express

npm i https://pkg.pr.new/@clerk/express@7354

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@7354

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@7354

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@7354

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@7354

@clerk/clerk-react

npm i https://pkg.pr.new/@clerk/clerk-react@7354

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@7354

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@7354

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@7354

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@7354

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@7354

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@7354

@clerk/types

npm i https://pkg.pr.new/@clerk/types@7354

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@7354

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@7354

commit: 9c7bde6

@octoper octoper merged commit e31f3d5 into main Dec 3, 2025
245 of 256 checks passed
@octoper octoper deleted the vaggelis/make-tast-url-accept-only-one-task branch December 3, 2025 14:48
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.

3 participants