Freeze Radix UI imports; only Box/Flex/Text allowed in new code#3427
Draft
adamleithp wants to merge 1 commit into
Draft
Freeze Radix UI imports; only Box/Flex/Text allowed in new code#3427adamleithp wants to merge 1 commit into
adamleithp wants to merge 1 commit into
Conversation
|
Merging to
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
b52d131 to
295b20a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Radix UI is legacy and being migrated to
@posthog/quill, but nothing stops new Radix usage from creeping in.A plain Biome
noRestrictedImportsrule can't express "old usage stays, new usage is banned": aterrorit 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 beyondBox,Flex, andTextfrom@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.CLAUDE.md → AGENTS.mdsymlinks inpackages/ui/src/features/{browser-tabs,canvas}.How did you test this?
main: passes.import { Dialog } from "@radix-ui/themes"orimport * as Tabs from "@radix-ui/react-tabs"to a file: fails with the offending file/import listed.Sliderinto an existing legacyimport { Button, Flex, Spinner, Text } from "@radix-ui/themes": fails onSlideronly; the pre-existing frozen imports in that file are not flagged.import type, re-exports, and dynamicimport().Automatic notifications
https://claude.ai/code/session_01MDJ4nfqaXqzioZtx5Ct3q4