devtools/docs/installation.md
Alem Tuzlak d7c5a93710
feat: add Svelte 5 adapter and devtools-utils Svelte factories (#366)
* docs: add Svelte devtools adapter design doc

* docs: add Svelte devtools implementation plan

* feat(svelte-devtools): add Svelte 5 adapter package

* feat(devtools-utils): add Svelte factory functions and build config

* fix: resolve knip issues and update svelte vite plugin to v6

* docs: add Svelte documentation

* chore: add changeset for Svelte adapter

* ci: apply automated fixes

* fix(svelte-devtools): mount once and tear down stale plugin components on update

- Mount the core exactly once: untrack props in the mount $effect so a prop
  change no longer destroys and rebuilds the entire devtools core (the update
  $effect already handles config/plugin changes reactively).
- update() now calls destroyAllComponents() before setConfig(), matching the
  Angular adapter — the core re-invokes render/name for the new plugin set, so
  without this the previous Svelte instances were orphaned and leaked.
- renderComponent() keys mounted components by container.id directly (the core
  always assigns one) instead of an empty-string fallback that could never be
  matched on destroy.
- vite.config: cast svelte() plugin as any, matching the vue/solid configs, to
  satisfy the vite 8 plugin types.

* chore(devtools-utils): add svelte devDependency for the svelte subpath build

The `./svelte` build type-checks svelte-importing source, so svelte must be
resolvable at build time (mirroring vite-plugin-solid for the solid build)
rather than relying on workspace hoisting of the optional peer.

* test(devtools-utils): cover svelte plugin and panel factories

Mirrors the existing solid class factory tests: createSveltePlugin shape +
NoOp behavior, and createSveltePanel mounting/tearing down a class-based core.

* ci: apply automated fixes

* refactor(devtools-utils): make createSveltePlugin generic over component props

Threads a TComponentProps generic through the svelte plugin factory (mirroring
createVuePlugin) so plugin props are type-checked against the component instead
of falling back to `any`. Addresses PR review feedback.

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-23 11:12:54 +02:00

2.2 KiB

title id
Installation installation

You can install TanStack Devtools with any NPM package manager.

Only install one of the following packages depending on your use case:

React

npm install -D @tanstack/react-devtools
npm install -D @tanstack/devtools-vite

TanStack Devtools is compatible with React v16.8+

Preact

npm install -D @tanstack/preact-devtools
npm install -D @tanstack/devtools-vite

TanStack Devtools is compatible with Preact v10+

Solid

npm install -D @tanstack/solid-devtools
npm install -D @tanstack/devtools-vite

TanStack Devtools is compatible with Solid v1.9.5+

Vue

npm install -D @tanstack/vue-devtools

The Vite plugin (@tanstack/devtools-vite) is optional for Vue — it enables additional features like source inspection and console piping but isn't required for basic usage.

npm install -D @tanstack/devtools-vite

TanStack Devtools is compatible with Vue 3+

Svelte

npm install -D @tanstack/svelte-devtools

The Vite plugin (@tanstack/devtools-vite) is optional for Svelte — it enables additional features like source inspection and console piping but isn't required for basic usage.

npm install -D @tanstack/devtools-vite

TanStack Devtools is compatible with Svelte 5+

Angular

npm install -D @tanstack/angular-devtools

The Vite plugin (@tanstack/devtools-vite) is optional for Angular — it enables additional features like source inspection and console piping but isn't required for basic usage.

npm install -D @tanstack/devtools-vite

TanStack Devtools is compatible with Angular 19+

Vanilla JS

npm install -D @tanstack/devtools

Install the core @tanstack/devtools package to use with any framework or without a framework. Each framework package up above will also re-export everything from this core package.

Production Builds

If you want to have the devtools in production builds, you can install the core @tanstack/devtools package as a regular dependency:

npm install @tanstack/devtools
npm install -D @tanstack/devtools-vite

Read more about using the devtools in production in our Production docs.