Skip to content

Conversation

@ymc9
Copy link
Member

@ymc9 ymc9 commented Nov 5, 2025

Summary by CodeRabbit

  • New Features

    • Added Vue and Svelte integrations for TanStack Query client, providing typed hooks for queries and mutations alongside the existing React support.
    • Refactored React client hooks with improved type abstractions for better API consistency across frameworks.
  • Chores

    • Version bumped to 3.0.0-beta.18 across all packages.

ymc9 and others added 4 commits November 4, 2025 21:48
* feat(tanstack): migrate vue query

* addressing PR comments

* fix infinite query
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
* feat(tanstack): migrate svelte query

* fix hooks typing

* addressing PR comments
* fix(tanstack): improve mutation mutateAsync typing

* simplify typing
Copilot AI review requested due to automatic review settings November 5, 2025 19:57
@coderabbitai
Copy link

coderabbitai bot commented Nov 5, 2025

Warning

Rate limit exceeded

@ymc9 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 17 minutes and 8 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 5ff17ce and e7f191c.

📒 Files selected for processing (11)
  • packages/clients/tanstack-query/src/react.ts (11 hunks)
  • packages/clients/tanstack-query/src/svelte.ts (1 hunks)
  • packages/clients/tanstack-query/src/utils/types.ts (2 hunks)
  • packages/clients/tanstack-query/src/vue.ts (1 hunks)
  • packages/clients/tanstack-query/test/react-typing-test.ts (1 hunks)
  • packages/clients/tanstack-query/test/schemas/basic/input.ts (1 hunks)
  • packages/clients/tanstack-query/test/schemas/basic/models.ts (1 hunks)
  • packages/clients/tanstack-query/test/schemas/basic/schema-lite.ts (1 hunks)
  • packages/clients/tanstack-query/test/schemas/basic/schema.zmodel (1 hunks)
  • packages/clients/tanstack-query/test/svelte-typing-test.ts (1 hunks)
  • packages/clients/tanstack-query/test/vue-typing-test.ts (1 hunks)

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Version bumped across the monorepo (3.0.0-beta.17 to 3.0.0-beta.18). Added Vue and Svelte client integrations for TanStack Query alongside React. Refactored React client to use new generic ClientHooks and ModelQueryHooks types. Simplified internal fetcher signature by removing checkReadBack parameter. Added type utilities for delegate model operation filtering.

Changes

Cohort / File(s) Summary
Version Bumps (beta.18)
package.json, packages/*/package.json, samples/*/package.json, tests/*/package.json
Version field updated from 3.0.0-beta.17 to 3.0.0-beta.18 across 28 package manifest files; no functional changes.
TanStack Query Package Configuration
packages/clients/tanstack-query/package.json, packages/clients/tanstack-query/tsup.config.ts
Added exports for ./vue, ./svelte, ./package.json with type/import/require mappings. Added devDependencies for @tanstack/vue-query, @tanstack/svelte-query, vue, and svelte. Added peer dependencies for Vue and Svelte query packages. Added build entries for vue and svelte in tsup.
React Client Refactoring
packages/clients/tanstack-query/src/react.ts
Introduced ClientHooks and ModelQueryHooks generic types to replace inline hook definitions. Updated useClientQueries/useModelQueries return types. Removed checkReadBack parameter from all internal query/mutation helpers. Simplified useInternalMutation signature. Updated deprecation tag to use @link syntax.
Vue Client Implementation
packages/clients/tanstack-query/src/vue.ts
New file providing Vue + TanStack Query integration with model-scoped hooks, context providers (provideQuerySettingsContext), query/mutation factories, and type-safe wrappers for all CRUD and aggregation operations.
Svelte Client Implementation
packages/clients/tanstack-query/src/svelte.ts
New file providing Svelte + TanStack Query integration with store-aware hooks, context utilities (setQuerySettingsContext), internal query/mutation builders, and model-driven operations with optimistic updates support.
Client Utilities
packages/clients/tanstack-query/src/utils/common.ts, packages/clients/tanstack-query/src/utils/types.ts
Simplified fetcher signature from conditional return type with checkReadBack to consistent Promise. Renamed makeUrl parameter from url to endpoint. Added TrimDelegateModelOperations type for conditional operation omission on delegate models.
ORM Type Definitions
packages/orm/src/client/contract.ts
Extracted inline operation exclusion set into new exported type OperationsIneligibleForDelegateModels; refactored ModelOperations to reference it.
TanStack Query Type Tests
packages/clients/tanstack-query/test/react-typing-test.ts, packages/clients/tanstack-query/test/vue-typing-test.ts, packages/clients/tanstack-query/test/svelte-typing-test.ts
New typing validation files exercising model hooks (queries, mutations, infinite queries) with various option combinations, includes/selects, error expectations, and @ts-expect-error annotations.
Workspace Configuration
pnpm-workspace.yaml
Added vue@3.5.22 and svelte@5.43.3 to the workspace catalog.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

  • Areas requiring extra attention:
    • fetcher signature changes in packages/clients/tanstack-query/src/utils/common.ts — verify error handling preserves behavior when removing checkReadBack parameter
    • React client refactoring (react.ts) — validate that ClientHooks/ModelQueryHooks type mapping matches function behavior; check useInternalMutation logging integration from context
    • Vue and Svelte implementations — while following consistent patterns, verify context providers (provideQuerySettingsContext vs setQuerySettingsContext) are correctly integrated; review store handling in Svelte
    • Type utilities (TrimDelegateModelOperations, OperationsIneligibleForDelegateModels) — confirm delegate model filtering logic is correct and consistently applied across React/Vue/Svelte clients
    • Build configuration (tsup.config.ts) — ensure new entries generate correct output for Vue/Svelte distributions

Possibly related PRs

Poem

🐰 Hops through Vue and Svelte so bright,
Three frameworks dancing in the night,
Types refined, the patterns gleam,
TanStack Query's sweetest dream! 🌟

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly describes the primary change: merging the dev branch to main with version bump to v3.0.0-beta.18.

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.

@claude
Copy link

claude bot commented Nov 5, 2025

Claude finished @ymc9's task —— View job


PR Review: v3.0.0-beta.18 Release

Review Checklist:

  • Analyze overall PR scope and version consistency
  • Review tanstack-query package major changes
  • Examine new Svelte implementation
  • Examine new Vue implementation
  • Review React implementation refactoring
  • Check new typing tests
  • Assess build configuration changes
  • Evaluate test coverage improvements
  • Check for potential bugs or issues
  • Review performance and security considerations
  • Provide final recommendations

🔍 Review Summary

This is a significant release that adds multi-framework support to the TanStack Query package, expanding from React-only to include Svelte and Vue implementations. The changes are well-structured and maintain consistency across frameworks.

Positive Findings

Architecture & Design

  • Excellent framework abstraction: Shared utilities in common.ts prevent code duplication
  • Consistent API design: All three frameworks (React, Svelte, Vue) follow the same interface patterns
  • Type safety: Strong TypeScript typing throughout with framework-specific adaptations
  • Build system: Clean tsup configuration with separate entry points for each framework

Code Quality

  • Comprehensive typing tests: New test files validate TypeScript inference works correctly
  • Proper framework patterns: Each implementation uses appropriate framework conventions:
    • React: Context API + hooks
    • Svelte: stores + context functions
    • Vue: provide/inject + composables
  • Backward compatibility: Deprecated functions maintained with clear migration paths

Enhanced Functionality

  • Improved mutation typing: Better mutateAsync typing with generic constraints
  • Optimistic updates: Sophisticated cache invalidation and optimistic update system
  • Flexible configuration: Context-based configuration per framework

⚠️ Areas for Attention

Potential Issues

  1. Package exports complexity: The new multi-entry exports could cause bundler confusion:

    // packages/clients/tanstack-query/package.json:25-55
    "./react": { "import": "./dist/react.js", "require": "./dist/react.cjs" }
    "./vue": { "import": "./dist/vue.js", "require": "./dist/vue.cjs" }  
    "./svelte": { "import": "./dist/svelte.js", "require": "./dist/svelte.cjs" }
  2. Store/ref handling in reactive frameworks: Vue/Svelte implementations handle reactive values but there's complexity around:

    // svelte.ts:475-481
    function unwrapStore<T>(storeOrValue: StoreOrVal<T>): T {
        return isStore(storeOrValue) ? get(storeOrValue) : storeOrValue;
    }
  3. Version dependency mismatches: Different TanStack Query versions across frameworks:

    • @tanstack/vue-query": "5.90.6"
    • @tanstack/svelte-query": "5.90.2"
    • Should these be aligned?

Documentation Gaps

  • Migration guide: No clear migration documentation for the renamed functions
  • Framework-specific examples: The typing tests are good but more usage examples would help
  • Performance implications: No guidance on optimistic update performance

🔧 Recommendations

High Priority

  1. Align TanStack Query versions across frameworks for consistency
  2. Add integration tests to verify cross-framework compatibility
  3. Document breaking changes clearly (e.g., context function renames)

Medium Priority

  1. Bundle size analysis: Verify tree-shaking works correctly with multiple entry points
  2. Error handling review: Ensure error scenarios are handled consistently across frameworks
  3. Performance testing: Validate optimistic updates perform well with large datasets

Low Priority

  1. Utility function consolidation: Some duplication between framework implementations could be reduced
  2. Development experience: Consider adding framework-specific ESLint rules

🔒 Security Assessment

  • ✅ No security concerns identified
  • ✅ Proper input sanitization in URL construction
  • ✅ Safe handling of user data in query parameters

🚀 Performance Considerations

  • ✅ Efficient query invalidation logic
  • ✅ Smart optimistic update implementation
  • ⚠️ Bundle size may increase with multiple framework support - recommend analysis

📊 Test Coverage Assessment

  • Strong: Comprehensive TypeScript typing tests for all frameworks
  • Good: Type validation covers edge cases and error scenarios
  • ⚠️ Missing: Runtime integration tests between frameworks
  • ⚠️ Missing: E2E tests validating optimistic updates work correctly

🎯 Final Recommendation

✅ APPROVE - This is a well-executed feature addition that significantly expands ZenStack's framework support while maintaining code quality and consistency. The architecture is sound and the implementation follows best practices.

Key strengths: Excellent abstraction, strong typing, consistent APIs across frameworks, proper backward compatibility.

Suggested follow-ups (can be addressed in future PRs):

  • Dependency version alignment
  • Integration test additions
  • Bundle size optimization review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR bumps the package version from 3.0.0-beta.17 to 3.0.0-beta.18 across all packages and adds support for Vue and Svelte in the TanStack Query client.

  • Version bump across all workspace packages to 3.0.0-beta.18
  • Added Vue and Svelte support to @zenstackhq/tanstack-query package
  • Refactored common code to improve maintainability and remove unused parameters

Reviewed Changes

Copilot reviewed 32 out of 33 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Multiple package.json files Version bump from 3.0.0-beta.17 to 3.0.0-beta.18
pnpm-workspace.yaml Added Vue (3.5.22) and Svelte (5.43.3) to catalog
pnpm-lock.yaml Updated lockfile with new dependencies and version changes
packages/orm/src/client/contract.ts Extracted delegate model operations list to named type for reusability
packages/clients/tanstack-query/src/utils/types.ts Added TrimDelegateModelOperations helper type
packages/clients/tanstack-query/src/utils/common.ts Simplified fetcher function signature by removing unused parameter
packages/clients/tanstack-query/src/react.ts Refactored to use new type helpers and cleaned up mutation calls
packages/clients/tanstack-query/src/vue.ts New Vue 3 integration implementation
packages/clients/tanstack-query/src/svelte.ts New Svelte integration implementation
packages/clients/tanstack-query/tsup.config.ts Added vue and svelte entry points
packages/clients/tanstack-query/package.json Added exports, dependencies, and peer dependencies for Vue and Svelte
Test files Added comprehensive typing tests for Vue and Svelte integrations
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@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: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 25041d2 and 5ff17ce.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (32)
  • package.json (1 hunks)
  • packages/cli/package.json (1 hunks)
  • packages/clients/tanstack-query/package.json (4 hunks)
  • packages/clients/tanstack-query/src/react.ts (11 hunks)
  • packages/clients/tanstack-query/src/svelte.ts (1 hunks)
  • packages/clients/tanstack-query/src/utils/common.ts (2 hunks)
  • packages/clients/tanstack-query/src/utils/types.ts (2 hunks)
  • packages/clients/tanstack-query/src/vue.ts (1 hunks)
  • packages/clients/tanstack-query/test/react-typing-test.ts (1 hunks)
  • packages/clients/tanstack-query/test/svelte-typing-test.ts (1 hunks)
  • packages/clients/tanstack-query/test/vue-typing-test.ts (1 hunks)
  • packages/clients/tanstack-query/tsup.config.ts (1 hunks)
  • packages/common-helpers/package.json (1 hunks)
  • packages/config/eslint-config/package.json (1 hunks)
  • packages/config/typescript-config/package.json (1 hunks)
  • packages/config/vitest-config/package.json (1 hunks)
  • packages/create-zenstack/package.json (1 hunks)
  • packages/dialects/sql.js/package.json (1 hunks)
  • packages/language/package.json (1 hunks)
  • packages/orm/package.json (1 hunks)
  • packages/orm/src/client/contract.ts (1 hunks)
  • packages/plugins/policy/package.json (1 hunks)
  • packages/schema/package.json (1 hunks)
  • packages/sdk/package.json (1 hunks)
  • packages/server/package.json (1 hunks)
  • packages/testtools/package.json (1 hunks)
  • packages/zod/package.json (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
  • samples/next.js/package.json (1 hunks)
  • samples/orm/package.json (1 hunks)
  • tests/e2e/package.json (1 hunks)
  • tests/regression/package.json (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (9)
packages/clients/tanstack-query/test/svelte-typing-test.ts (1)
packages/clients/tanstack-query/src/svelte.ts (1)
  • useClientQueries (212-217)
packages/orm/src/client/contract.ts (1)
packages/schema/src/schema.ts (3)
  • SchemaDef (10-18)
  • GetModels (109-109)
  • IsDelegateModel (264-267)
packages/clients/tanstack-query/src/utils/types.ts (2)
packages/schema/src/schema.ts (3)
  • SchemaDef (10-18)
  • GetModels (109-109)
  • IsDelegateModel (264-267)
packages/orm/src/client/contract.ts (1)
  • OperationsIneligibleForDelegateModels (798-798)
packages/clients/tanstack-query/test/react-typing-test.ts (1)
packages/clients/tanstack-query/src/react.ts (1)
  • useClientQueries (257-262)
packages/clients/tanstack-query/test/vue-typing-test.ts (1)
packages/clients/tanstack-query/src/vue.ts (1)
  • useClientQueries (201-206)
packages/clients/tanstack-query/src/utils/common.ts (1)
packages/common-helpers/src/lower-case-first.ts (1)
  • lowerCaseFirst (1-3)
packages/clients/tanstack-query/src/vue.ts (3)
packages/clients/tanstack-query/src/utils/common.ts (9)
  • DEFAULT_QUERY_ENDPOINT (11-11)
  • ExtraQueryOptions (101-106)
  • ExtraMutationOptions (81-96)
  • getQueryKey (171-181)
  • makeUrl (202-214)
  • fetcher (128-150)
  • marshal (183-190)
  • setupInvalidation (225-246)
  • setupOptimisticUpdate (304-348)
packages/schema/src/schema.ts (2)
  • SchemaDef (10-18)
  • GetModels (109-109)
packages/orm/src/client/crud-types.ts (16)
  • SelectIncludeOmit (453-457)
  • ModelResult (135-179)
  • FindArgs (648-664)
  • CreateArgs (677-682)
  • BatchResult (201-201)
  • UpdateArgs (815-821)
  • UpdateManyAndReturnArgs (828-834)
  • UpsertArgs (842-849)
  • DeleteArgs (961-966)
  • DeleteManyArgs (968-971)
  • CountArgs (977-982)
  • CountResult (988-998)
  • AggregateArgs (1004-1018)
  • AggregateResult (1044-1072)
  • GroupByArgs (1091-1108)
  • GroupByResult (1110-1144)
packages/clients/tanstack-query/src/svelte.ts (3)
packages/clients/tanstack-query/src/utils/common.ts (9)
  • DEFAULT_QUERY_ENDPOINT (11-11)
  • ExtraQueryOptions (101-106)
  • ExtraMutationOptions (81-96)
  • makeUrl (202-214)
  • getQueryKey (171-181)
  • fetcher (128-150)
  • marshal (183-190)
  • setupInvalidation (225-246)
  • setupOptimisticUpdate (304-348)
packages/schema/src/schema.ts (2)
  • SchemaDef (10-18)
  • GetModels (109-109)
packages/common-helpers/src/lower-case-first.ts (1)
  • lowerCaseFirst (1-3)
packages/clients/tanstack-query/src/react.ts (5)
packages/clients/tanstack-query/src/svelte.ts (3)
  • ModelMutationModelResult (112-124)
  • ModelMutationResult (110-110)
  • ModelMutationOptions (107-108)
packages/schema/src/schema.ts (2)
  • SchemaDef (10-18)
  • GetModels (109-109)
packages/orm/src/client/crud-types.ts (17)
  • SelectIncludeOmit (453-457)
  • ModelResult (135-179)
  • FindUniqueArgs (669-671)
  • FindArgs (648-664)
  • CreateArgs (677-682)
  • CreateManyArgs (684-684)
  • CreateManyAndReturnArgs (686-692)
  • UpdateArgs (815-821)
  • UpdateManyArgs (823-826)
  • UpdateManyAndReturnArgs (828-834)
  • UpsertArgs (842-849)
  • DeleteArgs (961-966)
  • DeleteManyArgs (968-971)
  • CountArgs (977-982)
  • Subset (505-507)
  • AggregateArgs (1004-1018)
  • GroupByArgs (1091-1108)
packages/clients/tanstack-query/src/utils/types.ts (1)
  • TrimDelegateModelOperations (24-28)
packages/clients/tanstack-query/src/utils/common.ts (4)
  • fetcher (128-150)
  • getQueryKey (171-181)
  • makeUrl (202-214)
  • ExtraMutationOptions (81-96)
⏰ 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). (3)
  • GitHub Check: build-test (20.x, sqlite)
  • GitHub Check: build-test (20.x, postgresql)
  • GitHub Check: claude-review
🔇 Additional comments (34)
samples/orm/package.json (1)

3-3: Version bump consistent with release.

tests/e2e/package.json (1)

3-3: Version bump consistent with release.

packages/common-helpers/package.json (1)

3-3: Version bump consistent with release.

package.json (1)

3-3: Version bump consistent with release.

packages/config/eslint-config/package.json (1)

3-3: Version bump consistent with release.

packages/sdk/package.json (1)

3-3: Version bump consistent with release.

packages/create-zenstack/package.json (1)

3-3: Version bump consistent with release.

packages/zod/package.json (1)

3-3: Version bump consistent with release.

packages/schema/package.json (1)

3-3: Version bump consistent with release.

The version increment aligns with the coordinated release across the monorepo.

packages/server/package.json (1)

3-3: Version bump consistent with release.

The version increment aligns with the coordinated release across the monorepo.

tests/regression/package.json (1)

3-3: Version bump consistent with release.

The version increment aligns with the coordinated release across the monorepo.

packages/language/package.json (1)

4-4: Version bump consistent with release.

The version increment aligns with the coordinated release across the monorepo.

packages/config/typescript-config/package.json (1)

3-3: Version bump consistent with release.

The version increment aligns with the coordinated release across the monorepo.

packages/config/vitest-config/package.json (1)

4-4: Version bump consistent with release.

The version increment aligns with the coordinated release across the monorepo.

packages/orm/package.json (1)

3-3: Version bump consistent with release.

The version increment aligns with the coordinated release across the monorepo.

packages/testtools/package.json (1)

3-3: Version bump consistent with release.

The version increment aligns with the coordinated release across the monorepo.

samples/next.js/package.json (1)

3-3: LGTM! Version bump aligns with release.

The version update from 3.0.0-beta.17 to 3.0.0-beta.18 is consistent with the PR objective.

packages/cli/package.json (1)

6-6: LGTM! Version bump aligns with release.

The version update from 3.0.0-beta.17 to 3.0.0-beta.18 is consistent with the PR objective.

packages/plugins/policy/package.json (1)

3-3: LGTM! Version bump aligns with release.

The version update from 3.0.0-beta.17 to 3.0.0-beta.18 is consistent with the PR objective.

packages/dialects/sql.js/package.json (1)

3-3: LGTM! Version bump aligns with release.

The version update from 3.0.0-beta.17 to 3.0.0-beta.18 is consistent with the PR objective.

packages/orm/src/client/contract.ts (1)

798-804: LGTM! Excellent refactoring to improve type reusability.

Extracting the inline union type into OperationsIneligibleForDelegateModels makes the code more maintainable and enables reuse across the codebase. The behavior of ModelOperations remains unchanged while improving the DRY principle.

pnpm-workspace.yaml (1)

27-28: LGTM! Dependencies added for Vue and Svelte integrations.

The addition of Vue 3.5.22 and Svelte 5.43.3 to the catalog supports the new TanStack Query client integrations for these frameworks.

packages/clients/tanstack-query/tsup.config.ts (1)

6-7: LGTM! Build configuration updated for new framework integrations.

The addition of Vue and Svelte entry points is consistent with the existing React configuration and enables proper bundling for the new framework integrations.

packages/clients/tanstack-query/src/utils/types.ts (2)

1-2: LGTM! Necessary imports for delegate model filtering.

The imports provide the type utilities needed for the new TrimDelegateModelOperations helper.


24-28: LGTM! Well-designed utility type for delegate model operation filtering.

The TrimDelegateModelOperations utility provides a clean, reusable way to conditionally filter out operations that are ineligible for delegate models across different framework integrations (React, Vue, Svelte).

packages/clients/tanstack-query/src/react.ts (9)

39-41: LGTM! Imports support new generic type system.

The new imports (SelectIncludeOmit, Subset, TrimDelegateModelOperations) are properly utilized in the refactored type definitions and delegate model operation filtering.

Also applies to: 60-60


85-85: LGTM! Better JSDoc link format.

The updated deprecation tag now uses JSDoc link syntax, enabling IDE navigation to QuerySettingsProvider.


124-138: LGTM! New type wrappers enhance type safety.

The ModelMutationModelResult correctly refines mutateAsync typing with generic overloads for better inference, and ClientHooks provides a clean mapping from model names to their respective hooks. Both types align with the Vue/Svelte equivalents introduced in this release.


140-252: LGTM! Comprehensive type definitions with performance trade-off.

The refactored ModelQueryHooks provides strongly-typed hooks for all CRUD and aggregate operations, wrapped with TrimDelegateModelOperations to properly filter operations for delegate models. The manual type definitions (vs. mapped types) trade maintainability for TypeScript compilation performance, as noted in the comment.


257-261: LGTM! Return type updated to new ClientHooks wrapper.

The function signature correctly reflects the new ClientHooks<Schema> return type while preserving the existing implementation logic.


312-345: LGTM! Mutation calls simplified with centralized error handling.

All useInternalMutation calls now omit the checkReadBack parameter, as this logic has been moved into the fetcher function itself (see common.ts lines 127-149 where it handles "cannot-read-back" errors internally). This is a cleaner abstraction.


390-390: LGTM! Fetcher calls match simplified signature.

All fetcher invocations correctly use the new three-parameter signature (url, options, customFetch), with the checkReadBack flag removed. The fetcher now handles "cannot-read-back" errors internally.

Also applies to: 413-413, 439-439, 464-464


424-431: LGTM! Improved formatting and defensive default.

The multi-line type annotation enhances readability, and the default getNextPageParam provides safe fallback behavior when options are omitted.


483-505: LGTM! Significant simplification of mutation logic.

The useInternalMutation signature is cleaner with the generic C parameter and checkReadBack logic removed. The fetcher now handles "cannot-read-back" responses internally, returning undefined automatically. Invalidation and optimistic update setup remain intact, properly using logging from useHooksContext.

@claude
Copy link

claude bot commented Nov 5, 2025

Claude Code is working…

I'll analyze this and get back to you.

View job run

@ymc9 ymc9 added this pull request to the merge queue Nov 5, 2025
Merged via the queue into main with commit bd75719 Nov 5, 2025
7 of 8 checks passed
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.

2 participants