Skip to content

Conversation

@posva
Copy link
Owner

@posva posva commented Jan 8, 2026

The goal is to make it easier to migrate off TQ to Pinia Colada

Summary by CodeRabbit

  • New Features

    • Introduced a TanStack Query compatibility plugin that extends queries and mutations with TanStack-compatible reactive properties, enabling easier migration from TanStack Query.
  • Documentation

    • Added comprehensive documentation including plugin setup, usage examples, API compatibility guide, and migration checklist for existing TanStack Query users.

✏️ Tip: You can customize this high-level summary in your review settings.

posva added 2 commits January 8, 2026 16:15
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
@netlify
Copy link

netlify bot commented Jan 8, 2026

Deploy Preview for funny-banoffee-0afb46 ready!

Name Link
🔨 Latest commit 337c457
🔍 Latest deploy log https://app.netlify.com/projects/funny-banoffee-0afb46/deploys/6960e22c7b99ae00088af1e2
😎 Deploy Preview https://deploy-preview-457--funny-banoffee-0afb46.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 8, 2026

Walkthrough

Adds 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

Cohort / File(s) Change Summary
Plugin Implementation
plugins/tanstack-compat/src/tanstack-compat.ts, plugins/tanstack-compat/src/index.ts
Implements PiniaColadaTanStackCompat plugin extending query/mutation entries with optional reactive properties (isSuccess, isError, isFetching, etc.); exports plugin factory and FetchStatus type
Configuration & Build
plugins/tanstack-compat/tsconfig.json, plugins/tanstack-compat/tsdown.config.ts, plugins/tanstack-compat/package.json
Adds TypeScript, build, and package configuration for @pinia/colada-plugin-tanstack-compat
Documentation
plugins/tanstack-compat/README.md, plugins/tanstack-compat/memory.md, docs/cookbook/tanstack-compat.md, docs/.vitepress/config/index.ts
Introduces installation guide, plugin architecture notes, cookbook article, and sidebar navigation entry
Tests
plugins/tanstack-compat/src/tanstack-compat.spec.ts
Adds comprehensive test coverage for query/mutation extensions, state transitions, and lifecycle behaviors
Planning & Tracking
plans/prd.json, progress.txt
Outlines validation workflow and type-fix progress

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • feat(devtools): mutations #439: Directly modifies mutation-related test and implementation files (src/mutation-store.spec.ts) that are also touched in this PR.
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add tanstack compat plugin' directly and clearly describes the main change: introducing a new TanStack compatibility plugin to Pinia Colada.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch plugin/tq-compat

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 280623c and 337c457.

📒 Files selected for processing (4)
  • docs/.vitepress/config/index.ts
  • docs/cookbook/tanstack-compat.md
  • plugins/tanstack-compat/src/tanstack-compat.spec.ts
  • plugins/tanstack-compat/tsconfig.json
✅ Files skipped from review due to trivial changes (1)
  • plugins/tanstack-compat/tsconfig.json
🧰 Additional context used
🧬 Code graph analysis (1)
plugins/tanstack-compat/src/tanstack-compat.spec.ts (2)
plugins/tanstack-compat/src/index.ts (1)
  • PiniaColadaTanStackCompat (1-1)
plugins/tanstack-compat/src/tanstack-compat.ts (1)
  • PiniaColadaTanStackCompat (33-56)
🪛 LanguageTool
docs/cookbook/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). (4)
  • GitHub Check: Redirect rules
  • GitHub Check: Header rules
  • GitHub Check: Pages changed
  • GitHub Check: build
🔇 Additional comments (8)
docs/.vitepress/config/index.ts (1)

260-261: LGTM!

The new cookbook entry is correctly placed and follows the existing pattern.

docs/cookbook/tanstack-compat.md (4)

1-34: Clear setup instructions.

The overview and installation steps are well-documented. The code example correctly demonstrates plugin registration.


35-69: Comprehensive feature documentation.

Both query and mutation extensions are clearly documented with types and TanStack equivalents.


179-249: Excellent caveat documentation.

The limitations are clearly explained with workarounds. This transparency will help users understand the plugin's constraints and avoid surprises.


70-305: Well-structured examples and migration guide.

The usage examples demonstrate real-world scenarios effectively. The migration checklist provides clear steps for users transitioning from TanStack Query.

plugins/tanstack-compat/src/tanstack-compat.spec.ts (3)

9-86: Well-designed test factories.

The helper functions properly configure the test environment and provide clean abstractions. The getMutationEntry helper correctly addresses the documented limitation of mutation extensions not being directly exposed.


88-318: Comprehensive query extension tests.

All 12 query extensions are thoroughly tested across multiple scenarios including initial load, refetch, success, and error paths. The fake timer usage ensures deterministic test execution.


320-476: Thorough mutation extension tests.

All 7 mutation extensions are validated across success and failure paths. The tests correctly account for mutation cache behavior where entries are created on first mutation call.


Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

❌ Patch coverage is 89.23077% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.45%. Comparing base (8dd595a) to head (337c457).

Files with missing lines Patch % Lines
plugins/tanstack-compat/src/tanstack-compat.ts 89.23% 0 Missing and 7 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@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

🤖 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

📥 Commits

Reviewing files that changed from the base of the PR and between 8dd595a and 280623c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • plans/prd.json
  • plugins/tanstack-compat/README.md
  • plugins/tanstack-compat/docs/tanstack-compat.md
  • plugins/tanstack-compat/memory.md
  • plugins/tanstack-compat/package.json
  • plugins/tanstack-compat/src/index.ts
  • plugins/tanstack-compat/src/tanstack-compat.spec.ts
  • plugins/tanstack-compat/src/tanstack-compat.ts
  • plugins/tanstack-compat/tsdown.config.ts
  • progress.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' with after for mutations aligns with cache lifecycle. scope.run() ensures proper cleanup.


106-111: Reactivity hack for isStale is documented.

The no-op expression accessing entry.state.value forces 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🆕 Triaging

Development

Successfully merging this pull request may close these issues.

2 participants