Skip to content

Conversation

LekoArts
Copy link
Contributor

@LekoArts LekoArts commented Apr 11, 2025

Description

This PR adds a custom @unionReturnHeadings blockTag we can use on functions that return a union type.

For example, useSignIn gets this custom block tag:

/**
 * Desc
 *
 * @unionReturnHeadings
 * ["Initialization", "Loaded"]
 */
export const useSignIn = (): UseSignInReturn => {};

And the result will be:

## Returns

<Tabs items={['Initialization', 'Loaded']}>
<Tab>table goes here</Tab>
<Tab>table goes here</Tab>
</Tabs>

Also, for the "table goes here" part the description (third column) is copied from the first item to all other items inside the tabs.

Note for reviewers: Double check if the headings are appropriate for the different unions.

This PR also improves the output in some places by adjusting the theme. I've also added missing links to other resources.

Fixes ECO-596
Fixes ECO-597

Checklist

  • pnpm test runs as expected.
  • pnpm 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:

Copy link

changeset-bot bot commented Apr 11, 2025

🦋 Changeset detected

Latest commit: c6ccfdb

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

This PR includes changesets to release 22 packages
Name Type
@clerk/backend Patch
@clerk/nextjs Patch
@clerk/shared Patch
@clerk/clerk-react Patch
@clerk/types Patch
@clerk/vue Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/remix Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/chrome-extension Patch
@clerk/clerk-js Patch
@clerk/elements Patch
@clerk/expo-passkeys Patch
@clerk/clerk-expo Patch
@clerk/localizations 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

Copy link

vercel bot commented Apr 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 14, 2025 1:33pm

@LekoArts LekoArts changed the title chore(repo): Add @unionReturnHeadings Typedoc blockTag chore(repo): Add @unionReturnHeadings Typedoc blockTag Apr 11, 2025
@LekoArts LekoArts merged commit 196dcb4 into main Apr 14, 2025
32 checks passed
@LekoArts LekoArts deleted the lekoarts/eco-596-add-subheadings-to-tables-of-union-type-returns branch April 14, 2025 14:09
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.

3 participants