OpenCut-app / OpenCut-app/OpenCut

Render TanStack DevTools only in development mode

Open Beginner friendly
#849 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
89.8k
Forks
8.9k
PR merge metrics
No merged PRs in 30d

Description

Problem

Problem

The root route currently renders TanStackDevtools unconditionally in apps/web/src/routes/__root.tsx.

Since TanStack DevTools are primarily intended for development and debugging, rendering them in production is unnecessary and may introduce avoidable overhead.

Although the DevTools UI is typically inactive in production, conditionally rendering the component would better align with the intended usage and keep production builds focused on end users.

Solution

Proposed Solution

Render TanStackDevtools only when running in development mode by wrapping it with Vite's development flag.

Example:

{import.meta.env.DEV && (
  <TanStackDevtools
    config={{
      position: 'bottom-right',
    }}
    plugins={[
      {
        name: 'Tanstack Router',
        render: <TanStackRouterDevtoolsPanel />,
      },
    ]}
  />
)}

This change would:

  • Render DevTools only during development.
  • Keep production output cleaner.
  • Preserve the current development experience.
  • Require only a small, backward-compatible code change.
Alternative

Alternatives Considered

An alternative would be to keep the current behavior since the DevTools are not actively used by end users.

Another option would be to introduce a configuration flag to explicitly enable or disable DevTools, but using import.meta.env.DEV is simpler and follows common Vite practices.

Anything else?

This would be a small refactoring with no functional changes to the application itself.

I'd be happy to work on this change and submit a pull request if the maintainers agree that it aligns with the project's goals.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open apps/web/src/routes/__root.tsx and locate the unconditional TanStackDevtools render. Use Vite's development flag as described, then verify that the DevTools remain available in development while production output does not render them.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vite
Domain
devtools, frontend
Issue type
Refactor
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.