Skip to content

feat: simplify EventClient types to accept unprefixed event maps#361

Merged
AlemTuzlak merged 3 commits intomainfrom
feat/simplify-event-client-types
Mar 4, 2026
Merged

feat: simplify EventClient types to accept unprefixed event maps#361
AlemTuzlak merged 3 commits intomainfrom
feat/simplify-event-client-types

Conversation

@AlemTuzlak
Copy link
Collaborator

Summary

  • EventClient<TEventMap> now accepts event maps with plain event names (e.g. 'ready', 'mounted') instead of requiring the pluginId prefix in every key (e.g. 'tanstack-devtools-core:ready')
  • Removed the complex conditional types that were stripping prefixes from emit/on/createEventPayload signatures — they now use simple keyof TEventMap & string
  • Removed the second TPluginId type parameter from EventClient entirely — the prefix is handled purely at runtime
  • Made pluginId required on TanStackDevtoolsEvent
  • Updated all examples and the devtools-client package to use unprefixed event maps

Test plan

  • All 19 unit tests pass (npm run test)
  • Both @tanstack/devtools-event-client and @tanstack/devtools-client build successfully
  • Verify autocomplete works correctly for event names in consuming packages

EventClient now accepts event maps with plain event names instead of
requiring the pluginId prefix in every key. The prefix is handled
purely at runtime. This removes the complex conditional types that
were stripping prefixes from emit/on/createEventPayload signatures.
@changeset-bot
Copy link

changeset-bot bot commented Mar 4, 2026

🦋 Changeset detected

Latest commit: eb3594f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@tanstack/devtools-event-client Patch
@tanstack/devtools-client Patch
@tanstack/devtools-vite Patch
@tanstack/devtools Patch
@tanstack/preact-devtools Patch
@tanstack/react-devtools Patch
@tanstack/solid-devtools Patch
@tanstack/vue-devtools Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@nx-cloud
Copy link

nx-cloud bot commented Mar 4, 2026

View your CI Pipeline Execution ↗ for commit eb3594f

Command Status Duration Result
nx affected --targets=test:eslint,test:sherif,t... ✅ Succeeded 5s View ↗
nx run-many --targets=build --exclude=examples/** ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-04 10:01:55 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 4, 2026

More templates

@tanstack/devtools

npm i https://pkg.pr.new/@tanstack/devtools@361

@tanstack/devtools-client

npm i https://pkg.pr.new/@tanstack/devtools-client@361

@tanstack/devtools-ui

npm i https://pkg.pr.new/@tanstack/devtools-ui@361

@tanstack/devtools-utils

npm i https://pkg.pr.new/@tanstack/devtools-utils@361

@tanstack/devtools-vite

npm i https://pkg.pr.new/@tanstack/devtools-vite@361

@tanstack/devtools-event-bus

npm i https://pkg.pr.new/@tanstack/devtools-event-bus@361

@tanstack/devtools-event-client

npm i https://pkg.pr.new/@tanstack/devtools-event-client@361

@tanstack/preact-devtools

npm i https://pkg.pr.new/@tanstack/preact-devtools@361

@tanstack/react-devtools

npm i https://pkg.pr.new/@tanstack/react-devtools@361

@tanstack/solid-devtools

npm i https://pkg.pr.new/@tanstack/solid-devtools@361

@tanstack/vue-devtools

npm i https://pkg.pr.new/@tanstack/vue-devtools@361

commit: aeb078e

@AlemTuzlak AlemTuzlak merged commit cf23787 into main Mar 4, 2026
4 checks passed
@AlemTuzlak AlemTuzlak deleted the feat/simplify-event-client-types branch March 4, 2026 10:02
@github-actions github-actions bot mentioned this pull request Mar 4, 2026
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.

1 participant