-
-
Notifications
You must be signed in to change notification settings - Fork 64
Closed
Description
TanStack Devtools version
v0.6.4
Framework/Library version
React v19.1.1
Describe the bug and the steps to reproduce it
After creating a production build, I can see a non-zero overhead from the devtools library and its plugins:
Since the devtools are available in development mode only, this overhead should not exist in the production build.
Actually, all devtools components add this overhead, not only TanStack Devtools, so let me know if I should create separate issues in the other libraries.
A workaround is to render the devtools components conditionally depending on the environment variable:
import {
TanStackDevtools,
} from "@tanstack/react-devtools";
import {
ReactQueryDevtoolsPanel,
} from "@tanstack/react-query-devtools";
import {
TanStackRouterDevtoolsPanel,
} from "@tanstack/react-router-devtools";
<Fragment>
{
import.meta.env.DEV
? (
<TanStackDevtools
plugins={[
{
name: "TanStack Query",
render: (
<ReactQueryDevtoolsPanel
client={queryClient}
/>
),
},
{
name: "TanStack Router",
render: (
<TanStackRouterDevtoolsPanel
router={router}
/>
),
},
]}
/>
)
: null
}
</Fragment>Steps to reproduce:
- Create a Vite (React + TypeScript) project
- (Optional) Add TanStack Query and TanStack Router with devtools
- Set up the devtools as written in the documentation
- Make a production build
- Analyze the production build (using Sonda, for example)
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
vasilii-kovalev/state-manager-examples@63b84aa
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
None
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels