Skip to content

Freeze Radix UI imports; only Box/Flex/Text allowed in new code#3427

Draft
adamleithp wants to merge 1 commit into
mainfrom
claude/radix-component-restrictions-zfv5g2
Draft

Freeze Radix UI imports; only Box/Flex/Text allowed in new code#3427
adamleithp wants to merge 1 commit into
mainfrom
claude/radix-component-restrictions-zfv5g2

Conversation

@adamleithp

@adamleithp adamleithp commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Problem

Radix UI is legacy and being migrated to @posthog/quill, but nothing stops new Radix usage from creeping in.

A plain Biome noRestrictedImports rule can't express "old usage stays, new usage is banned": at error it fails the 276 files with existing Radix imports, and grandfathering them would mean hundreds of suppression comments or a huge baseline file.

Changes

  • scripts/check-radix-imports.mjs (pnpm radix): a small diff-based check. For each file changed relative to the PR base, it compares the file's Radix imports against the base version and fails on anything added beyond Box, Flex, and Text from @radix-ui/themes (every other @radix-ui/* package is fully frozen). Existing imports are untouched until migrated — no allowlist or baseline file needed.
  • .github/workflows/code-quality.yml: runs the check against the PR base commit.
  • AGENTS.md: short "Radix Freeze" section, a Forbidden Patterns bullet, and the Key Libraries line updated to mark Radix Themes as legacy.
  • Added missing CLAUDE.md → AGENTS.md symlinks in packages/ui/src/features/{browser-tabs,canvas}.

How did you test this?

  • Clean branch vs main: passes.
  • Appending import { Dialog } from "@radix-ui/themes" or import * as Tabs from "@radix-ui/react-tabs" to a file: fails with the offending file/import listed.
  • Adding Slider into an existing legacy import { Button, Flex, Spinner, Text } from "@radix-ui/themes": fails on Slider only; the pre-existing frozen imports in that file are not flagged.
  • Handles named/default/namespace/star imports, import type, re-exports, and dynamic import().

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

https://claude.ai/code/session_01MDJ4nfqaXqzioZtx5Ct3q4

@trunk-io

trunk-io Bot commented Jul 14, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

…quill

Add scripts/check-radix-imports.mjs (pnpm radix), run in the
code-quality workflow: it diffs each changed file's Radix imports
against the PR base, so any import added beyond Box, Flex, and Text
from @radix-ui/themes — including any other @radix-ui/* package —
fails CI. Existing imports stay untouched until migrated; no baseline
file needed.

Document the freeze in AGENTS.md and add the missing
CLAUDE.md -> AGENTS.md symlinks in browser-tabs and canvas.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MDJ4nfqaXqzioZtx5Ct3q4
@adamleithp adamleithp force-pushed the claude/radix-component-restrictions-zfv5g2 branch from b52d131 to 295b20a Compare July 14, 2026 13:40
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.

2 participants