Skip to content

refactor(icons): migrate icons from Flow to TypeScript - #4792

Open
bonchevskyi wants to merge 1 commit into
box:masterfrom
bonchevskyi:refactor/flow-to-ts-icons
Open

refactor(icons): migrate icons from Flow to TypeScript#4792
bonchevskyi wants to merge 1 commit into
box:masterfrom
bonchevskyi:refactor/flow-to-ts-icons

Conversation

@bonchevskyi

@bonchevskyi bonchevskyi commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Convert icons to TypeScript

This PR converts src/icons from JavaScript with Flow to TypeScript.

Changes

  • Converted flowTypes.js to flowTypes.ts with exported Icon and TwoTonedIcon interfaces
  • Created flowTypes.js.flow for backward compatibility
  • Removed leftover // @flow pragmas from IconShield and UsersEmptyState tests

Contract

  • Declared Flow props contract preserved (requiredness, accepted values, defaults, exports)

Testing

  • Ran tests for src/icons; all 1509 pass
  • yarn lint:ts and flow check pass

Summary by CodeRabbit

  • New Features

    • Added shared type definitions for standard and two-tone icons.
    • Supports optional sizing, styling, color, and accessibility title properties.
  • Tests

    • Updated icon test files to use the current type-checking setup without changing test coverage or behavior.

@bonchevskyi
bonchevskyi requested a review from a team as a code owner August 20, 2026 13:28
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e4908895-d132-4edf-a0f7-4560e491b398

📥 Commits

Reviewing files that changed from the base of the PR and between 7ae9297 and c1f9b96.

📒 Files selected for processing (4)
  • src/icons/flowTypes.js.flow
  • src/icons/flowTypes.ts
  • src/icons/general/__tests__/IconShield.test.tsx
  • src/icons/states/__tests__/UsersEmptyState.test.tsx
💤 Files with no reviewable changes (2)
  • src/icons/states/tests/UsersEmptyState.test.tsx
  • src/icons/general/tests/IconShield.test.tsx

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


Walkthrough

The change adds Icon and TwoTonedIcon declarations for TypeScript and Flow. It also removes obsolete Flow annotations from two icon test files.

Changes

Icon type declarations

Layer / File(s) Summary
Shared icon contracts
src/icons/flowTypes.ts, src/icons/flowTypes.js.flow, src/icons/general/__tests__/IconShield.test.tsx, src/icons/states/__tests__/UsersEmptyState.test.tsx
The TypeScript and Flow declarations define optional class names, colors, dimensions, and accessibility titles. The tests no longer include Flow file annotations.

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

Merge Risk: ⚪ Minimal · up to c1f9b

This PR makes a localized type-system migration for icons without introducing an actionable merge-blocking risk; it is merge-ready after normal checks and review.

Suggested reviewers: greg-in-a-box, jfox-box, jpan-box

Poem

A rabbit typed icons in rows,
With titles and colors and sizes that show.
Flow tags hopped away,
While TypeScript joined play,
And neat contracts now help them grow.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly states the migration scope, compatibility work, contract preservation, and completed testing.
Title check ✅ Passed The title clearly and concisely identifies the primary change: migrating icons from Flow to TypeScript.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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.

1 participant