Conversation
|
relates to #1570 |
|
View your CI Pipeline Execution ↗ for commit 4b32346
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview1 package(s) bumped directly, 12 bumped as dependents. 🟨 Minor bumps
🟩 Patch bumps
|
📝 WalkthroughWalkthroughThis PR adds reset listener support: it introduces Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2102 +/- ##
==========================================
- Coverage 90.35% 90.26% -0.09%
==========================================
Files 38 49 +11
Lines 1752 2045 +293
Branches 444 532 +88
==========================================
+ Hits 1583 1846 +263
- Misses 149 179 +30
Partials 20 20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
af9ed0c to
0d972d4
Compare
d028b99 to
59c6210
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
.changeset/reset-listeners.md (1)
5-5: Consider clarifying reset propagation semantics in the release note.A short note that
form.reset()does not invoke field-levelonReset(onlyfield.reset()does) would set clearer expectations for users upgrading.📝 Suggested wording
-Add `onReset` listener support for forms and fields, add `reset` method to `FieldApi`, and expand `ListenerCause` type with `'reset'` and `'unmount'` values +Add `onReset` listener support for forms and fields, add `reset` method to `FieldApi`, and expand `ListenerCause` type with `'reset'` and `'unmount'` values. Note: field-level `onReset` is triggered by `field.reset()`; `form.reset()` triggers only the form-level `onReset`.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.changeset/reset-listeners.md at line 5, The release note is unclear about reset propagation: explicitly state that calling form.reset() will not trigger field-level onReset listeners and that only calling field.reset() invokes those field-level onReset handlers; mention the added FieldApi.reset method and the new ListenerCause union values ('reset' and 'unmount') so readers know to update expectations and listener handling when upgrading.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/framework/react/guides/listeners.md`:
- Line 23: The docs add global `onReset` but the "Form listeners" section omits
it; update the Form listeners subsection to document `onReset` alongside
`onMount`/`onSubmit` and the propagated `onChange`/`onBlur`. Describe when
`onReset` fires (form reset events), its signature/params, whether it is
propagated to fields, and give a short usage example/notes consistent with
`onSubmit`/`onMount` entries so the global event list and form-level
documentation match.
In `@packages/form-core/src/FieldApi.ts`:
- Around line 11-14: Remove the unused imports getBy and setBy from the import
list in FieldApi.ts: locate the import that currently lists getBy,
getSyncValidatorArray, mergeOpts, setBy and delete getBy and setBy so only used
utilities (e.g., getSyncValidatorArray, mergeOpts) remain; ensure no other
references to getBy or setBy exist in the file before committing.
---
Nitpick comments:
In @.changeset/reset-listeners.md:
- Line 5: The release note is unclear about reset propagation: explicitly state
that calling form.reset() will not trigger field-level onReset listeners and
that only calling field.reset() invokes those field-level onReset handlers;
mention the added FieldApi.reset method and the new ListenerCause union values
('reset' and 'unmount') so readers know to update expectations and listener
handling when upgrading.
🪄 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: 6f949218-a373-4a2f-aab6-b1e7a6e0c763
📒 Files selected for processing (9)
.changeset/reset-listeners.mddocs/framework/angular/guides/listeners.mddocs/framework/react/guides/listeners.mddocs/framework/vue/guides/listeners.mdpackages/form-core/src/FieldApi.tspackages/form-core/src/FormApi.tspackages/form-core/src/types.tspackages/form-core/tests/FieldApi.spec.tspackages/form-core/tests/FormApi.spec.ts
3b60484 to
7108924
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/framework/react/guides/listeners.md`:
- Line 16: The header text "Field level events that can be "listened" to are:"
should use standard phrasing and a hyphenated adjective; update the phrase to
"Field-level events that can be listened to are:" by hyphenating "Field-level"
and removing the quotes around listened so the sentence reads naturally; locate
the string "Field level events that can be "listened" to are:" in the
listeners.md content and replace it accordingly.
🪄 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: a4fed69e-5a25-429f-a760-b27dc28c1881
📒 Files selected for processing (3)
.changeset/reset-listeners.mddocs/framework/react/guides/listeners.mdpackages/form-core/src/FieldApi.ts
✅ Files skipped from review due to trivial changes (1)
- .changeset/reset-listeners.md
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/form-core/src/FieldApi.ts
adds form listeners for the reset event
Summary by CodeRabbit
New Features
Documentation
Tests