Skip to content

chore: bump#22

Merged
coji merged 1 commit intomainfrom
chore/bump
Jun 13, 2025
Merged

chore: bump#22
coji merged 1 commit intomainfrom
chore/bump

Conversation

@coji
Copy link
Owner

@coji coji commented Jun 13, 2025

This pull request refactors the imports for Radix UI components across multiple files to use the new radix-ui package instead of individual @radix-ui/react-* packages. Additionally, it updates the package.json file to remove the old Radix UI dependencies, add the new radix-ui package, and introduce a new script for formatting code.

Refactoring Radix UI imports:

  • Updated imports in app/components/ui/alert-dialog.tsx to use AlertDialog from radix-ui instead of @radix-ui/react-alert-dialog.
  • Updated imports in app/components/ui/avatar.tsx to use Avatar from radix-ui instead of @radix-ui/react-avatar.
  • Updated imports in app/components/ui/button.tsx to use Slot from radix-ui instead of @radix-ui/react-slot, and updated references to Slot and Slottable in the Button component. [1] [2] [3]
  • Updated imports in app/components/ui/dialog.tsx, app/components/ui/dropdown-menu.tsx, app/components/ui/label.tsx, and app/components/ui/tabs.tsx to use their respective components from radix-ui. [1] [2] [3] [4]

Updates to package.json:

  • Removed individual @radix-ui/react-* dependencies and added the new radix-ui package. [1] [2]
  • Added a new script format:fix for applying Prettier formatting fixes.

Summary by CodeRabbit

  • Chores
    • Updated Radix UI component imports to use the unified 'radix-ui' package across various UI components.
    • Removed individual Radix UI package dependencies and added the consolidated 'radix-ui' dependency.
    • Added a new script for automatic code formatting with Prettier.

@coderabbitai
Copy link

coderabbitai bot commented Jun 13, 2025

Walkthrough

The changes update multiple UI component files to import Radix UI primitives from the new unified radix-ui package instead of individual @radix-ui/react-* packages. The corresponding package dependencies are updated in package.json, removing the old packages and adding the new one. A new formatting script is also introduced.

Changes

Files/Groups Change Summary
app/components/ui/alert-dialog.tsx,
.../avatar.tsx,
.../dialog.tsx,
.../dropdown-menu.tsx,
.../label.tsx,
.../tabs.tsx
Updated imports to use named exports from the new radix-ui package instead of individual @radix-ui/react-* packages.
app/components/ui/button.tsx Changed slot component imports and usage to reference Slot and Slottable from radix-ui with updated aliases.
package.json Removed several @radix-ui/react-* dependencies, added radix-ui, and introduced a format:fix script for Prettier.

Poem

A hop, a skip, a package swap,
Radix UI gets a single stop!
Imports tidied, scripts anew,
Formatting magic—code fresh as dew.
The garden’s neat, the carrots aligned,
Radix unified, with changes combined!
🥕✨

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link

Visit the preview URL for this PR (updated for commit 6637281):

https://remix-spa-example--pr22-chore-bump-xt4styvy.web.app

(expires Fri, 20 Jun 2025 07:46:51 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 48e666b485811f0b1bcd4fa4838b32a205a3ce05

@coji coji merged commit e37aab6 into main Jun 13, 2025
2 checks passed
@coji coji deleted the chore/bump branch June 13, 2025 07:47
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
package.json (1)

12-12: --cache + -w can leave files half-formatted

prettier --cache -w . rewrites only the files already in the cache.
If someone adds new files or blows the cache, formatting drift might sneak in.
Dropping --cache (or keeping it on the read-only format script only) gives more predictable results.

-    "format:fix": "prettier --cache -w .",
+    "format:fix": "prettier -w .",
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cc626ac and 6637281.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • app/components/ui/alert-dialog.tsx (1 hunks)
  • app/components/ui/avatar.tsx (1 hunks)
  • app/components/ui/button.tsx (3 hunks)
  • app/components/ui/dialog.tsx (1 hunks)
  • app/components/ui/dropdown-menu.tsx (1 hunks)
  • app/components/ui/label.tsx (1 hunks)
  • app/components/ui/tabs.tsx (1 hunks)
  • package.json (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Deploy Preview
  • GitHub Check: build_and_preview
🔇 Additional comments (8)
app/components/ui/avatar.tsx (1)

1-1: Import migration looks good

The new radix-ui namespace exports an Avatar object with .Root/.Image/.Fallback;
the alias + type-safe generics compile cleanly.

app/components/ui/alert-dialog.tsx (1)

1-1: Consistent primitive aliasing – nice

Straightforward switch to the monorepo import; no behavioural change. ✅

app/components/ui/label.tsx (1)

1-1: LGTM

Label primitives migrated correctly; nothing else touched.

app/components/ui/tabs.tsx (1)

1-1: Tabs import updated correctly

No further issues spotted.

app/components/ui/dialog.tsx (1)

2-2: Verify that radix-ui actually re-exports the Dialog primitive in the expected shape

DialogPrimitive.Root, DialogPrimitive.Trigger, … are consumed throughout this file. Please make sure the new radix-ui package ships a Dialog export that exposes the exact same sub-components; otherwise this will be a run-time undefined-property failure that TypeScript will not catch in JS/TSX emit-only mode.

app/components/ui/dropdown-menu.tsx (1)

2-2: Same diligence needed for the DropdownMenu export

If radix-ui does not provide DropdownMenu.Root/.Item/… the render path will break silently. Please confirm the new bundle’s API surface or pin an exact version known to include it.

app/components/ui/button.tsx (2)

2-2: Confirm Slot export parity in the new package

The code relies on the Slot primitive exposing both .Slot and .Slottable properties. Double-check that radix-ui keeps this contract; a mismatch will manifest as undefined is not a function at run-time.


65-65: Follow-up: keep an eye on .Slottable

SlotPrimitive.Slottable still assumes the property exists. After fixing the line above, verify this property is exported; if not, replace it with a fragment (<>) or remove the wrapper altogether.

Comment on lines +43 to 45
"zodix": "^0.4.4",
"radix-ui": "latest"
},
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Pin radix-ui instead of using latest

Unpinned versions make reproducible builds impossible and silently pull breaking
changes. Radix v2 is already out – pin to the exact major you intend to stay on
and rely on Renovate/Dependabot for upgrades.

-    "radix-ui": "latest"
+    "radix-ui": "^2.0.1"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"zodix": "^0.4.4",
"radix-ui": "latest"
},
"zodix": "^0.4.4",
"radix-ui": "^2.0.1"
},
🤖 Prompt for AI Agents
In package.json around lines 43 to 45, the dependency "radix-ui" is set to
"latest", which prevents reproducible builds and risks pulling breaking changes.
Replace "latest" with a specific version number pinned to the major version you
want to use, for example, "^1.0.0" or the exact version you have tested. Use
Renovate or Dependabot to manage future upgrades safely.

Comment on lines 18 to 22
"@conform-to/react": "^1.5.0",
"@conform-to/zod": "^1.5.0",
"@radix-ui/react-alert-dialog": "^1.1.13",
"@radix-ui/react-avatar": "^1.1.9",
"@radix-ui/react-dialog": "^1.1.13",
"@radix-ui/react-dropdown-menu": "^2.1.14",
"@radix-ui/react-label": "^2.1.6",
"@radix-ui/react-slot": "^1.2.2",
"@radix-ui/react-tabs": "^1.1.11",
"@radix-ui/react-toast": "^1.2.13",
"@react-router/node": "7.6.0",
"@tailwindcss/vite": "^4.1.6",
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Left-over scoped Radix package creates duplicate bundles

Only toast keeps the old scoped namespace:

"@radix-ui/react-toast": "^1.2.13",

If the new monorepo also exports Toast, you’ll ship two copies of Radix.
Verify usage and migrate or mark why toast is special.


🏁 Script executed:

#!/bin/bash
# Find every import that still references the old scoped packages
rg --no-heading -n "@radix-ui/react-" | head

Length of output: 615


Remove unused @radix-ui/react-toast dependency

We ran rg --no-heading -n "@radix-ui/react-" and found no imports of @radix-ui/react-toast in the codebase (only in package.json and pnpm-lock.yaml). This suggests it’s no longer used and can be removed to avoid shipping unnecessary bundles.

• package.json, line 20: remove
"@radix-ui/react-toast": "^1.2.13",

If you have a future need for Radix Toast, re-add it then or document why this package remains special.

🤖 Prompt for AI Agents
In package.json around lines 18 to 22, the dependency "@radix-ui/react-toast" is
no longer used anywhere in the codebase, causing unnecessary bundle duplication.
Remove the line containing "@radix-ui/react-toast": "^1.2.13" from the
dependencies to avoid shipping unused code. If Radix Toast is needed later, you
can re-add it with proper justification.

isLoading?: boolean
}) {
const Comp = asChild ? Slot : 'button'
const Comp = asChild ? SlotPrimitive.Slot : 'button'
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Run-time bug – .Slot property is very likely undefined

SlotPrimitive is already the component you want to render. Dereferencing .Slot adds an extra level that does not exist in the original API and will crash:

-  const Comp = asChild ? SlotPrimitive.Slot : 'button'
+  const Comp = asChild ? SlotPrimitive : 'button'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const Comp = asChild ? SlotPrimitive.Slot : 'button'
const Comp = asChild ? SlotPrimitive : 'button'
🤖 Prompt for AI Agents
In app/components/ui/button.tsx at line 54, the code incorrectly accesses
SlotPrimitive.Slot, but SlotPrimitive itself is the component to use. Remove the
.Slot dereference and assign Comp directly to SlotPrimitive when asChild is true
to prevent runtime errors.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant