Skip to content

Conversation

@alexbatis
Copy link

@alexbatis alexbatis commented Jan 31, 2026

fix OOM on next.js builds - see #610 (comment)

Summary by CodeRabbit

  • Refactor
    • Improved type-level detection of schema procedures across TanStack Query client integrations (React, Svelte, Vue), refining public typings to a more explicit empty mapping when procedures are absent. No runtime behavior changes.

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

@coderabbitai
Copy link

coderabbitai bot commented Jan 31, 2026

📝 Walkthrough

Walkthrough

Updated the ProcedureHooks type alias in three TanStack Query client files (React, Svelte, Vue): the conditional now checks Schema['procedures'] extends Record<string, any> instead of Schema extends { procedures: Record<string, any> }, and the else branch changed from {} to Record<never, never>.

Changes

Cohort / File(s) Summary
Type Conditional Refactor
packages/clients/tanstack-query/src/react.ts, packages/clients/tanstack-query/src/svelte/index.svelte.ts, packages/clients/tanstack-query/src/vue.ts
Replaced structural conditional Schema extends { procedures: Record<string, any> } with index-access conditional Schema['procedures'] extends Record<string, any> in ProcedureHooks<Schema>. Also changed the false branch from {} to Record<never, never>.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

I nibble bytes and type delight,
Swapped checks by day, and dreamed by night.
Three files hopped into one clear view,
Index-access made the types 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 change: fixing an out-of-memory type issue in the TanStack Query client by replacing {} with Record<never, never> in the ProcedureHooks type across three files.
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
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@ymc9
Copy link
Member

ymc9 commented Jan 31, 2026

Hi @alexbatis , does this fix work reliably for your project? I'm testing it locally with the better-auth-zenstack-multitenancy project and it still consistently runs OOM on the second build.

@alexbatis
Copy link
Author

good catch @ymc9

on my better-auth-zenstack-multitenancy fork i had added some procedures to test the type safety

my original change did not hit OOM errors during build when there were procedures defined, but when i removed the procedures the OOM errors re-appeared.

i updated the PR with a change that works in both cases - when procedures are defined vs no procedures

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