refactor(*): drop phosphor icon import aliases - #1126
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (17)
📝 WalkthroughWalkthroughThis change replaces aliased Phosphor icon imports and JSX references with canonical component names across shared components, npm statistics components, and routes. Component behavior and public APIs remain unchanged. ChangesIcon name normalization
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
tanstack-com | 5231b63 | Commit Preview URL Branch Preview URL |
Aug 07 2026, 12:50 AM |
Imports every phosphor icon under its own name. 53 aliases across 17 files are gone, leaving zero in the repo.
Most of them preserved lucide's naming from before that migration —
CaretDownIcon as ChevronDown,LightningIcon as Zap,TrashIcon as Trash2,ArrowsClockwiseIcon as RefreshCw. The practical cost was that the same icon went by different names depending on the file:MagnifyingGlassIconwasSearchin one place andSearchIconin another,StackIconwasLayershere andLayers3there,CaretDownIconwasCaretDownorChevronDownor itself.Two extras in
ChartControlsChartBarIconwas imported twice — once plainly and once asChartBarStacked— sobarandstacked-barlooked like different icons inchartTypeIconswhen they are the same one. The duplicate import is removed and both entries now nameChartBarIcondirectly, which makes the shared icon visible rather than disguised.type Icon as LucideIconis nowtype Icon. The alias was a leftover name from a library that is no longer a dependency. It reads as though lucide were still around, and it is not needed for disambiguation: theconst Iconfurther down the file is a value in a block scope, while this is a type at module scope, so the two never collide.Renaming was done via the TypeScript compiler API
A regex pass over the source text is not safe for this. Icon names like
Copy,Menu, andCheckalso occur inside strings and JSX text, and a word-boundary replacement rewrites those too — a first attempt turnedaria-label={mobileMenuOpen ? 'Close Menu' : 'Open Menu'}into'Close ListIcon'andaria-label={`Copy ${label} to clipboard`}into`CopyIcon ${label} to clipboard`, both silently and withtscstill clean.The codemod instead walks the AST and edits only
Identifiernodes, which by construction never cover string literals, JSX text, or comments.Verification
tsc, lint, and the unit tests pass.Every string literal of four characters or more was compared before and after, per changed file: all identical. No phosphor alias remains anywhere in
src/.Rendering was not exercised in the browser. The icon components themselves are unchanged — only the local binding names differ — and
tsccovers every rename.Summary by CodeRabbit