Skip to content

[refactor!]: remove all deprecations from previous releases#74

Open
js2me wants to merge 3 commits intomasterfrom
refactor/remove-deprecatations
Open

[refactor!]: remove all deprecations from previous releases#74
js2me wants to merge 3 commits intomasterfrom
refactor/remove-deprecatations

Conversation

@js2me
Copy link
Copy Markdown
Owner

@js2me js2me commented Apr 9, 2026

Summary by CodeRabbit

  • Breaking Changes

    • Removed deprecated dispose() API — use destroy() or Symbol.dispose instead
    • Removed Mobx*-prefixed type and class aliases; import canonical names directly
    • Removed deprecated query-client type aliases (e.g., IQueryClient, QueryClientInterface)
    • Removed resetOnDispose across features; use resetOnDestroy only
  • Tests

    • Updated tests and mocks to use destroy() and added regressions validating resetOnDestroy behavior
  • Chores

    • Added changeset for a major version bump

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 780b56b8-a2a5-435b-a13b-5b158cf8c1a7

📥 Commits

Reviewing files that changed from the base of the PR and between 1d429b9 and 9d6de94.

📒 Files selected for processing (1)
  • src/query.test.ts

📝 Walkthrough

Walkthrough

Major release removing deprecated APIs and Mobx-prefixed aliases: Destroyable.dispose() and Mobx* classes/types are deleted; resetOnDispose removed in favor of resetOnDestroy; tests and feature-resolution updated to use destroy()/resetOnDestroy.

Changes

Cohort / File(s) Summary
Changeset Documentation
/.changeset/huge-ties-turn.md
Adds a changeset documenting a major release and enumerating breaking changes.
Base Destruction API
src/utils/destroyable.ts
Removed deprecated dispose() method; retained destroy() and [Symbol.dispose]() implementations.
Feature Resolution Logic
src/base-query.ts
Merge logic now resolves resetOnDestroy only from config.resetOnDestroy or qf?.resetOnDestroy, dropping any resetOnDispose fallbacks.
Query Lifecycle & Types
src/query.ts, src/query.types.ts
Removed deprecated MobxQuery export and numerous Mobx* type aliases; removed resetOnDispose from QueryFeatures.
Mutation Lifecycle & Types
src/mutation.ts, src/mutation.types.ts
Removed deprecated MobxMutation export and Mobx* type aliases; removed resetOnDispose from mutation features; handleDestroy() now calls reset() then updateResult(...) when enabled.
Infinite Query Types
src/inifinite-query.ts, src/inifinite-query.types.ts
Removed deprecated MobxInfiniteQuery export and multiple Mobx* type aliases.
Query Client Types
src/query-client.ts, src/query-client.types.ts
Removed deprecated MobxQueryClient export and several Mobx* / query-client type aliases.
Tests & Mocks
src/query.test.ts, src/mutation.test.ts, src/infinite-query.test.ts, src/preset/create-query.test.ts
Replaced dispose() spies/calls with destroy() in mocks and tests; added regression tests for resetOnDestroy vs deprecated resetOnDispose precedence.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 I nibbled old dispose away,

hopped to destroy at break of day,
Mobx aliases fell like dew,
resetOnDestroy sees us through,
A tidy burrow, fresh and true. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective of the pull request: removing all deprecated APIs from previous releases as a breaking change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/remove-deprecatations

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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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 resetOnDispose fallback for mutations, but the diff only updates lifecycle callsites in tests. Please add one test that confirms resetOnDestroy still applies and resetOnDispose no 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 removed resetOnDispose path.

Line 121 is the query-side behavioral change in this PR, but the diff doesn’t add coverage proving that resetOnDestroy still works while the deprecated resetOnDispose fallback 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

📥 Commits

Reviewing files that changed from the base of the PR and between b03ca17 and ed887bd.

📒 Files selected for processing (15)
  • .changeset/huge-ties-turn.md
  • src/base-query.ts
  • src/infinite-query.test.ts
  • src/inifinite-query.ts
  • src/inifinite-query.types.ts
  • src/mutation.test.ts
  • src/mutation.ts
  • src/mutation.types.ts
  • src/preset/create-query.test.ts
  • src/query-client.ts
  • src/query-client.types.ts
  • src/query.test.ts
  • src/query.ts
  • src/query.types.ts
  • src/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

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between ed887bd and 1d429b9.

📒 Files selected for processing (3)
  • src/mutation.test.ts
  • src/mutation.ts
  • src/query.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/mutation.test.ts

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