Skip to content

refactor(*): use 'Icon'-suffixed names for all phosphor imports - #1124

Merged
SeanCassiere merged 1 commit into
mainfrom
fix/phosphor-deprecated-subpath-imports
Aug 6, 2026
Merged

refactor(*): use 'Icon'-suffixed names for all phosphor imports#1124
SeanCassiere merged 1 commit into
mainfrom
fix/phosphor-deprecated-subpath-imports

Conversation

@sukvvon

@sukvvon sukvvon commented Aug 6, 2026

Copy link
Copy Markdown
Member

Every phosphor icon is now imported under its supported Icon-suffixed export. The bare names (Star, CaretDown, …) are deprecated by the package — each icon module carries @deprecated Use <Name>Icon on them.

Why these were not caught

#1094 renamed all icons to the Icon suffix, and #1099 added a generated declare module '@phosphor-icons/react' so that the deprecated spelling became a compile error rather than a strikethrough.

That declaration only covers the barrel. @phosphor-icons/react/CaretDown is a separate module, so subpath imports resolve against the package's own types and the deprecated names are merely struck through again. When #1099 was written, src/ had no subpath imports at all — the barrel was the only entry point, so locking it was sufficient. Subpath imports were introduced later, which opened a second path the guard does not cover.

The guard is unchanged here; this PR only fixes the call sites. Extending it to subpaths is a separate change.

Changes

100 imports across 24 files, in three shapes:

Shape Count Result
{ Name as NameIcon } 92 { NameIcon } — local binding is identical, so no usage sites change
{ Name as CustomName } 3 { NameIcon as CustomName } — the alias is kept, only the imported name moves
{ Name } 5 { NameIcon } — no alias, so the JSX usages are renamed too

The three custom aliases are all in Navbar: List as Menu, Sparkle as Sparkles, and TrendUp as TrendingUp.

NavbarAuthControls imported the same module twice as { SignIn, SignIn as SignInIcon }, with both bindings in use; they are collapsed to SignInIcon.

ds/ui/index.tsx was internally inconsistent — CaretDownIcon, CircleNotchIcon, and UserIcon were already suffixed while MagnifyingGlass and X were not.

Verification

tsc, lint, and the unit tests pass.

No deprecated phosphor name remains in the repo. This was checked across barrel imports, subpath imports, multi-line import blocks, namespace and default imports, and dynamic import(). The generated registry and module declaration are untouched — regenerating them produces no diff.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The change replaces legacy Phosphor icon aliases with explicit *Icon exports across library mappings, navigation, UI, landing, and markdown components. Existing icon mappings, rendering, and behavior remain unchanged.

Changes

Phosphor icon export migration

Layer / File(s) Summary
Library icon mappings
src/libraries/icons.ts
Library icon imports now use explicit *Icon exports. Existing mappings and fallback behavior remain unchanged.
Application navigation and library UI
src/components/Libraries*.tsx, src/components/Library*.tsx, src/components/Navbar*.tsx, src/components/SearchButton.tsx, src/components/Select.tsx, src/components/ThemeToggle.tsx, src/components/VersionSelect.tsx, src/components/NotFound.tsx, src/components/*SponsorsSection.tsx, src/components/LoginModal.tsx, src/components/MegaMenuItem.tsx, src/components/Spinner.tsx
Application components now import and render explicit Phosphor icon exports.
Design system and content UI
src/components/ds/ui/index.tsx, src/components/landing/*, src/components/markdown/CodeBlockView.tsx
Search controls, landing components, and markdown code blocks now use explicit Phosphor icon exports.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: tannerlinsley

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the refactor to use Icon-suffixed Phosphor import names across the codebase.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/phosphor-deprecated-subpath-imports

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

Comment @coderabbitai help to get the list of available commands.

@sukvvon
sukvvon marked this pull request as ready for review August 6, 2026 10:38
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tanstack-com c92aa8d Commit Preview URL

Branch Preview URL
Aug 06 2026, 10:38 AM

@sukvvon sukvvon self-assigned this Aug 6, 2026
@sukvvon
sukvvon requested a review from a team August 6, 2026 10:44
@SeanCassiere
SeanCassiere merged commit 1154dd2 into main Aug 6, 2026
7 checks passed
@SeanCassiere
SeanCassiere deleted the fix/phosphor-deprecated-subpath-imports branch August 6, 2026 21:58
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