Skip to content

Conversation

@panteliselef
Copy link
Member

@panteliselef panteliselef commented Apr 11, 2024

Description

This PR introduces:

  • < __experimental_GoogleOneTap/>
  • __experimental_mountGoogleOneTap()
  • __experimental_unmountGoogleOneTap()

Proper support for the PSU flow will be added later. This PR will also be backported to v4 (core-1)

DOM while is mounted

Screenshot 2024-04-15 at 2 18 12 PM

SignIn/SignUp (without additional steps)

Screen.Recording.2024-04-12.at.4.24.14.PM.mov

SignUp (with additional steps)

Screen.Recording.2024-04-12.at.4.23.10.PM.mov

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@panteliselef panteliselef self-assigned this Apr 11, 2024
@changeset-bot
Copy link

changeset-bot bot commented Apr 11, 2024

🦋 Changeset detected

Latest commit: c0751a6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@clerk/clerk-js Minor
@clerk/nextjs Minor
@clerk/clerk-react Minor
@clerk/types Minor
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch
gatsby-plugin-clerk Patch
@clerk/remix Patch
@clerk/backend Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/clerk-sdk-node Patch
@clerk/themes Patch

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

@panteliselef panteliselef marked this pull request as ready for review April 12, 2024 13:21
);
}, 'OrganizationList');

export const __experimental_GoogleOneTap = withClerk(({ clerk, ...props }: WithClerkProp<OneTapProps>) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Are we sure a component name starting with _ works well in JSX?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using it with our playground did not give me trouble


Introduce experimental support for Google One Tap
- React Component `<__experimental_GoogleOneTap/>`
- JS `clerk.__experimental_mountGoogleOneTap(node,props)`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Is the __experimental_ prefix the one we settled for?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it was experimental_

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure we settled for __experimental_ same one we had for the most recent project "passkeys"

Comment on lines +22 to +24
<SignedOut>
<__experimental_GoogleOneTap />
</SignedOut>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ do we want to put a signed out check inside the component itself?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do have that check inside one-tap-start.tsx. I will be dropping this file change tho.

}

const environmentClientID = environment.displayConfig.googleOneTapClientId;
const shouldLoadGIS = user?.id && environmentClientID;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Why do we only load GIS if user.id is defined?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not right, I pushed a fix.

@panteliselef panteliselef merged commit ff08fe2 into main Apr 16, 2024
@panteliselef panteliselef deleted the elef/google-one-tap branch April 16, 2024 08:11
panteliselef added a commit that referenced this pull request Apr 17, 2024
) (#3196)

* feat(clerk-js): Introduce experimental support for Google One Tap (#3176)

* chore(clerk-js): format

* chore(clerk-js): Replace with useCore* hooks

* chore(clerk-js): Update tests snapshots

* chore(clerk-js): Make linter happy

* chore(clerk-js): Use `useUserContext` instead of `useCoreUser`

* fix(clerk-js): Reprompt google one tap only when user id changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants