Skip to content

Commit d535eac

Browse files
authored
Revert "feat(clerk-js,types): Terse paths parameters (#572)" (#603)
This reverts commit baa58e0.
1 parent a1f9422 commit d535eac

File tree

3 files changed

+46
-18
lines changed

3 files changed

+46
-18
lines changed

packages/react/src/components/withClerk.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { LoadedClerk } from '@clerk/types';
2-
import { Without } from '@clerk/types/src';
32
import React from 'react';
43

54
import { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';
@@ -12,7 +11,7 @@ export const withClerk = <P extends { clerk: LoadedClerk }>(
1211
) => {
1312
displayName = displayName || Component.displayName || Component.name || 'Component';
1413
Component.displayName = displayName;
15-
const HOC = (props: Without<P, 'clerk'>) => {
14+
const HOC = (props: Omit<P, 'clerk'>) => {
1615
const clerk = useIsomorphicClerkContext();
1716

1817
if (!clerk.loaded) {

packages/types/src/clerk.ts

+45-9
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,6 @@ export interface Resources {
464464

465465
export type RoutingStrategy = 'path' | 'hash' | 'virtual';
466466

467-
export type RoutingOptions =
468-
| { path: string; routing?: Extract<RoutingStrategy, 'path'> }
469-
| { path?: never; routing?: Extract<RoutingStrategy, 'hash' | 'virtual'> };
470-
471467
export type RedirectOptions = {
472468
/**
473469
* Full URL or path to navigate after successful sign in.
@@ -512,7 +508,15 @@ export type SetActiveParams = {
512508

513509
export type SetActive = (params: SetActiveParams) => Promise<void>;
514510

515-
export type SignInProps = RoutingOptions & {
511+
export type SignInProps = {
512+
/*
513+
* Page routing strategy
514+
*/
515+
routing?: RoutingStrategy;
516+
/*
517+
* Root URL where the component is mounted on, eg: '/sign in'
518+
*/
519+
path?: string;
516520
/**
517521
* Full URL or path to for the sign up process.
518522
* Used to fill the "Sign up" link in the SignUp component.
@@ -526,7 +530,15 @@ export type SignInProps = RoutingOptions & {
526530
appearance?: SignInTheme;
527531
} & RedirectOptions;
528532

529-
export type SignUpProps = RoutingOptions & {
533+
export type SignUpProps = {
534+
/*
535+
* Page routing strategy
536+
*/
537+
routing?: RoutingStrategy;
538+
/*
539+
* Root URL where the component is mounted on, eg: '/sign up'
540+
*/
541+
path?: string;
530542
/**
531543
* Full URL or path to for the sign in process.
532544
* Used to fill the "Sign in" link in the SignUp component.
@@ -540,7 +552,15 @@ export type SignUpProps = RoutingOptions & {
540552
appearance?: SignUpTheme;
541553
} & RedirectOptions;
542554

543-
export type UserProfileProps = RoutingOptions & {
555+
export type UserProfileProps = {
556+
/*
557+
* Page routing strategy
558+
*/
559+
routing?: RoutingStrategy;
560+
/*
561+
* Root URL where the component is mounted on, eg: '/user'
562+
*/
563+
path?: string;
544564
/*
545565
* Renders only a specific view of the component eg: 'security'
546566
*/
@@ -553,7 +573,15 @@ export type UserProfileProps = RoutingOptions & {
553573
appearance?: UserProfileTheme;
554574
};
555575

556-
export type OrganizationProfileProps = RoutingOptions & {
576+
export type OrganizationProfileProps = {
577+
/*
578+
* Page routing strategy
579+
*/
580+
routing?: RoutingStrategy;
581+
/*
582+
* Root URL where the component is mounted on, eg: '/user'
583+
*/
584+
path?: string;
557585
/**
558586
* Full URL or path to navigate to after the user leaves the currently active organization.
559587
* @default undefined
@@ -567,7 +595,15 @@ export type OrganizationProfileProps = RoutingOptions & {
567595
appearance?: OrganizationProfileTheme;
568596
};
569597

570-
export type CreateOrganizationProps = RoutingOptions & {
598+
export type CreateOrganizationProps = {
599+
/*
600+
* Page routing strategy
601+
*/
602+
routing?: RoutingStrategy;
603+
/*
604+
* Root URL where the component is mounted on, eg: '/user'
605+
*/
606+
path?: string;
571607
/**
572608
* Full URL or path to navigate after creating a new organization.
573609
* @default undefined

packages/types/src/utils.ts

-7
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ export type DeepRequired<T> = Required<{
3434
[P in keyof T]: T[P] extends object | undefined ? DeepRequired<Required<T[P]>> : T[P];
3535
}>;
3636

37-
/**
38-
* Omit without union flattening
39-
* */
40-
export type Without<T, W> = {
41-
[P in keyof T as Exclude<P, W>]: T[P];
42-
};
43-
4437
/**
4538
* Internal type used by RecordToPath
4639
*/

0 commit comments

Comments
 (0)