Skip to content

fix(astro): Make user button menu items compiler-safe#8980

Open
wobsoriano wants to merge 2 commits into
mainfrom
rob/fix-astro-rust-compiler-error
Open

fix(astro): Make user button menu items compiler-safe#8980
wobsoriano wants to merge 2 commits into
mainfrom
rob/fix-astro-rust-compiler-error

Conversation

@wobsoriano

@wobsoriano wobsoriano commented Jun 24, 2026

Copy link
Copy Markdown
Member

Description

Fixes #8963

Cherry-picked from #8974, we decided not to ship Astro 7 support for now.

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:

Summary by CodeRabbit

  • Bug Fixes
    • Improved the user button menu so custom menu items render more reliably in Astro.
    • Prevented runtime errors when required page data or attributes aren’t available, making the experience more stable.

@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jun 24, 2026 6:58pm
swingset Ready Ready Preview, Comment Jun 24, 2026 6:58pm

Request Review

@changeset-bot

changeset-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1752f92

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

This PR includes changesets to release 1 package
Name Type
@clerk/astro 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

@github-actions github-actions Bot added the astro label Jun 24, 2026
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The Astro user button menu item renderer now guards access to window.__astro_clerk_component_props and data-clerk-id before updating custom menu items. A changeset entry records the patch release for @clerk/astro.

Changes

Astro user button menu item fix

Layer / File(s) Summary
Menu item guard and release note
packages/astro/src/astro-components/interactive/UserButton/MenuItemRenderer.astro, .changeset/fresh-astro-compiler.md
The menu item renderer now uses optional chaining for the user-button props lookup and only appends customMenuItems when both the component map and safeId are available; a patch changeset was added for @clerk/astro.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I hopped through Astro’s compiler glow,
and sniffed the data-clerk-id below.
With careful paws, the menu grew,
a patch-note carrot brought anew.
🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main fix for Astro user button menu items and the compiler-safety change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Jun 24, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@8980

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@8980

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@8980

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@8980

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@8980

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@8980

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@8980

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@8980

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@8980

@clerk/express

npm i https://pkg.pr.new/@clerk/express@8980

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@8980

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@8980

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@8980

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@8980

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@8980

@clerk/react

npm i https://pkg.pr.new/@clerk/react@8980

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@8980

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@8980

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@8980

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@8980

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@8980

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@8980

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@8980

commit: 1752f92

@github-actions

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-06-24T18:59:04.489Z

Summary

Metric Count
Packages analyzed 19
Packages with changes 0
🔴 Breaking changes 0
🟡 Non-breaking changes 0
🟢 Additions 0

No API Changes Detected

All packages have stable APIs with no detected changes.


Report generated by Break Check

Last ran on 1752f92.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In Astro 7, return statement causes failure

1 participant