refactor(text-input): migrate TextInput from Flow to TypeScript - #4760
Conversation
WalkthroughAdded typed ChangesTextInput migration
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/text-input/TextInput.tsx`:
- Line 99: Normalize the effective required value in the TextInput
implementations before spreading native props: remove required from rest, derive
one value with isRequired taking precedence, and reuse it for the label, ARIA
attributes, and input. Apply this in src/components/text-input/TextInput.tsx at
lines 99-99 and src/components/text-input/TextInput.js.flow at lines 96-96, then
add coverage for required without isRequired and conflicting values.
In `@src/components/text-input/TextInputField.tsx`:
- Around line 13-25: Update TextInputField in
src/components/text-input/TextInputField.tsx at lines 13-25 and
src/components/text-input/TextInputField.js.flow at lines 12-17 to destructure
and discard Formik meta before spreading rest into TextInputPrimitive. Add a
shallow-render test that supplies Formik meta and verifies the rendered input
does not receive it.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 0ac7c44d-ff72-4c93-a8bd-4a491c872c11
⛔ Files ignored due to path filters (2)
src/components/text-input/__tests__/__snapshots__/TextInput.test.tsx.snapis excluded by!**/*.snapsrc/components/text-input/__tests__/__snapshots__/TextInputField.test.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (10)
src/components/text-input/TextInput.js.flowsrc/components/text-input/TextInput.stories.tsxsrc/components/text-input/TextInput.tsxsrc/components/text-input/TextInputField.js.flowsrc/components/text-input/TextInputField.tsxsrc/components/text-input/__tests__/TextInput.test.tsxsrc/components/text-input/__tests__/TextInputField.test.tsxsrc/components/text-input/index.js.flowsrc/components/text-input/index.tssrc/components/time-input/TimeInput.tsx
💤 Files with no reviewable changes (1)
- src/components/text-input/TextInput.stories.tsx
Merge Queue Status
This pull request spent 41 minutes 3 seconds in the queue, with no time running CI. Waiting for any of
All conditions
ReasonThe merge conditions cannot be satisfied due to failing checks Failing checks: HintYou may have to fix your CI before adding the pull request to the queue again. Requeued — the merge queue status continues in this comment ↓. |
6abfc34 to
41a81eb
Compare
41a81eb to
7484549
Compare
Merge Queue Status
This pull request spent 1 minute 23 seconds in the queue, including 8 seconds running CI. Required conditions to merge
|
Convert TextInput component to TypeScript
This PR converts
src/components/text-inputfrom JavaScript with Flow to TypeScript.Changes
TextInput.jstoTextInput.tsxwith exportedTextInputPropsinterfaceTextInputField.jstoTextInputField.tsxwith exportedTextInputFieldPropsinterfaceindex.jstoindex.ts, re-exporting the components and their typesTextInput.stories.jstoTextInput.stories.tsx__tests__/TextInput.test.jsandTextInputField.test.jsto.test.tsx.js.flowfiles for backward compatibilityTimeInputto passerrorPosition(was incorrectly using undeclaredposition)Testing
src/components/text-input; all 23 pass with regenerated snapshots matching previous outputyarn lint:tsandflow checkpassSummary by CodeRabbit
New Features
Bug Fixes
Tests