Skip to content

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

Open
ofir-frd wants to merge 5 commits intobase_pr_30279_20260108_6011from
corrupted_pr_30279_20260108_6011
Open

[CORRUPTED] Synthetic Benchmark PR #30279 - refactor(web): Migrate to Unified TanStack Devtools#117
ofir-frd wants to merge 5 commits intobase_pr_30279_20260108_6011from
corrupted_pr_30279_20260108_6011

Conversation

@ofir-frd
Copy link

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

Benchmark PR langgenius#30279

Type: Corrupted (contains bugs)

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

Compliance Violation

  • Rule: Frontend Code Must Pass Linting and Type Checks
  • Language: TypeScript
  • File: web/app/components/devtools.tsx

lyzno1 and others added 5 commits December 28, 2025 22:01
Migrate from standalone React Query Devtools to the unified TanStack Devtools container.
Integrate Query and Form devtools via plugins.
Add IS_DEV environment guard for devtools component.
Remove runtime IS_DEV check from devtools component to make it pure.
Implement lazy loading and dynamic import in query-client.tsx to enable proper tree-shaking for production builds.
Replace static import of React Scan with next/dynamic + ssr:false in layout.tsx.
This ensures React Scan code is excluded from the server-side bundle and only loaded in development, improving production performance.
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