Skip to content

chore: measure the typical React Query bundle size - #12768

Merged
TkDodo merged 2 commits into
mainfrom
tkdodo/add-bundlesize-typicals
Dec 5, 2026
Merged

TkDodo merged 2 commits into
mainfrom
tkdodo/add-bundlesize-typicals

Conversation

@TkDodo

@TkDodo TkDodo commented Dec 5, 2026 •

Copy link
Copy Markdown
Collaborator

🎯 Changes

Add a react typical entry to Size Limit. It measures useQuery and useMutation together with QueryClient and QueryClientProvider. This adds a measurement for apps that read and write data.

The local build measured 9,336 bytes after minification and Brotli compression. The limit is 10,000 bytes. pnpm run test:size and pnpm run test:pr --files=.size-limit.json passed locally.

✅ 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

  • Chores
    • Added a bundle-size check for the modern React Query build, with a 10 kB limit.
    • The check measures a build that includes common query and mutation features, along with query client setup and provider components. It excludes the React and React DOM packages from the measurement.

@changeset-bot

changeset-bot Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2fc2817

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@nx-cloud

nx-cloud Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 2fc2817

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 2m 16s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-12-05 18:48:29 UTC

@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@pkg-pr-new

pkg-pr-new Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
More templates

@tanstack/angular-query

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

@tanstack/angular-query-devtools

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

@tanstack/angular-query-persist-client

npm i https://pkg.pr.new/@tanstack/angular-query-persist-client@12768

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 2fc2817

@coderabbitai

coderabbitai Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The size-limit configuration defines a typical bundle check for the modern React Query build. The pull request workflow passes the size-limit command with JSON output.

Changes: React Query bundle size limit

Layer / File(s) Summary
Configure the typical React bundle size check
.size-limit.json, .github/workflows/pr.yml
Adds a size-limit entry for the modern React Query build. It imports useQuery, useMutation, QueryClient, and QueryClientProvider, ignores react and react-dom, and sets a 10.00 kB limit. The workflow passes ./node_modules/.bin/size-limit --json to the Size Limit step.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Suggested reviewers: alemtuzlak, harry-whorlow

Merge Risk: Minimal · up to 2fc28

This change adds a bundle size check and adjusts the CI command that runs it. It does not affect shipped behavior, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "chore: measure the typical React Query bundle size" matches the main change. The PR adds a react typical Size Limit entry that measures useQuery, useMutation, QueryClient, and QueryClient…
Description check Passed The description follows the template structure. It includes the Changes section with motivation, the local measurement (9,336 bytes against a 10,000-byte limit), and the test commands run. The Checkli…
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.
Full details: Title check

Explanation

The title "chore: measure the typical React Query bundle size" matches the main change. The PR adds a react typical Size Limit entry that measures useQuery, useMutation, QueryClient, and QueryClientProvider. The title is specific and concise. It uses the conventional commit prefix "chore:", which fits a CI and dev-only change.

Full details: Description check

Explanation

The description follows the template structure. It includes the Changes section with motivation, the local measurement (9,336 bytes against a 10,000-byte limit), and the test commands run. The Checklist and Release Impact sections are present. The docs/CI/dev-only box is checked, which matches the CI-only change. The first contributing-guide and AI-policy boxes remain unchecked, and the test:pr box is checked. The author should confirm these boxes before merge. Those are checklist status issues, not missing content.

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 7c529b4 and 2fc2817.

Files selected for processing: 1

  • .github/workflows/pr.yml

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

@TkDodo
TkDodo requested a review from a team as a code owner December 5, 2026 18:45
@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 12.03 KB (0%)
react minimal 8.71 KB (0%)
react typical 9.12 KB (+100% 🔺)

@TkDodo
TkDodo merged commit 2b7c9a5 into main Dec 5, 2026
9 checks passed
@TkDodo
TkDodo deleted the tkdodo/add-bundlesize-typicals branch December 5, 2026 20:46
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