fix: remove errant Field.Field usage#2149
Conversation
📝 WalkthroughWalkthroughThe PR simplifies the ChangesuseField Hook API Simplification
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 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 |
|
View your CI Pipeline Execution ↗ for commit 426097e
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@packages/react-form/src/useField.tsx`:
- Line 275: The PR removed the ReactFieldApi augmentation and the
extendedApi.Field assignment which breaks consumers using field.Field (e.g., in
<form.Field>{(field) => <field.Field .../>}</form.Field>); update the release
notes and migration guide and ensure the commit includes a Conventional Commits
breaking change marker (either use fix!: or add a BREAKING CHANGE: footer) that
explains the removal, cites the affected symbols (ReactFieldApi,
extendedApi.Field, field.Field), and documents the recommended replacements (use
the outer form.Field or call useField directly) with a short example and any
migration steps.
🪄 Autofix (Beta)
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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 25919c7d-28c0-465a-abc8-bcd99ea17f73
📒 Files selected for processing (1)
packages/react-form/src/useField.tsx
| > = reactiveFieldApi as never | ||
|
|
||
| extendedApi.Field = Field as never | ||
| > = reactiveFieldApi as never |
There was a problem hiding this comment.
Document the breaking removal of field.Field in release notes / migration guide.
Dropping the ReactFieldApi augmentation and the extendedApi.Field = … assignment is a public-API breaking change: any consumer using <form.Field>{(field) => <field.Field …/>}</form.Field> will now see a runtime TypeError: field.Field is not a function (and a TS error). The PR title is fix:, but per Conventional Commits this should be surfaced as a breaking change (e.g. fix!: or a BREAKING CHANGE: footer) so the changeset/semver bump and migration notes are generated correctly. Worth calling out the recommended replacement (use the outer form.Field or useField directly) in the changelog.
🤖 Prompt for 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.
In `@packages/react-form/src/useField.tsx` at line 275, The PR removed the
ReactFieldApi augmentation and the extendedApi.Field assignment which breaks
consumers using field.Field (e.g., in <form.Field>{(field) => <field.Field
.../>}</form.Field>); update the release notes and migration guide and ensure
the commit includes a Conventional Commits breaking change marker (either use
fix!: or add a BREAKING CHANGE: footer) that explains the removal, cites the
affected symbols (ReactFieldApi, extendedApi.Field, field.Field), and documents
the recommended replacements (use the outer form.Field or call useField
directly) with a short example and any migration steps.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2149 +/- ##
===========================================
- Coverage 90.35% 56.85% -33.50%
===========================================
Files 38 18 -20
Lines 1752 248 -1504
Branches 444 47 -397
===========================================
- Hits 1583 141 -1442
+ Misses 149 92 -57
+ Partials 20 15 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This PR removes the ability to do:
Which I think was errantly added, as I can't think of any reliable reason why we'd want to support this.
Summary by CodeRabbit
useFieldhook's public API has been simplified. The Field sub-component is no longer exposed on the returned value. Users will need to update code that relied on accessing Field through the hook's return object.