chore(shared,types,clerk-react,vue): Share hook return types - #4583
Conversation
🦋 Changeset detectedLatest commit: fca77a3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 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 |
|
In same cases we might need to only edit only types for react and not vue. For example, adding experimental features, which usually are only implemented for the react hooks. Do you think this PR will make that process harder ? If not this move is reasonable. |
Good question! I think we have 2 approaches in case of experimental features:
export type UseSessionListReturn =
| {
isLoaded: false;
sessions: undefined;
setActive: undefined;
__experimental_test: undefined
}
| {
isLoaded: true;
sessions: SessionResource[];
setActive: SetActive;
__experimental_test: true
};We can keep this in import type { Without } from '@clerk/types'
type type VueUseSessionListReturn = Without<UseSessionListReturn, '__experimental'>The only problem I can see with this is that
What do you think? |
|
Probably i'd just expands the types for react only |
sounds good to me |
Description
This PR moves the hook return types from
@clerk/clerk-reactand@clerk/sharedto@clerk/typesto be used with@clerk/vue's composables.See PR comment for reference.
Note: The
useOrganization()anduseOrganizationList()hook return types are not included since pagination is not yet implemented in@clerk/vue.Resolves ECO-231
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change