Skip to content
Source
Sign inSign up
TanStack/devtools

feat(event-client): strip the root EventClient export from production by default #471

MergedAlemTuzlakmerged 9 commits intomain fromrefs/pull/471/headmerged by AlemTuzlak View on GitHub

Showing 20 changed files with 60 additions and 0 deletions (loading 17).

x
0 of 20 viewed, 20 left
12 additions and 0 deletions.changeset/event-client-production-stripping.mdAdded
View file
@@ -0,0 +1,12 @@
+---
+'@tanstack/devtools-event-client': minor
+---
+​
+The root export of `@tanstack/devtools-event-client` now resolves to a no-op
+outside development (`process.env.NODE_ENV !== 'development'`), so the real
+`EventClient` is tree-shaken out of production bundles by default.
+​
+If you want devtools events to keep working in production, import the real
+client from the new `@tanstack/devtools-event-client/production` subpath, which
+always ships the real implementation. The public API is identical between the
+two imports.
24 additions and 0 deletionsdocs/framework/angular/guides/custom-plugins.mdModified
View file
@@ -215,3 +215,27 @@
​
[tanstack-devtools:custom-devtools-plugin] Registered event to bus custom-devtools:counter-state
```
+​
+## Production builds
+​
+By default the **root import** of `@tanstack/devtools-event-client` no-ops
+outside development. When your bundler sets `process.env.NODE_ENV` to anything
+other than `'development'`, the real client is replaced by a no-op and