Skip to content

Commit 8d3a61a

Browse files
committed
docs(event-client): clarify unset NODE_ENV behavior and fix stale stripping guidance
1 parent ea1ddfb commit 8d3a61a

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

packages/event-bus-client/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,5 @@ import { EventClient } from '@tanstack/devtools-event-client/production'
6161

6262
The public API is identical between the two imports — only the production
6363
runtime behavior differs.
64+
65+
"Outside development" includes when `NODE_ENV` is unset — common in plain Node scripts, some SSR dev servers, and test runners — so the root import resolves to the no-op there too. Set `NODE_ENV=development`, or use the `/production` subpath, to get the real client in those contexts.

packages/event-bus-client/skills/devtools-event-client/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,8 @@ when `process.env.NODE_ENV !== 'development'`, and the real client is
264264
tree-shaken out of production bundles. This is the default and what you want for
265265
most libraries — your `emit()` calls cost nothing in production.
266266

267+
"Outside development" includes when `NODE_ENV` is unset — common in plain Node scripts, some SSR dev servers, and test runners — so the root import resolves to the no-op there too. Set `NODE_ENV=development`, or use the `/production` subpath, to get the real client in those contexts.
268+
267269
```ts
268270
// dev: real client — production: no-op, removed from the bundle
269271
import { EventClient } from '@tanstack/devtools-event-client'

packages/event-bus-client/skills/devtools-instrumentation/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ if (process.env.NODE_ENV !== 'production') {
277277
}
278278
```
279279

280-
**Important:** The Vite plugin strips `@tanstack/react-devtools` from production but does NOT strip `@tanstack/devtools-event-client`. You must guard yourself.
280+
**Important:** The Vite plugin strips `@tanstack/react-devtools` from production. The root import of `@tanstack/devtools-event-client` also no-ops and is tree-shaken out when `process.env.NODE_ENV !== 'development'`, so `emit()` calls cost nothing in production by default. Import from `@tanstack/devtools-event-client/production` if you deliberately want events in production. The `enabled` option remains available for runtime control.
281281

282282
### 6. Server/Client Transparent Bridging
283283

0 commit comments

Comments
 (0)