Skip to content

fix(types): remove Node.js type leak in browser environments#10300

Closed
danieljayasurya-e wants to merge 2 commits intoTanStack:mainfrom
danieljayasurya-e:fix/node-types-leaking
Closed

fix(types): remove Node.js type leak in browser environments#10300
danieljayasurya-e wants to merge 2 commits intoTanStack:mainfrom
danieljayasurya-e:fix/node-types-leaking

Conversation

@danieljayasurya-e
Copy link
Copy Markdown

@danieljayasurya-e danieljayasurya-e commented Mar 19, 2026

🎯 Changes

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Chores

    • Updated shared build configuration and module structure to use explicit re-exports, enhancing maintainability and consistency across the package ecosystem.
  • Refactor

    • Refined internal timer management implementation with improved type handling to ensure better reliability during timeout operations.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 19, 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: 5934c729-6429-4205-b479-807e7538930b

📥 Commits

Reviewing files that changed from the base of the PR and between b6fd86b and fc44c32.

📒 Files selected for processing (3)
  • packages/query-core/root.eslint.config.js
  • packages/query-core/root.tsup.config.js
  • packages/query-core/src/timeoutManager.ts

📝 Walkthrough

Walkthrough

The changes update configuration handling and type signatures in the query-core package. ESLint and Tsup config files are converted to explicit module re-exports, and the timeout manager's exported type annotation is simplified with updated type casting in implementations.

Changes

Cohort / File(s) Summary
Configuration Re-exports
packages/query-core/root.eslint.config.js, packages/query-core/root.tsup.config.js
Converted from implicit/string references to explicit ES module re-exports using import/export statements for improved clarity and consistency.
Timeout Manager Type Updates
packages/query-core/src/timeoutManager.ts
Simplified defaultTimeoutProvider type annotation from TimeoutProvider<ReturnType<typeof setTimeout>> to generic TimeoutProvider, with implementation casting return values to ManagedTimerId and casting parameters to any.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Configuration hops now clear and bright,
Type exports bundled, all feels right!
Timeout IDs cast in magic ways,
Simpler types for simpler days! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description follows the required template structure with all major sections present (Changes, Checklist, Release Impact), but the Changes section lacks detailed explanation of what was actually modified and why, despite the checklist items being marked as completed. Add specific details under the 🎯 Changes section explaining what modifications were made (e.g., type changes in timeoutManager.ts, ESLint/tsup config updates) and the motivation behind removing the Node.js type leak.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(types): remove Node.js type leak in browser environments' directly matches the PR's core objective of fixing a Node.js type leak in browser contexts, as evidenced by the timeoutManager.ts changes that alter type casting behavior.
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 unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

CodeRabbit can use OpenGrep to find security vulnerabilities and bugs across 17+ programming languages.

OpenGrep is compatible with Semgrep configurations. Add an opengrep.yml or semgrep.yml configuration file to your project to enable OpenGrep analysis.

@TkDodo
Copy link
Copy Markdown
Collaborator

TkDodo commented Mar 20, 2026

thanks, I’ve merged a different fix. This isn’t the root cause.

@TkDodo TkDodo closed this Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants