Visitar URL original
refactor: make query exports explicit by TkDodo · Pull Request #12587 · TanStack/query · GitHub
Skip to content

refactor: make query exports explicit - #12587

Merged
TkDodo merged 4 commits into
mainfrom
tkdodo/explicit-exports
Nov 12, 2026
Merged

TkDodo merged 4 commits into
mainfrom
tkdodo/explicit-exports

Conversation

@TkDodo

@TkDodo TkDodo commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

🎯 Changes

Replace star exports in query-core, adapters, and persistence packages with their current named exports. Keep adapters' star exports from query-core and query-persist-client-core.

This prevents new internal types in files such as types.ts from becoming public exports by accident. Existing public exports stay the same.

The shared lint rule now rejects star exports. Inline exceptions allow re-exports from query-core and query-persist-client-core. The remaining devtools context and Preact test-helper star exports are explicit.

Lint checks confirmed that value and type star exports fail, named exports pass, inline exceptions work, and the existing query-method restrictions still apply. Shared lint passed on all changed TypeScript files with four spelling warnings in existing configuration text. Release-plan generation also passed.

Local checks passed for all changed entry points: exported names, type/value flags, and declaration targets match the previous code. Strict type checking of query-core production sources, formatting, and git diff --check also passed. These checks used available local tools, including TypeScript 6.0.3.

The full test suite could not run. The configured pnpm 12.18.0 was unavailable, and an offline install with the available pnpm version failed because the cache lacks required packages. The Preview Size limit comparison is pending.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
  • I have followed the AI contribution policy and fully understand the code in this pull request, including any code generated with AI assistance.

🚀 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

  • API Changes
    • Package entry points now explicitly expose selected query, mutation, persistence, provider, and devtools APIs across supported frameworks.
    • Some exports previously available through package entry points are no longer re-exported. Review the available exports before relying on APIs that are not explicitly listed.

@changeset-bot

changeset-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ad7548d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 24 packages
Name Type
@tanstack/query-core Patch
@tanstack/query-persist-client-core Patch
@tanstack/angular-query-experimental Patch
@tanstack/preact-query Patch
@tanstack/preact-query-persist-client Patch
@tanstack/react-query Patch
@tanstack/react-query-persist-client Patch
@tanstack/solid-query Patch
@tanstack/solid-query-persist-client Patch
@tanstack/svelte-query Patch
@tanstack/lit-query Patch
@tanstack/query-async-storage-persister Patch
@tanstack/query-broadcast-client-experimental Patch
@tanstack/query-devtools Patch
@tanstack/query-sync-storage-persister Patch
@tanstack/vue-query Patch
@tanstack/svelte-query-persist-client Patch
@tanstack/preact-query-devtools Patch
@tanstack/react-query-devtools Patch
@tanstack/react-query-next-experimental Patch
@tanstack/solid-query-devtools Patch
@tanstack/svelte-query-devtools Patch
@tanstack/vue-query-devtools Patch
@tanstack/eslint-plugin-query Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Package entry points replace wildcard re-exports with explicit value and type exports across query-core, framework query packages, and persistence packages. Oxlint adds a restriction on star exports. A changeset declares patch releases for the listed packages.

Changes: Package export surfaces

Layer / File(s) Summary
Core package exports
packages/query-core/src/index.ts, packages/query-persist-client-core/src/index.ts
Query core and persistence core replace wildcard exports with explicit value and type export lists.
Framework package exports
packages/angular-query-experimental/src/*, packages/preact-query/src/*, packages/react-query/src/index.ts, packages/solid-query/src/index.ts, packages/svelte-query/src/index.ts, packages/query-devtools/src/contexts/index.ts, packages/lit-query/src/index.ts, packages/vue-query/src/index.ts, oxlint.config.ts
Framework entry points replace wildcard exports with named exports for types, values, and context functions. Oxlint adds a restriction on star exports, with suppressions for retained core-package re-exports.
Persistence adapter exports
packages/angular-query-persist-client/src/index.ts, packages/preact-query-persist-client/src/index.ts, packages/react-query-persist-client/src/index.ts, packages/solid-query-persist-client/src/index.ts, packages/svelte-query-persist-client/src/index.ts, .changeset/tidy-query-exports.md
Persistence entry points replace wildcard exports with named exports for persistence functions, providers, and types. The changeset declares patch releases for the listed packages.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Refactor

Suggested labels: package: svelte-query

Suggested reviewers: dogpawhat

Merge Risk: Minimal · up to 102a6

This change replaces wildcard re-exports with explicit named exports and adds a lint rule against new star exports. The public API is intended to stay the same, and the retained adapter re-exports are suppressed so lint should still pass. No concrete merge-blocking risk was found. The full test suite has not run, so normal CI should still pass before merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "refactor: make query exports explicit" matches the main change: star exports in query-core, the adapters, and the persistence packages are replaced with explicit named exports. The title is…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the repository template. It has a Changes section that explains the motivation: star exports are replaced with named exports to stop internal types leaking into the public API.…
Full details: Title check

Explanation

The title "refactor: make query exports explicit" matches the main change: star exports in query-core, the adapters, and the persistence packages are replaced with explicit named exports. The title is short, specific, and uses the conventional commit prefix. It does not mention the new lint rule, but that is a secondary aspect.

Full details: Description check

Explanation

The description follows the repository template. It has a Changes section that explains the motivation: star exports are replaced with named exports to stop internal types leaking into the public API. It also reports local verification and a pending Preview Size check. The checklist is present, and the changeset box is checked. The three checklist items are unchecked, so the author has not confirmed the test run or the AI policy review. The full test suite did not run, which the author discloses.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ad7548d and 102a699.

Files selected for processing: 16

  • .changeset/tidy-query-exports.md
  • oxlint.config.ts
  • packages/angular-query-experimental/src/index.ts
  • packages/angular-query-persist-client/src/index.ts
  • packages/lit-query/src/index.ts
  • packages/preact-query-persist-client/src/index.ts
  • packages/preact-query/src/__tests__/ErrorBoundary/index.ts
  • packages/preact-query/src/index.ts
  • packages/query-devtools/src/contexts/index.ts
  • packages/react-query-persist-client/src/index.ts
  • packages/react-query/src/index.ts
  • packages/solid-query-persist-client/src/index.ts
  • packages/solid-query/src/index.ts
  • packages/svelte-query-persist-client/src/index.ts
  • packages/svelte-query/src/index.ts
  • packages/vue-query/src/index.ts
Files skipped from review as they are similar to previous changes: 10

  • packages/preact-query-persist-client/src/index.ts
  • packages/react-query-persist-client/src/index.ts
  • .changeset/tidy-query-exports.md
  • packages/solid-query-persist-client/src/index.ts
  • packages/svelte-query/src/index.ts
  • packages/angular-query-persist-client/src/index.ts
  • packages/solid-query/src/index.ts
  • packages/angular-query-experimental/src/index.ts
  • packages/react-query/src/index.ts
  • packages/preact-query/src/index.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@nx-cloud

nx-cloud Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix Eligible

An automatically generated fix could have helped fix failing tasks for this run, but Self-healing CI is disabled for this workspace. Visit workspace settings to enable it and get automatic fixes in future runs.

To disable these notifications, a workspace admin can disable them in workspace settings.


View your CI Pipeline Execution ↗ for commit 102a699

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ❌ Failed 9m 25s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 38s View ↗

☁️ Nx Cloud last updated this comment at 2026-11-12 10:10:43 UTC

@pkg-pr-new

pkg-pr-new Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@12587

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@12587

@tanstack/lit-query

npm i https://pkg.pr.new/@tanstack/lit-query@12587

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@12587

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@12587

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@12587

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@12587

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@12587

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@12587

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@12587

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@12587

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@12587

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@12587

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@12587

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@12587

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@12587

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@12587

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@12587

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@12587

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@12587

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@12587

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@12587

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@12587

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@12587

commit: 102a699

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.85 KB (0%)
react minimal 8.67 KB (0%)

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

11 package(s) bumped directly, 13 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/angular-query-experimental 5.107.1 → 5.107.2 Changeset
@tanstack/preact-query 5.107.1 → 5.107.2 Changeset
@tanstack/preact-query-persist-client 5.107.1 → 5.107.2 Changeset
@tanstack/query-core 5.107.1 → 5.107.2 Changeset
@tanstack/query-devtools 5.107.1 → 5.107.2 Changeset
@tanstack/query-persist-client-core 5.107.1 → 5.107.2 Changeset
@tanstack/react-query 5.107.1 → 5.107.2 Changeset
@tanstack/react-query-persist-client 5.107.1 → 5.107.2 Changeset
@tanstack/solid-query 5.107.1 → 5.107.2 Changeset
@tanstack/solid-query-persist-client 5.107.1 → 5.107.2 Changeset
@tanstack/svelte-query 6.4.1 → 6.4.2 Changeset
@tanstack/eslint-plugin-query 5.107.1 → 5.107.2 Dependent
@tanstack/lit-query 0.2.38 → 0.2.39 Dependent
@tanstack/preact-query-devtools 5.107.1 → 5.107.2 Dependent
@tanstack/query-async-storage-persister 5.107.1 → 5.107.2 Dependent
@tanstack/query-broadcast-client-experimental 5.107.1 → 5.107.2 Dependent
@tanstack/query-sync-storage-persister 5.107.1 → 5.107.2 Dependent
@tanstack/react-query-devtools 5.107.1 → 5.107.2 Dependent
@tanstack/react-query-next-experimental 5.107.1 → 5.107.2 Dependent
@tanstack/solid-query-devtools 5.107.1 → 5.107.2 Dependent
@tanstack/svelte-query-devtools 6.4.1 → 6.4.2 Dependent
@tanstack/svelte-query-persist-client 6.4.1 → 6.4.2 Dependent
@tanstack/vue-query 5.107.1 → 5.107.2 Dependent
@tanstack/vue-query-devtools 6.4.1 → 6.4.2 Dependent

@TkDodo
TkDodo merged commit b160291 into main Nov 12, 2026
8 of 9 checks passed
@TkDodo
TkDodo deleted the tkdodo/explicit-exports branch November 12, 2026 10:07
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.

1 participant