Skip to content

[CLEAN] Synthetic Benchmark PR #30279 - refactor(web): Migrate to Unified TanStack Devtools#116

Open
ofir-frd wants to merge 1 commit intobase_pr_30279_20260108_6011from
clean_pr_30279_20260108_6011
Open

[CLEAN] Synthetic Benchmark PR #30279 - refactor(web): Migrate to Unified TanStack Devtools#116
ofir-frd wants to merge 1 commit intobase_pr_30279_20260108_6011from
clean_pr_30279_20260108_6011

Conversation

@ofir-frd
Copy link

@ofir-frd ofir-frd commented Jan 8, 2026

Benchmark PR langgenius#30279

Type: Clean (correct implementation)

Original PR Title: refactor(web): Migrate to Unified TanStack Devtools
Original PR Description: ## Summary

This PR migrates the frontend devtools from the standalone @tanstack/react-query-devtools integration to the official unified TanStack Devtools container and optimizes development tools loading for production performance.

Changes

🔧 Architecture & Migration

  • Dependencies: Modified web/package.json to include @tanstack/react-devtools and @tanstack/react-form-devtools.
  • New Component: Introduced web/app/components/devtools.tsx containing the TanStackDevtoolsWrapper.
  • Integration: Updated web/context/query-client.tsx to use the new wrapper component.

⚡ Performance & Tree-Shaking

  • TanStack Devtools: Implemented lazy loading (React.lazy) and dynamic imports in query-client.tsx, ensuring devtools code is completely tree-shaken and excluded from production bundles.
  • React Scan: Refactored static import in web/app/layout.tsx to use next/dynamic with ssr: false. This ensures React Scan is only loaded in the browser during development, further reducing the initial bundle size.

Verification

  1. Run pnpm dev in the web directory.
  2. Open the application.
  3. Verify the TanStack logo appears in the bottom-right corner.
  4. Verify React Scan functionality (if enabled).
  5. (Advanced) Run a production build (pnpm build) and verify that neither TanStack Devtools nor React Scan code is included in the main bundles.

Checklist

  • I understand that this PR may be closed in case there was no previous discussion or issues.
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

Original PR URL: langgenius#30279

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