Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/components/ui/alert-dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog'
import { AlertDialog as AlertDialogPrimitive } from 'radix-ui'
import type * as React from 'react'

import { buttonVariants } from '~/components/ui/button'
Expand Down
2 changes: 1 addition & 1 deletion app/components/ui/avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as AvatarPrimitive from '@radix-ui/react-avatar'
import { Avatar as AvatarPrimitive } from 'radix-ui'
import type * as React from 'react'

import { cn } from '~/libs/utils'
Expand Down
6 changes: 3 additions & 3 deletions app/components/ui/button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Slot, Slottable } from '@radix-ui/react-slot'
import { cva, type VariantProps } from 'class-variance-authority'
import { Slot as SlotPrimitive } from 'radix-ui'
import type * as React from 'react'

import { cn } from '~/libs/utils'
Expand Down Expand Up @@ -51,7 +51,7 @@ function Button({
asChild?: boolean
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.


return (
<Comp
Expand All @@ -62,7 +62,7 @@ function Button({
{isLoading && (
<span className="border-background mr-2 h-4 w-4 animate-spin rounded-full border-2 border-t-transparent" />
)}
<Slottable>{children}</Slottable>
<SlotPrimitive.Slottable>{children}</SlotPrimitive.Slottable>
</Comp>
)
}
Expand Down
2 changes: 1 addition & 1 deletion app/components/ui/dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as DialogPrimitive from '@radix-ui/react-dialog'
import { XIcon } from 'lucide-react'
import { Dialog as DialogPrimitive } from 'radix-ui'
import type * as React from 'react'

import { cn } from '~/libs/utils'
Expand Down
2 changes: 1 addition & 1 deletion app/components/ui/dropdown-menu.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'
import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react'
import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui'
import type * as React from 'react'

import { cn } from '~/libs/utils'
Expand Down
2 changes: 1 addition & 1 deletion app/components/ui/label.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as LabelPrimitive from '@radix-ui/react-label'
import { Label as LabelPrimitive } from 'radix-ui'
import type * as React from 'react'

import { cn } from '~/libs/utils'
Expand Down
2 changes: 1 addition & 1 deletion app/components/ui/tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as TabsPrimitive from '@radix-ui/react-tabs'
import { Tabs as TabsPrimitive } from 'radix-ui'
import type * as React from 'react'

import { cn } from '~/libs/utils'
Expand Down
11 changes: 3 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,14 @@
"preview": "vite preview",
"lint": "biome lint .",
"format": "prettier --cache -c .",
"format:fix": "prettier --cache -w .",
"typecheck": "react-router typegen && tsc",
"validate": "pnpm run lint && pnpm run format && pnpm run typecheck",
"start": "npx sirv-cli build/client/ --single"
},
"dependencies": {
"@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",
Comment on lines 18 to 22
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.

Expand All @@ -46,7 +40,8 @@
"tailwind-merge": "^3.3.0",
"tailwindcss-animate": "^1.0.7",
"zod": "^3.24.4",
"zodix": "^0.4.4"
"zodix": "^0.4.4",
"radix-ui": "latest"
},
Comment on lines +43 to 45
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.

"devDependencies": {
"@biomejs/biome": "^1.9.4",
Expand Down
Loading