-
Notifications
You must be signed in to change notification settings - Fork 419
feat(shared,ui): Remove virtual routing option #7466
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
Changes from all commits
91f9a8f
77a1bc6
277f5ba
0a03f68
c02bf56
6f6aac3
b1bcb46
f77ef82
7b7b03e
d1a4765
9dfb76d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| '@clerk/ui': patch | ||
| '@clerk/shared': patch | ||
| --- | ||
|
|
||
| Remove `virtual` from the `routing` option. The `virtual` value is only used internally and should not be part of the public API. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,21 @@ | ||
| import type { SignInFactor } from '@clerk/shared/types'; | ||
| import type { SignInSecondFactor } from '@clerk/shared/types'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add JSDoc documentation to the exported The function at line 96 is exported and lacks JSDoc comments. Per the coding guidelines for Additionally, verify that all components calling this component with 🤖 Prompt for AI Agents |
||
| import React from 'react'; | ||
|
|
||
| import { ArrowBlockButton } from '@/ui/elements/ArrowBlockButton'; | ||
| import { Card } from '@/ui/elements/Card'; | ||
| import { Header } from '@/ui/elements/Header'; | ||
| import { backupCodePrefFactorComparator } from '@/ui/utils/factorSorting'; | ||
| import { formatSafeIdentifier } from '@/ui/utils/formatSafeIdentifier'; | ||
| import { useCoreSignIn } from '@/contexts'; | ||
| import type { LocalizationKey } from '@/customizables'; | ||
| import { Col, descriptors, Flow, localizationKeys } from '@/customizables'; | ||
| import { ArrowBlockButton } from '@/elements/ArrowBlockButton'; | ||
| import { Card } from '@/elements/Card'; | ||
| import { useCardState } from '@/elements/contexts'; | ||
| import { Header } from '@/elements/Header'; | ||
| import { backupCodePrefFactorComparator } from '@/utils/factorSorting'; | ||
| import { formatSafeIdentifier } from '@/utils/formatSafeIdentifier'; | ||
|
|
||
| import { useCoreSignIn } from '../../contexts'; | ||
| import type { LocalizationKey } from '../../customizables'; | ||
| import { Col, descriptors, Flow, localizationKeys } from '../../customizables'; | ||
| import { useCardState } from '../../elements/contexts'; | ||
| import { HavingTrouble } from './HavingTrouble'; | ||
|
|
||
| export type AlternativeMethodsProps = { | ||
| onBackLinkClick: React.MouseEventHandler | undefined; | ||
| onFactorSelected: (factor: SignInFactor) => void; | ||
| onFactorSelected: (factor: SignInSecondFactor) => void; | ||
| }; | ||
|
|
||
| export const SignInFactorTwoAlternativeMethods = (props: AlternativeMethodsProps) => { | ||
|
|
@@ -93,7 +93,7 @@ const AlternativeMethodsList = (props: AlternativeMethodsProps & { onHavingTroub | |
| ); | ||
| }; | ||
|
|
||
| export function getButtonLabel(factor: SignInFactor): LocalizationKey { | ||
| export function getButtonLabel(factor: SignInSecondFactor): LocalizationKey { | ||
| switch (factor.strategy) { | ||
| case 'phone_code': | ||
| return localizationKeys('signIn.alternativeMethods.blockButton__phoneCode', { | ||
|
|
@@ -112,6 +112,7 @@ export function getButtonLabel(factor: SignInFactor): LocalizationKey { | |
| identifier: formatSafeIdentifier(factor.safeIdentifier) || '', | ||
| }); | ||
| default: | ||
| throw new Error(`Invalid sign in strategy: "${factor.strategy}"`); | ||
| ((_: never) => _)(factor); | ||
| throw new Error('Invalid sign in strategy'); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import type { RoutingStrategy } from '@clerk/shared/types'; | ||
|
|
||
| export type WithInternalRouting<T> = | ||
| | (Omit<T, 'routing' | 'path'> & { path: string | undefined; routing?: Extract<RoutingStrategy, 'path'> }) | ||
| | (Omit<T, 'routing' | 'path'> & { path?: never; routing?: Extract<RoutingStrategy, 'hash' | 'virtual'> }); |
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.
🧩 Analysis chain
🏁 Script executed:
Repository: clerk/javascript
Length of output: 376
🏁 Script executed:
Repository: clerk/javascript
Length of output: 865
🏁 Script executed:
Repository: clerk/javascript
Length of output: 1797
🏁 Script executed:
Repository: clerk/javascript
Length of output: 804
🏁 Script executed:
Repository: clerk/javascript
Length of output: 427
🏁 Script executed:
Repository: clerk/javascript
Length of output: 729
Add JSDoc documentation for the public
OrganizationProfileexport.This is a public API that must be documented with JSDoc per coding guidelines. Include a description of the component's purpose, usage example, and prop documentation.
The type safety pattern with
withCardStateProvideraccepting bothOrganizationProfilePropsandWithInternalRouting<OrganizationProfileProps>is intentional by design, as evidenced by the@ts-expect-errorin the HOC implementation that deliberately bridges these type signatures.🤖 Prompt for AI Agents