-
-
Notifications
You must be signed in to change notification settings - Fork 68
Add tanstack compat plugin #457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Type augmentation declared required properties on extension interfaces,
but core library doesn't have the plugin installed, so `ext: {}` failed
to satisfy the interface. Making them optional fixes compilation.
All tanstack-compat type augmentation fixes verified: - 15 plugin tests pass - Type check passes - Build passes
✅ Deploy Preview for funny-banoffee-0afb46 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughAdds a new TanStack Query compatibility plugin for Pinia Colada. The plugin extends query and mutation entries with 12 and 7 optional reactive properties respectively, wiring into the cache action lifecycle. Includes plugin implementation, configuration, comprehensive tests, and documentation. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (1)
🧰 Additional context used🧬 Code graph analysis (1)plugins/tanstack-compat/src/tanstack-compat.spec.ts (2)
🪛 LanguageTooldocs/cookbook/tanstack-compat.md[grammar] ~7-~7: Use a hyphen to join words. (QB_NEW_EN_HYPHEN) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
🔇 Additional comments (8)
Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #457 +/- ##
==========================================
+ Coverage 85.93% 86.45% +0.52%
==========================================
Files 19 20 +1
Lines 725 790 +65
Branches 193 206 +13
==========================================
+ Hits 623 683 +60
+ Misses 57 56 -1
- Partials 45 51 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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
🤖 Fix all issues with AI agents
In @plugins/tanstack-compat/src/tanstack-compat.spec.ts:
- Around line 53-92: The local ref entryRef declared in mutationFactory is
unused; either remove the declaration or actually use it to expose the mutation
entry. To fix, delete the unused const entryRef = ref<UseMutationEntry |
null>(null) from mutationFactory, or if the original intent was to expose the
entry, assign entryRef.value inside the component (for example in
getMutationEntry or after the first mutate) and return entryRef from
mutationFactory alongside pinia and wrapper so tests can access it; reference
symbols: entryRef and mutationFactory (and getMutationEntry) to locate the
change.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (10)
plans/prd.jsonplugins/tanstack-compat/README.mdplugins/tanstack-compat/docs/tanstack-compat.mdplugins/tanstack-compat/memory.mdplugins/tanstack-compat/package.jsonplugins/tanstack-compat/src/index.tsplugins/tanstack-compat/src/tanstack-compat.spec.tsplugins/tanstack-compat/src/tanstack-compat.tsplugins/tanstack-compat/tsdown.config.tsprogress.txt
🧰 Additional context used
🧬 Code graph analysis (2)
plugins/tanstack-compat/src/tanstack-compat.spec.ts (1)
plugins/tanstack-compat/src/tanstack-compat.ts (1)
PiniaColadaTanStackCompat(33-56)
plugins/tanstack-compat/src/tanstack-compat.ts (1)
plugins/tanstack-compat/src/index.ts (2)
FetchStatus(1-1)PiniaColadaTanStackCompat(1-1)
🪛 LanguageTool
progress.txt
[style] ~9-~9: The double modal “needed cast” is nonstandard (only accepted in certain dialects). Consider “to be cast”.
Context: ...hat set customProperty on ext (needed cast to { ext: unknown }) ### Why The plu...
(NEEDS_FIXED)
plugins/tanstack-compat/docs/tanstack-compat.md
[grammar] ~7-~7: Use a hyphen to join words.
Context: ...w The plugin adds TanStack Query Vue v5 compatible properties to both useQuery...
(QB_NEW_EN_HYPHEN)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (16)
plugins/tanstack-compat/package.json (2)
56-58: Verify workspace protocol transformation on publish.The
workspace:>=protocol is pnpm-specific. Ensure your build/publish process transforms this to a valid semver range before publishing to npm.
15-15: No action needed. The homepage URL format is consistent with all other plugins in the repository and follows the established pattern. The/tree/main/path is not required for package.json homepage fields across this codebase.Likely an incorrect or invalid review comment.
plugins/tanstack-compat/tsdown.config.ts (1)
1-21: LGTM!The tsdown configuration is properly structured with correct externals, ESM output, and declaration generation.
plugins/tanstack-compat/README.md (1)
1-65: LGTM!Clear installation instructions, well-structured setup example, and helpful quick reference. The documentation effectively guides users through plugin integration.
plugins/tanstack-compat/src/index.ts (1)
1-1: LGTM!Clean barrel export pattern for the plugin's public API.
plugins/tanstack-compat/docs/tanstack-compat.md (1)
1-279: LGTM!Excellent comprehensive documentation with clear API tables, practical examples, well-documented caveats, and a helpful migration checklist. The structure effectively guides users through the plugin's capabilities and limitations.
Note: The static analysis hint about hyphenating "Vue v5" is a false positive - version numbers in this format don't require hyphenation.
progress.txt (1)
1-37: Internal progress log looks reasonable.This documents the type augmentation fix appropriately. Minor grammar nit on line 9: "needed cast" could be "needed a cast" per static analysis, but this is internal documentation so low priority.
plans/prd.json (1)
1-48: Validation plan documented.Tracking artifact for the type-fix workflow. All verification steps marked as passing.
plugins/tanstack-compat/src/tanstack-compat.spec.ts (3)
16-26: Test setup is correct.Timer management and auto-unmount are properly configured.
94-324: Query extension tests are comprehensive.Good coverage of all 12 properties including edge cases for loading vs refetch errors.
326-481: Mutation extension tests are adequate.Coverage for all 7 properties. The note about
reset()creating new entries is helpful context.plugins/tanstack-compat/memory.md (1)
1-93: Good internal documentation.Architecture decisions, type augmentation rationale, and property tables are clear and accurate.
plugins/tanstack-compat/src/tanstack-compat.ts (4)
33-56: Plugin hooks are correctly implemented.Using
'extend'for queries and'create'withafterfor mutations aligns with cache lifecycle.scope.run()ensures proper cleanup.
106-111: Reactivity hack forisStaleis documented.The no-op expression accessing
entry.state.valueforces Vue to track the dependency. Comment explains the rationale.
131-181: Mutation extension implementation is correct.Frozen object handling, timestamp tracking, and status computeds are properly implemented.
184-317: Type augmentation uses optional properties correctly.This resolves the compilation issue where
ext: {}wouldn't satisfy required interface properties. Generic parameters are necessary for interface shape even though unused in property types.
The goal is to make it easier to migrate off TQ to Pinia Colada
Summary by CodeRabbit
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.