Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/deprecate-vue-signout-options.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@clerk/vue": patch
---

Deprecate the `signOutOptions` prop on `<SignOutButton />` in favor of top-level `redirectUrl` and `sessionId` props. The `signOutOptions` prop still works but now emits a deprecation warning.
8 changes: 8 additions & 0 deletions packages/vue/src/components/SignOutButton.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<script setup lang="ts">
import { useAttrs, useSlots } from 'vue';
import { deprecated } from '@clerk/shared/deprecated';
import type { SignOutOptions } from '@clerk/shared/types';
import { useClerk } from '../composables/useClerk';
import { assertSingleChild, normalizeWithDefaultValue } from '../utils';

interface SignOutButtonProps {
/**
* @deprecated Use the `redirectUrl` and `sessionId` props directly instead.
*/
signOutOptions?: SignOutOptions;
sessionId?: string;
redirectUrl?: string;
Expand All @@ -22,6 +26,10 @@ function getChildComponent() {
}

function clickHandler() {
if (props.signOutOptions) {
deprecated('SignOutButton `signOutOptions`', 'Use the `redirectUrl` and `sessionId` props directly instead.');
}
Comment on lines +29 to +31
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add test coverage for the new deprecation runtime path before merge.

This PR adds new behavior (warning emission when signOutOptions is passed), but no tests were added/updated to verify that path and backward compatibility behavior.

As per coding guidelines, "If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/vue/src/components/SignOutButton.vue` around lines 29 - 31, Add
tests for the new deprecation runtime path in SignOutButton.vue: write unit
tests that mount the SignOutButton component with props.signOutOptions provided
and assert that the deprecated('SignOutButton `signOutOptions`'...) function is
called (or that the expected warning/log is emitted), and also add a
backward-compatibility test that passing signOutOptions still results in the
same redirectUrl/sessionId behavior. Use the existing test utilities
(mount/shallowMount) and spy/mocking for the deprecated helper to observe calls,
and include both the warning emission assertion and a functional assertion that
behavior is unchanged.


const signOutOptions: SignOutOptions = {
redirectUrl: props.signOutOptions?.redirectUrl ?? props.redirectUrl,
sessionId: props.signOutOptions?.sessionId ?? props.sessionId,
Expand Down
Loading