Skip to content

Commit 4a06520

Browse files
committed
debug generic
1 parent 0e21635 commit 4a06520

File tree

7 files changed

+50
-22
lines changed

7 files changed

+50
-22
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -296,22 +296,21 @@ jobs:
296296
strategy:
297297
fail-fast: false
298298
matrix:
299-
test-name:
300-
[
299+
test-name: [
301300
"generic",
302-
"express",
303-
"ap-flows",
304-
"localhost",
305-
"sessions",
306-
"sessions:staging",
307-
"handshake",
308-
"handshake:staging",
309-
"astro",
310-
"tanstack-react-start",
311-
"vue",
312-
"nuxt",
313-
"react-router",
314-
"custom",
301+
# "express",
302+
# "ap-flows",
303+
# "localhost",
304+
# "sessions",
305+
# "sessions:staging",
306+
# "handshake",
307+
# "handshake:staging",
308+
# "astro",
309+
# "tanstack-react-start",
310+
# "vue",
311+
# "nuxt",
312+
# "react-router",
313+
# "custom",
315314
]
316315
test-project: ["chrome"]
317316
include:

integration/templates/react-vite/src/main.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ const Root = () => {
3535
routerPush={(to: string) => navigate(to)}
3636
routerReplace={(to: string) => navigate(to, { replace: true })}
3737
appearance={{
38+
colors: {
39+
colorPrimary: 'red',
40+
},
3841
layout: {
3942
showOptionalFields: true,
4043
},
@@ -45,6 +48,7 @@ const Root = () => {
4548
: undefined,
4649
}}
4750
>
51+
is this the correct app?
4852
<Outlet />
4953
</ClerkProvider>
5054
);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"test:integration:deployment:nextjs": "pnpm playwright test --config integration/playwright.deployments.config.ts",
4141
"test:integration:expo-web:disabled": "E2E_APP_ID=expo.expo-web pnpm test:integration:base --grep @expo-web",
4242
"test:integration:express": "E2E_DEBUG=1 E2E_DEBUG=1 E2E_APP_ID=express.* pnpm test:integration:base --grep @express",
43-
"test:integration:generic": "E2E_DEBUG=1 E2E_APP_ID=react.vite.*,next.appRouter.withEmailCodes* pnpm test:integration:base --grep @generic",
43+
"test:integration:generic": "E2E_DEBUG=1 E2E_APP_ID=react.vite.withEmailCodes pnpm test:integration:base --grep @generic sign-up-flow.test.ts",
4444
"test:integration:handshake": "DISABLE_WEB_SECURITY=true E2E_APP_1_ENV_KEY=sessions-prod-1 E2E_SESSIONS_APP_1_HOST=multiple-apps-e2e.clerk.app pnpm test:integration:base --grep @handshake",
4545
"test:integration:handshake:staging": "DISABLE_WEB_SECURITY=true E2E_APP_1_ENV_KEY=clerkstage-sessions-prod-1 E2E_SESSIONS_APP_1_HOST=clerkstage-sessions-prod-1-e2e.clerk.app pnpm test:integration:base --grep @handshake",
4646
"test:integration:localhost": "pnpm test:integration:base --grep @localhost",

packages/ui/src/Components.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@ import type {
1717
UserProfileProps,
1818
WaitlistProps,
1919
} from '@clerk/shared/types';
20-
21-
import type { Appearance } from './internal/appearance';
2220
import { createDeferredPromise } from '@clerk/shared/utils';
2321
import React, { Suspense } from 'react';
2422

2523
import type { AppearanceCascade } from './customizables/parseAppearance';
2624
// NOTE: Using `./hooks` instead of `./hooks/useClerkModalStateParams` will increase the bundle size
2725
import { useClerkModalStateParams } from './hooks/useClerkModalStateParams';
26+
import type { Appearance } from './internal/appearance';
2827
import type { ClerkComponentName } from './lazyModules/components';
2928
import {
3029
BlankCaptchaModal,
@@ -293,6 +292,10 @@ const Components = (props: ComponentsProps) => {
293292
impersonationFab: false,
294293
});
295294

295+
console.log('props.options.appearance', JSON.stringify(props.options.appearance));
296+
console.log('props.options', JSON.stringify(props.options));
297+
console.log('state.appearance', JSON.stringify(state.appearance));
298+
296299
const {
297300
googleOneTapModal,
298301
signInModal,

packages/ui/src/components/SignUp/SignUpStart.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ function SignUpStartInternal(): JSX.Element {
3737
const clerk = useClerk();
3838
const status = useLoadingStatus();
3939
const signUp = useCoreSignUp();
40-
const { showOptionalFields } = useAppearance().parsedLayout;
40+
const appearance = useAppearance();
41+
const { showOptionalFields } = appearance.parsedLayout;
42+
console.log('[SignUpStart] useAppearance().parsedLayout', JSON.stringify(appearance.parsedLayout));
43+
console.log('[SignUpStart] showOptionalFields', showOptionalFields);
4144
const { userSettings, authConfig } = useEnvironment();
4245
const { navigate } = useRouter();
4346
const { attributes } = userSettings;
@@ -439,7 +442,6 @@ function SignUpStartInternal(): JSX.Element {
439442
legalAccepted={Boolean(formState.legalAccepted.checked) || undefined}
440443
/>
441444
)}
442-
hello there
443445
{shouldShowForm && (
444446
<SignUpForm
445447
handleSubmit={handleSubmit}

packages/ui/src/customizables/AppearanceContext.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,20 @@ const [AppearanceContext, useAppearance] = createContextAndHook<AppearanceContex
1111
type AppearanceProviderProps = React.PropsWithChildren<AppearanceCascade>;
1212

1313
const AppearanceProvider = (props: AppearanceProviderProps) => {
14+
console.log('[AppearanceProvider] rendering with props:', {
15+
globalAppearance: JSON.stringify(props.globalAppearance),
16+
appearance: JSON.stringify(props.appearance),
17+
appearanceKey: props.appearanceKey,
18+
});
19+
1420
const ctxValue = useDeepEqualMemo(() => {
21+
console.log('[AppearanceProvider] useDeepEqualMemo factory called');
1522
const value = parseAppearance(props);
16-
23+
console.log('[AppearanceProvider] parsed value.parsedLayout:', JSON.stringify(value.parsedLayout));
1724
return { value };
18-
}, [props.appearance, props.globalAppearance]);
25+
}, [props.appearance, props.globalAppearance, props.appearanceKey]);
26+
27+
console.log('[AppearanceProvider] ctxValue.value.parsedLayout:', JSON.stringify(ctxValue.value.parsedLayout));
1928

2029
return <AppearanceContext.Provider value={ctxValue}>{props.children}</AppearanceContext.Provider>;
2130
};

packages/ui/src/customizables/parseAppearance.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,27 @@ const defaultCaptchaOptions: ParsedCaptcha = {
6868
*/
6969
export const parseAppearance = (cascade: AppearanceCascade): ParsedAppearance => {
7070
const { globalAppearance, appearance: componentAppearance, appearanceKey } = cascade;
71+
console.log('[parseAppearance] globalAppearance', JSON.stringify(globalAppearance));
72+
console.log('[parseAppearance] componentAppearance', JSON.stringify(componentAppearance));
73+
console.log('[parseAppearance] appearanceKey', appearanceKey);
7174

7275
const appearanceList: Appearance[] = [];
7376
[globalAppearance, globalAppearance?.[appearanceKey as PublicAppearanceTopLevelKey], componentAppearance].forEach(a =>
7477
expand(a, appearanceList),
7578
);
7679

80+
console.log('[parseAppearance] appearanceList length', appearanceList.length);
81+
console.log(
82+
'[parseAppearance] appearanceList layouts',
83+
appearanceList.map(a => JSON.stringify(a?.layout)),
84+
);
85+
7786
const parsedInternalTheme = parseVariables(appearanceList);
7887
const parsedLayout = parseLayout(appearanceList);
7988
const parsedCaptcha = parseCaptcha(appearanceList);
8089

90+
console.log('[parseAppearance] parsedLayout', JSON.stringify(parsedLayout));
91+
8192
if (
8293
!appearanceList.find(a => {
8394
//@ts-expect-error not public api

0 commit comments

Comments
 (0)