-
Notifications
You must be signed in to change notification settings - Fork 386
chore(vue,nuxt): Set default GoogleOneTap prop values #6809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 1714ad0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughAdds GoogleOneTap to the Nuxt module auto-registration and moves PricingTable into the Billing group (removing a duplicate). Sets default boolean props for the GoogleOneTap Vue component. Adds two patch-level changeset entries documenting the Nuxt auto-import and a bugfix for GoogleOneTap defaults. No other runtime logic changes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant NuxtMod as Nuxt Module (Clerk)
participant NuxtBuild as Nuxt Build
participant App as Vue App
participant GoogleOne as GoogleOneTap Component
Dev->>NuxtBuild: run build/init
NuxtBuild->>NuxtMod: initialize module
NuxtMod->>NuxtBuild: addComponent(GoogleOneTap), adjust Billing components
Note over NuxtBuild: Components registered for auto-import
Dev->>App: use <GoogleOneTap /> in template
App->>GoogleOne: instantiate component (props with defaults)
GoogleOne-->>App: render UI
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
Comment |
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/elements
@clerk/clerk-expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/clerk-react
@clerk/react-router
@clerk/remix
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/themes
@clerk/types
@clerk/upgrade
@clerk/vue
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/nuxt/src/module.ts (1)
144-159
: Add export for GoogleOneTap in @clerk/vue or remove it from the Nuxt moduleGoogleOneTap exists at packages/clerk-js/src/ui/components/GoogleOneTap/* but is not exported from packages/vue/src/index.ts; keeping 'GoogleOneTap' in packages/nuxt/src/module.ts (lines 144–159) will cause runtime import errors. Either add a re-export in packages/vue/src/index.ts that points to the clerk-js implementation, or remove the 'GoogleOneTap' entry from the Nuxt module.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
.changeset/twelve-carrots-bathe.md
(1 hunks)packages/nuxt/src/module.ts
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
.changeset/**
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Automated releases must use Changesets.
Files:
.changeset/twelve-carrots-bathe.md
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
**/*.{js,jsx,ts,tsx}
: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels
Files:
packages/nuxt/src/module.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use Prettier for consistent code formatting
Files:
packages/nuxt/src/module.ts
packages/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
TypeScript is required for all packages
Files:
packages/nuxt/src/module.ts
packages/**/*.{ts,tsx,d.ts}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Packages should export TypeScript types alongside runtime code
Files:
packages/nuxt/src/module.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use proper TypeScript error types
**/*.{ts,tsx}
: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoidany
type - preferunknown
when type is uncertain, then narrow with type guards
Useinterface
for object shapes that might be extended
Usetype
for unions, primitives, and computed types
Preferreadonly
properties for immutable data structures
Useprivate
for internal implementation details
Useprotected
for inheritance hierarchies
Usepublic
explicitly for clarity in public APIs
Preferreadonly
for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Useconst assertions
for literal types:as const
Usesatisfies
operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports:import type { ... } from ...
Noany
types without justification
Proper error handling with typed errors
Consistent use ofreadonly
for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)
Files:
packages/nuxt/src/module.ts
**/*.{js,ts,tsx,jsx}
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.
Files:
packages/nuxt/src/module.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (25)
- GitHub Check: Integration Tests (nextjs, chrome, 14)
- GitHub Check: Integration Tests (nextjs, chrome, 15)
- GitHub Check: Integration Tests (custom, chrome)
- GitHub Check: Integration Tests (react-router, chrome)
- GitHub Check: Integration Tests (billing, chrome)
- GitHub Check: Integration Tests (machine, chrome)
- GitHub Check: Integration Tests (tanstack-react-start, chrome)
- GitHub Check: Integration Tests (tanstack-react-router, chrome)
- GitHub Check: Integration Tests (nuxt, chrome)
- GitHub Check: Integration Tests (expo-web, chrome)
- GitHub Check: Integration Tests (vue, chrome)
- GitHub Check: Integration Tests (elements, chrome)
- GitHub Check: Integration Tests (sessions, chrome)
- GitHub Check: Integration Tests (astro, chrome)
- GitHub Check: Integration Tests (quickstart, chrome)
- GitHub Check: Integration Tests (ap-flows, chrome)
- GitHub Check: Integration Tests (localhost, chrome)
- GitHub Check: Integration Tests (express, chrome)
- GitHub Check: Integration Tests (generic, chrome)
- GitHub Check: Unit Tests (18, --filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@c...
- GitHub Check: Publish with pkg-pr-new
- GitHub Check: Unit Tests (22, **)
- GitHub Check: Static analysis
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
packages/nuxt/src/module.ts (1)
144-144
: LGTM! GoogleOneTap correctly added to Authentication Components.The placement in the Authentication Components section is appropriate and aligns with the component's purpose.
.changeset/twelve-carrots-bathe.md (1)
1-11
: LGTM! Changeset properly documents the new auto-imported component.The changeset correctly:
- Uses patch-level versioning for this additive change
- Provides clear documentation of the new GoogleOneTap component
- Includes a practical Vue usage example
- Follows the established changeset format
// Billing Components | ||
'PricingTable', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify PricingTable component organization and duplication removal.
The reorganization places PricingTable under "Billing Components" which is semantically correct. However, I need to verify that the duplicate PricingTable entry was actually removed and that this component exists in @clerk/vue.
🏁 Script executed:
#!/bin/bash
# Description: Verify PricingTable organization and check for duplicates in the module
# Check if PricingTable appears only once in the components array
echo "Checking PricingTable occurrences in module.ts:"
rg -n "PricingTable" packages/nuxt/src/module.ts
# Verify PricingTable export exists in @clerk/vue
echo -e "\nChecking if PricingTable is exported from @clerk/vue:"
rg -n "PricingTable" packages/vue/src/index.ts || echo "Not found in vue/src/index.ts, checking other export files..."
# Check for PricingTable component definition
echo -e "\nSearching for PricingTable component definition:"
fd -t f -e ts -e tsx | xargs rg -l "PricingTable" | head -10
Length of output: 769
Export PricingTable from @clerk/vue or update Nuxt module import
- packages/nuxt/src/module.ts contains a single 'PricingTable' entry (packages/nuxt/src/module.ts:159) — duplicate removed.
- Component implementation exists at packages/clerk-js/src/ui/components/PricingTable/(index.tsx, PricingTable.tsx) but is not exported from packages/vue/src/index.ts.
- Action: either re-export PricingTable from packages/vue/src/index.ts (pointing to the clerk-js implementation) or update packages/nuxt/src/module.ts to register/import the component from the package that actually exposes it.
🤖 Prompt for AI Agents
In packages/nuxt/src/module.ts around lines 158-159, Nuxt registers a
'PricingTable' component but that component isn't exported from
packages/vue/src/index.ts (the actual implementation lives at
packages/clerk-js/src/ui/components/PricingTable). Fix by either: (A)
re-exporting the component from packages/vue/src/index.ts by adding an export
that points to ../../clerk-js/src/ui/components/PricingTable (so @clerk/vue
exposes PricingTable for the Nuxt module), or (B) change
packages/nuxt/src/module.ts to import/register the component directly from
packages/clerk-js/src/ui/components/PricingTable instead of @clerk/vue; ensure
imports use the correct relative package path and update any index exports to
avoid duplicate entries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/vue/src/components/ui-components/GoogleOneTap.vue (1)
8-12
: Add a short intent comment to keep frameworks in sync.A brief note will help future maintainers avoid regressions when React or GIS defaults change.
Apply:
-const props = withDefaults(defineProps<GoogleOneTapProps>(), { +// Explicit defaults to avoid Vue SFC boolean coercion to false; keep in sync with @clerk/react and GIS defaults. +const props = withDefaults(defineProps<GoogleOneTapProps>(), { cancelOnTapOutside: true, itpSupport: true, fedCmSupport: true, });
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
.changeset/clean-cars-fly.md
(1 hunks).changeset/twelve-carrots-bathe.md
(1 hunks)packages/vue/src/components/ui-components/GoogleOneTap.vue
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- .changeset/clean-cars-fly.md
🚧 Files skipped from review as they are similar to previous changes (1)
- .changeset/twelve-carrots-bathe.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: Integration Tests (nextjs, chrome, 14)
- GitHub Check: Integration Tests (custom, chrome)
- GitHub Check: Integration Tests (generic, chrome)
- GitHub Check: Static analysis
- GitHub Check: Publish with pkg-pr-new
- GitHub Check: Unit Tests (22, **)
- GitHub Check: Unit Tests (18, --filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@c...
- GitHub Check: Formatting | Dedupe | Changeset
- GitHub Check: semgrep/ci
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
packages/vue/src/components/ui-components/GoogleOneTap.vue (2)
8-12
: Good fix: explicit Vue defaults prevent boolean coercion and align with React/GIS.Using withDefaults here ensures omitted booleans don’t silently become false. Looks correct.
8-12
: Verify type parity and React defaults for GoogleOneTap props
- packages/types/src/clerk.ts: GoogleOneTapProps declares cancelOnTapOutside?, itpSupport?, fedCmSupport? (cancelOnTapOutside has JSDoc @default true).
- packages/vue/src/components/ui-components/GoogleOneTap.vue: component sets cancelOnTapOutside, itpSupport, fedCmSupport to true via withDefaults — Vue matches the types/docs.
- I couldn't find the @clerk/react GoogleOneTap implementation in this branch — confirm @clerk/react either leaves these props undefined (so the SDK/docs default to true apply) or explicitly defaults them to true; if it uses different defaults, align the implementations.
Description
The Vue
GoogleOneTap
component coerces boolean props tofalse
when omitted due to Vue's SFC compilation, while the React version leaves themundefined
. This causes different behavior between frameworks:fedCmSupport
defaults totrue
(via Google Identity Services)fedCmSupport
defaults tofalse
(due to Vue's boolean coercion)The same issue affects
cancelOnTapOutside
anditpSupport
props.Other Clerk components are unaffected because Clerk JS contexts normalize these values before consumption 👍🏼
This PR explicitly set default values that match the intended behavior documented here.
Before (one tap not rendered)
After
Checklist
pnpm test
runs as expected.pnpm build
runs as expected.Type of change
Summary by CodeRabbit