chore(astro): Add unstyled components - #3656
Conversation
🦋 Changeset detectedLatest commit: 0d9ccf9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
1216188 to
dc34eb8
Compare
5e251ae to
5aa67d0
Compare
| import { customAlphabet, urlAlphabet } from "nanoid"; | ||
|
|
||
| const safeId = customAlphabet(urlAlphabet, 10)(); |
There was a problem hiding this comment.
Starting to notice we're repeating this piece of logic in all our Astro components. I'll make a ticket that will address this
| --- | ||
| import type { SignInButtonProps } from "@clerk/astro/client/react"; | ||
| type Props = SignInButtonProps | ||
|
|
||
| import { SignInButton as SignInButtonReact } from "@clerk/astro/client/react"; | ||
|
|
||
| const props = { | ||
| ...Astro.props | ||
| } | ||
| --- | ||
|
|
||
| <SignInButtonReact | ||
| client:load | ||
| {...props} | ||
| /> |
There was a problem hiding this comment.
So in general we still are not sure if we are keeping astro-components/react. Do you think we should ?
There was a problem hiding this comment.
I think we should just drop it. Unstyled components won't benefit here anyway since islands don't support React.cloneElement
| btn.addEventListener("click", () => { | ||
| window.Clerk.signOut({ redirectUrl }) | ||
| }); |
There was a problem hiding this comment.
I know that this is how it is implemented in clerk-react but can you find out if we maybe need to respect all the functionality signOut provides ? Type here
There was a problem hiding this comment.
Nice catch. I think we need to respect the sessionId since it's needed if a user wants to sign out of a specific session.
Also, looking at the SignOutButton reference, the callback is never stated and it's recommended to migrate to redirectUrl in the Core 2 migration doc. So are we looking at deprecation of the callback property in the future here?
The signOutCallback prop on the component has been removed. Instead, you can use the redirectUrl prop
There was a problem hiding this comment.
Added sessionId to sign out options. We had a small discussion in Slack about this. signOutCallback is removed.
Here's a reference to where the sessionId was accidentally ignored
3118dbf to
d405525
Compare
chore(astro): use data attribute in referencing unstyled components
0c22841 to
45ae288
Compare
Co-authored-by: panteliselef <panteliselef@outlook.com>
Description
This PR is tackling ECO-2 and adds unstyled sign in, sign up, and sign out components for both Astro and React.
Checklist
npm testruns as expected.npm run buildruns as expected.Type of change