Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 469
chore(vue,nuxt): Make initialState prop public and bump dependencies#6132
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
0514fb30a8f5eac540338be0fde04042360c068924feecc78fa41fb8b1c10b2bd3dff60ba011b25fa70aa0fd8fcFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@clerk/nuxt": patch | ||
| "@clerk/vue": patch | ||
| --- | ||
| Make `initialState` prop public and bump `@nuxt/kit` to 3.17.5 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,16 @@ | ||
| import { inBrowser } from '@clerk/shared/browser'; | ||
| import { deriveState } from '@clerk/shared/deriveState'; | ||
| import { loadClerkJsScript, type LoadClerkJsScriptOptions } from '@clerk/shared/loadClerkJsScript'; | ||
| import type { Clerk, ClientResource, MultiDomainAndOrProxy, Resources, Without } from '@clerk/types'; | ||
| import type { Clerk, ClientResource, InitialState, MultiDomainAndOrProxy, Resources, Without } from '@clerk/types'; | ||
| import type { Plugin } from 'vue'; | ||
| import { computed, ref, shallowRef, triggerRef } from 'vue'; | ||
| import { ClerkInjectionKey } from './keys'; | ||
| export type PluginOptions = Without<LoadClerkJsScriptOptions, 'domain' | 'proxyUrl'> & MultiDomainAndOrProxy; | ||
| export type PluginOptions = Without<LoadClerkJsScriptOptions, 'domain' | 'proxyUrl'> & | ||
| MultiDomainAndOrProxy & { | ||
| initialState?: InitialState; | ||
| }; | ||
Comment on lines
+10
to
+13
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion
constoptions={
...pluginOptions,sdkMetadata: pluginOptions.sdkMetadata||SDK_METADATA,}asLoadClerkJsScriptOptions;
A minimal, type-safe guard: -const options = {- ...pluginOptions,- sdkMetadata: pluginOptions.sdkMetadata || SDK_METADATA,-} as LoadClerkJsScriptOptions;+const { initialState, ...loadOptions } = pluginOptions;+const options: LoadClerkJsScriptOptions = {+ ...loadOptions,+ sdkMetadata: loadOptions.sdkMetadata || SDK_METADATA,+};Keeps runtime payload clean and removes the need for the 🤖 Prompt for AI Agents | ||
| const SDK_METADATA = { | ||
| name: PACKAGE_NAME, | ||
| @@ -35,7 +38,6 @@ const SDK_METADATA = { | ||
| */ | ||
| export const clerkPlugin: Plugin<[PluginOptions]> = { | ||
| install(app, pluginOptions) { | ||
| // @ts-expect-error: Internal property for SSR frameworks like Nuxt | ||
| const { initialState } = pluginOptions; | ||
| const loaded = shallowRef(false); | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
SessionAuthObjectis a new type introduced in machine authsee token types