[refactor!]: remove all deprecations from previous releases#74
[refactor!]: remove all deprecations from previous releases#74
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughMajor release removing deprecated APIs and Mobx-prefixed aliases: Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/mutation.ts (1)
169-170: Mirror the query-side coverage with a mutation regression test.This constructor change removes the last
resetOnDisposefallback for mutations, but the diff only updates lifecycle callsites in tests. Please add one test that confirmsresetOnDestroystill applies andresetOnDisposeno longer does, so the breaking behavior is locked in.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/mutation.ts` around lines 169 - 170, The mutation constructor change removed the last resetOnDispose fallback but tests only updated callsites; add a regression test that mirrors the query-side test coverage: create a mutation instance (using the same factory/setup as other tests) with qc.mutationFeatures.resetOnDispose set and config.resetOnDestroy undefined, then assert that resetOnDestroy governs behavior (i.e., the mutation resets on destroy) and that resetOnDispose no longer triggers; reference the constructor/config keys resetOnDestroy, resetOnDispose and qc.mutationFeatures so the test targets the code path changed by the constructor.src/base-query.ts (1)
121-121: Add a regression test for the removedresetOnDisposepath.Line 121 is the query-side behavioral change in this PR, but the diff doesn’t add coverage proving that
resetOnDestroystill works while the deprecatedresetOnDisposefallback is now ignored. A focused test here would keep this breaking change from being reintroduced accidentally.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/base-query.ts` at line 121, Add a regression test that verifies the query uses config.resetOnDestroy and ignores the deprecated resetOnDispose fallback: write a unit test targeting the BaseQuery behavior (or the constructor/factory that sets resetOnDestroy) to assert that when config.resetOnDestroy is provided it is honored, and when only resetOnDispose is provided the query does NOT fall back to it; also include a case where both are present to ensure resetOnDestroy takes precedence. Use the same creation helper invoked in code paths that touch resetOnDestroy (the code that sets resetOnDestroy: config.resetOnDestroy ?? qf?.resetOnDestroy) so the test fails if the deprecated fallback is accidentally reintroduced.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/base-query.ts`:
- Line 121: Add a regression test that verifies the query uses
config.resetOnDestroy and ignores the deprecated resetOnDispose fallback: write
a unit test targeting the BaseQuery behavior (or the constructor/factory that
sets resetOnDestroy) to assert that when config.resetOnDestroy is provided it is
honored, and when only resetOnDispose is provided the query does NOT fall back
to it; also include a case where both are present to ensure resetOnDestroy takes
precedence. Use the same creation helper invoked in code paths that touch
resetOnDestroy (the code that sets resetOnDestroy: config.resetOnDestroy ??
qf?.resetOnDestroy) so the test fails if the deprecated fallback is accidentally
reintroduced.
In `@src/mutation.ts`:
- Around line 169-170: The mutation constructor change removed the last
resetOnDispose fallback but tests only updated callsites; add a regression test
that mirrors the query-side test coverage: create a mutation instance (using the
same factory/setup as other tests) with qc.mutationFeatures.resetOnDispose set
and config.resetOnDestroy undefined, then assert that resetOnDestroy governs
behavior (i.e., the mutation resets on destroy) and that resetOnDispose no
longer triggers; reference the constructor/config keys resetOnDestroy,
resetOnDispose and qc.mutationFeatures so the test targets the code path changed
by the constructor.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 14cd239f-3aa9-4246-a654-14c42ed3727e
📒 Files selected for processing (15)
.changeset/huge-ties-turn.mdsrc/base-query.tssrc/infinite-query.test.tssrc/inifinite-query.tssrc/inifinite-query.types.tssrc/mutation.test.tssrc/mutation.tssrc/mutation.types.tssrc/preset/create-query.test.tssrc/query-client.tssrc/query-client.types.tssrc/query.test.tssrc/query.tssrc/query.types.tssrc/utils/destroyable.ts
💤 Files with no reviewable changes (8)
- src/query-client.ts
- src/inifinite-query.ts
- src/utils/destroyable.ts
- src/query.ts
- src/query-client.types.ts
- src/inifinite-query.types.ts
- src/mutation.types.ts
- src/query.types.ts
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 `@src/query.test.ts`:
- Around line 4319-4420: Add tests covering the fallback branch where
BaseQuery.mergeQueryFeatures reads queryClient.queryFeatures: create a
MobxQueryClient with queryFeatures set (e.g., { resetOnDestroy: true } and {
resetOnDestroy: false } and a case with only resetOnDispose) and call
makeRegressionQuery without passing reset flags in the Query config so the merge
uses queryClient.queryFeatures; assert behavior matches the existing
expectations (reset when resetOnDestroy true, no reset when false, and ignore
client-level resetOnDispose alias). Reference BaseQuery.mergeQueryFeatures,
Query (constructor), MobxQueryClient, and the resetOnDestroy/resetOnDispose
flags when adding these cases.
🪄 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: e8d33546-f71a-4f39-a3f8-b3e0c3db3418
📒 Files selected for processing (3)
src/mutation.test.tssrc/mutation.tssrc/query.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/mutation.test.ts
Summary by CodeRabbit
Breaking Changes
Tests
Chores