From 8ec6e8058bceb95e920cbed02bf8f4c74f45982a Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Tue, 9 Jul 2024 13:57:13 -0700 Subject: [PATCH 1/3] chore(astro): Drop immediately hydrated React wrapper components --- packages/astro/package.json | 2 -- .../react/OrganizationList.astro | 16 -------------- .../react/OrganizationProfile.astro | 16 -------------- .../react/OrganizationSwitcher.astro | 16 -------------- .../src/astro-components/react/Protect.astro | 16 -------------- .../src/astro-components/react/SignIn.astro | 15 ------------- .../src/astro-components/react/SignUp.astro | 15 ------------- .../src/astro-components/react/SignedIn.astro | 7 ------ .../astro-components/react/SignedOut.astro | 7 ------ .../astro-components/react/UserButton.astro | 15 ------------- .../astro-components/react/UserProfile.astro | 16 -------------- .../astro/src/astro-components/react/index.ts | 22 ------------------- 12 files changed, 163 deletions(-) delete mode 100644 packages/astro/src/astro-components/react/OrganizationList.astro delete mode 100644 packages/astro/src/astro-components/react/OrganizationProfile.astro delete mode 100644 packages/astro/src/astro-components/react/OrganizationSwitcher.astro delete mode 100644 packages/astro/src/astro-components/react/Protect.astro delete mode 100644 packages/astro/src/astro-components/react/SignIn.astro delete mode 100644 packages/astro/src/astro-components/react/SignUp.astro delete mode 100644 packages/astro/src/astro-components/react/SignedIn.astro delete mode 100644 packages/astro/src/astro-components/react/SignedOut.astro delete mode 100644 packages/astro/src/astro-components/react/UserButton.astro delete mode 100644 packages/astro/src/astro-components/react/UserProfile.astro delete mode 100644 packages/astro/src/astro-components/react/index.ts diff --git a/packages/astro/package.json b/packages/astro/package.json index 4f2197f6e71..721e9b81c41 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -93,8 +93,6 @@ "./env": "./env.d.ts", "./components/control": "./components/control/index.ts", "./components/control/*": "./components/control/*", - "./components/react": "./components/react/index.ts", - "./components/react/*": "./components/react/*", "./components/interactive": "./components/interactive/index.ts", "./components/interactive/*": "./components/interactive/*", "./components/unstyled": "./components/unstyled/index.ts", diff --git a/packages/astro/src/astro-components/react/OrganizationList.astro b/packages/astro/src/astro-components/react/OrganizationList.astro deleted file mode 100644 index d6d0aae2a4d..00000000000 --- a/packages/astro/src/astro-components/react/OrganizationList.astro +++ /dev/null @@ -1,16 +0,0 @@ ---- -import type { OrganizationListProps } from "@clerk/types"; -type Props = OrganizationListProps - -import type { AstroBuiltinProps } from 'astro'; -import { OrganizationList as OrganizationListReact } from "@clerk/astro/client/react"; - -const props = { - ...Astro.props, -} ---- - - diff --git a/packages/astro/src/astro-components/react/OrganizationProfile.astro b/packages/astro/src/astro-components/react/OrganizationProfile.astro deleted file mode 100644 index 261fa459aa5..00000000000 --- a/packages/astro/src/astro-components/react/OrganizationProfile.astro +++ /dev/null @@ -1,16 +0,0 @@ ---- -import type { OrganizationProfileProps } from "@clerk/types"; -type Props = OrganizationProfileProps - -import type { AstroBuiltinProps } from 'astro'; -import { OrganizationProfile as OrganizationProfileReact } from "@clerk/astro/client/react"; - -const props = { - ...Astro.props, -} ---- - - diff --git a/packages/astro/src/astro-components/react/OrganizationSwitcher.astro b/packages/astro/src/astro-components/react/OrganizationSwitcher.astro deleted file mode 100644 index b8efae096e2..00000000000 --- a/packages/astro/src/astro-components/react/OrganizationSwitcher.astro +++ /dev/null @@ -1,16 +0,0 @@ ---- -import type { OrganizationSwitcherProps } from "@clerk/types"; -type Props = OrganizationSwitcherProps - -import type { AstroBuiltinProps } from 'astro'; -import { OrganizationSwitcher as OrganizationSwitcherReact } from "@clerk/astro/client/react"; - -const props = { - ...Astro.props, -} ---- - - diff --git a/packages/astro/src/astro-components/react/Protect.astro b/packages/astro/src/astro-components/react/Protect.astro deleted file mode 100644 index d3e18f7492e..00000000000 --- a/packages/astro/src/astro-components/react/Protect.astro +++ /dev/null @@ -1,16 +0,0 @@ ---- -import type { ProtectComponentDefaultProps } from "../../types"; -type Props = ProtectComponentDefaultProps -import { Protect as ProtectReact } from "@clerk/astro/client/react"; - -const props = { - ...Astro.props, -} ---- - - - - - - - diff --git a/packages/astro/src/astro-components/react/SignIn.astro b/packages/astro/src/astro-components/react/SignIn.astro deleted file mode 100644 index 5fe14ddf570..00000000000 --- a/packages/astro/src/astro-components/react/SignIn.astro +++ /dev/null @@ -1,15 +0,0 @@ ---- -import type { SignInProps } from "@clerk/types"; -type Props = SignInProps - -import { SignIn as SignInReact } from "@clerk/astro/client/react"; - -const props = { - ...Astro.props -} ---- - - diff --git a/packages/astro/src/astro-components/react/SignUp.astro b/packages/astro/src/astro-components/react/SignUp.astro deleted file mode 100644 index ed7bf2dc67d..00000000000 --- a/packages/astro/src/astro-components/react/SignUp.astro +++ /dev/null @@ -1,15 +0,0 @@ ---- -import type { SignUpProps } from "@clerk/types"; -type Props = SignUpProps - -import { SignUp as SignUpReact } from "@clerk/astro/client/react"; - -const props = { - ...Astro.props -} ---- - - diff --git a/packages/astro/src/astro-components/react/SignedIn.astro b/packages/astro/src/astro-components/react/SignedIn.astro deleted file mode 100644 index c543dca99ca..00000000000 --- a/packages/astro/src/astro-components/react/SignedIn.astro +++ /dev/null @@ -1,7 +0,0 @@ ---- -import { SignedIn as SignedInReact } from "@clerk/astro/client/react"; ---- - - - - diff --git a/packages/astro/src/astro-components/react/SignedOut.astro b/packages/astro/src/astro-components/react/SignedOut.astro deleted file mode 100644 index 9ab3f8615a9..00000000000 --- a/packages/astro/src/astro-components/react/SignedOut.astro +++ /dev/null @@ -1,7 +0,0 @@ ---- -import { SignedOut as SignedOutReact } from "@clerk/astro/client/react"; ---- - - - - diff --git a/packages/astro/src/astro-components/react/UserButton.astro b/packages/astro/src/astro-components/react/UserButton.astro deleted file mode 100644 index 0deff393bd7..00000000000 --- a/packages/astro/src/astro-components/react/UserButton.astro +++ /dev/null @@ -1,15 +0,0 @@ ---- -import type { UserButtonProps } from "@clerk/types"; -type Props = UserButtonProps - -import { UserButton as UserButtonReact } from "@clerk/astro/client/react"; - -const props = { - ...Astro.props, -} ---- - - diff --git a/packages/astro/src/astro-components/react/UserProfile.astro b/packages/astro/src/astro-components/react/UserProfile.astro deleted file mode 100644 index a836ed34d69..00000000000 --- a/packages/astro/src/astro-components/react/UserProfile.astro +++ /dev/null @@ -1,16 +0,0 @@ ---- -import type { UserProfileProps } from "@clerk/types"; -type Props = UserProfileProps - -import type { AstroBuiltinProps } from 'astro'; -import { UserProfile as UserProfileReact } from "@clerk/astro/client/react"; - -const props = { - ...Astro.props, -} ---- - - diff --git a/packages/astro/src/astro-components/react/index.ts b/packages/astro/src/astro-components/react/index.ts deleted file mode 100644 index 425d016df1e..00000000000 --- a/packages/astro/src/astro-components/react/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -// The `ts-ignore` comments here are necessary because we're importing this file inside the `astro:components` -// virtual module's types, which means that `tsc` will try to resolve these imports. Don't mind the editor errors. -// @ts-ignore -export { default as SignIn } from './SignIn.astro'; -// @ts-ignore -export { default as SignUp } from './SignUp.astro'; -// @ts-ignore -export { default as UserButton } from './UserButton.astro'; -// @ts-ignore -export { default as UserProfile } from './UserProfile.astro'; -// @ts-ignore -export { default as OrganizationProfile } from './OrganizationProfile.astro'; -// @ts-ignore -export { default as OrganizationSwitcher } from './OrganizationSwitcher.astro'; -// @ts-ignore -export { default as OrganizationList } from './OrganizationList.astro'; -// @ts-ignore -export { default as SignedIn } from './SignedIn.astro'; -// @ts-ignore -export { default as SignedOut } from './SignedOut.astro'; -// @ts-ignore -export { default as Protect } from './Protect.astro'; From 2e339af8fdb8ea6165c4bea7780535620c454134 Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Tue, 9 Jul 2024 14:35:01 -0700 Subject: [PATCH 2/3] test(astro): Use React components --- integration/templates/astro-node/src/pages/index.astro | 6 +++--- .../templates/astro-node/src/pages/only-admins-react.astro | 4 ++-- .../templates/astro-node/src/pages/only-members-react.astro | 4 ++-- packages/astro/README.md | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/integration/templates/astro-node/src/pages/index.astro b/integration/templates/astro-node/src/pages/index.astro index 0f68d4bc7ed..ae6a9ed78b6 100644 --- a/integration/templates/astro-node/src/pages/index.astro +++ b/integration/templates/astro-node/src/pages/index.astro @@ -3,7 +3,7 @@ import Layout from "../layouts/Layout.astro"; import Card from "../components/Card.astro"; import SignOutButton from "../lib/astro-components/SignOutButton.astro"; -import { SignedIn, SignedOut } from "@clerk/astro/components/react"; +import { SignedIn, SignedOut } from "@clerk/astro/client/react"; import { OrganizationSwitcher } from "@clerk/astro/components/interactive"; --- @@ -30,7 +30,7 @@ import { OrganizationSwitcher } from "@clerk/astro/components/interactive"; Code Challenge: Tweak the "Welcome to Astro" message above.