Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d177032
feat(angular-devtools): create angular adapter package
AlemTuzlak Mar 4, 2026
f57a1cf
fix(angular-devtools): add reactivity for input changes, remove unuse…
AlemTuzlak Mar 4, 2026
e1ac556
feat(devtools-utils): add angular support
AlemTuzlak Mar 4, 2026
5a756e5
fix: resolve angular build issues
AlemTuzlak Mar 4, 2026
7c18c00
ci: apply automated fixes
autofix-ci[bot] Mar 4, 2026
76029ca
fix: resolve lint, knip, and sherif issues
AlemTuzlak Mar 4, 2026
06e8011
feat: add Angular support with setup, adapter, and custom plugin docu…
AlemTuzlak Mar 4, 2026
1683fc8
feat(angular): angular adapter add utils and some examples, fix build
riccardoperra Mar 4, 2026
c06025d
ci: apply automated fixes
autofix-ci[bot] Mar 5, 2026
d81e976
feat: Add angular adapter and devtools-utils/angular
riccardoperra Mar 8, 2026
e3e4011
remove afterNextRender in devtools-utils
riccardoperra Mar 8, 2026
d74c1f4
fix examples
riccardoperra Mar 8, 2026
058a2ee
fix angular devtools wrong pnpm link
riccardoperra Mar 8, 2026
c52c310
feat(angular-devtools): add with-devtools provider
riccardoperra Mar 8, 2026
f16f2ff
docs(angular-devtools): update docs
riccardoperra Mar 11, 2026
dc62a0d
ci: apply automated fixes
autofix-ci[bot] Mar 11, 2026
c728cfe
chore(angular-devtools): fix examples dependencies and knip issues
riccardoperra Mar 11, 2026
fd8bb54
feat(angular-devtools): rename withDevtools to provideTanStackDevtools
riccardoperra Mar 11, 2026
ed5c27c
Merge remote-tracking branch 'origin/main' into feat/angular-adapter
riccardoperra Mar 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@
{ "label": "Basic Setup", "to": "framework/vue/basic-setup" },
{ "label": "Vue Adapter", "to": "framework/vue/adapter" }
]
},
{
"label": "angular",
"children": [
{ "label": "Basic Setup", "to": "framework/angular/basic-setup" },
{ "label": "Angular Adapter", "to": "framework/angular/adapter" }
]
}
]
},
Expand Down Expand Up @@ -89,6 +96,12 @@
"children": [
{ "label": "Custom Plugins", "to": "framework/vue/guides/custom-plugins" }
]
},
{
"label": "angular",
"children": [
{ "label": "Custom Plugins", "to": "framework/angular/guides/custom-plugins" }
]
}
]
},
Expand Down Expand Up @@ -121,6 +134,12 @@
"children": [
{ "label": "Vue Reference", "to": "framework/vue/reference/index" }
]
},
{
"label": "angular",
"children": [
{ "label": "Angular Reference", "to": "framework/angular/reference/index" }
]
}
]
},
Expand Down
46 changes: 46 additions & 0 deletions docs/devtools-utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ import type { DevtoolsPanelProps } from '@tanstack/devtools-utils/preact'

// Vue
import type { DevtoolsPanelProps } from '@tanstack/devtools-utils/vue'

// Angular
import type { DevtoolsPanelProps } from '@tanstack/devtools-utils/angular'
```

## React
Expand Down Expand Up @@ -252,6 +255,49 @@ const [MyPanel, NoOpPanel] = createVuePanel(MyDevtoolsCore)

The panel component accepts `theme` and `devtoolsProps` as props. It mounts the core instance into a `div` element on `onMounted` and calls `unmount()` on `onUnmounted`.

## Angular

### createAngularPlugin

The Angular factory takes a `name` string and an Angular component class as separate arguments, similar to the Vue API.

**Signature:**

```ts
function createAngularPlugin(
name: string,
component: Type<any>,
): readonly [Plugin, NoOpPlugin]
```

**Usage:**

```ts
import { createAngularPlugin } from '@tanstack/devtools-utils/angular'
import { MyStorePanelComponent } from './my-store-panel.component'

const [MyPlugin, NoOpPlugin] = createAngularPlugin('My Store', MyStorePanelComponent)
```

The returned functions:

- **`Plugin(inputs?)`** -- returns `{ name, component, inputs }` where `component` is your Angular component class.
- **`NoOpPlugin(inputs?)`** -- returns `{ name, component: NoOpComponent, inputs }` where the component is an empty standalone component (renders nothing visible).

Both accept an optional `inputs` object that gets forwarded to the component via `setInput()`.

### createAngularPanel

For class-based devtools cores, Angular provides `createAngularPanel`. It creates a standalone Angular component that handles mounting and unmounting the core class:

```ts
import { createAngularPanel } from '@tanstack/devtools-utils/angular'

const [MyPanel, NoOpPanel] = createAngularPanel(MyDevtoolsCore)
```

The panel component accepts `theme` and `devtoolsProps` as signal inputs. It mounts the core instance into a `div` element using `afterNextRender` and calls `unmount()` via `DestroyRef.onDestroy`.

## When to Use Factories vs Manual Plugin Objects

**Use the factories** when you are building a reusable library plugin that will be published as a package. The factories ensure:
Expand Down
82 changes: 82 additions & 0 deletions docs/framework/angular/adapter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
title: TanStack Devtools Angular Adapter
id: adapter
---

The Angular adapter wraps `TanStackDevtoolsCore` in an Angular standalone component, using Angular's `createComponent` and `ApplicationRef.attachView` to dynamically render plugins into the correct DOM containers managed by the devtools shell.

## Installation

```sh
npm install @tanstack/angular-devtools
```

## Component Inputs

The `TanStackDevtools` (selector: `tanstack-devtools`) accepts the following signal-based inputs, defined by the `TanStackDevtoolsAngularInit` interface:

| Input | Type | Description |
| --- | --- | --- |
| `plugins` | `TanStackDevtoolsAngularPlugin[]` | Array of plugins to render inside the devtools panel. |
| `config` | `Partial<TanStackDevtoolsConfig>` | Configuration for the devtools shell. Sets the initial state on first load; afterwards settings are persisted in local storage. |
| `eventBusConfig` | `ClientEventBusConfig` | Configuration for the TanStack Devtools client event bus. |

## Plugin Type

Each plugin in the `plugins` array must conform to the `TanStackDevtoolsAngularPlugin` type:

```ts
type TanStackDevtoolsAngularPlugin = {
id?: string
render: TanStackDevtoolsAngularPluginRender
name: string | Type<any>
inputs?: Record<string, any>
defaultOpen?: boolean
}
```

| Field | Type | Description |
|---------------| --- | --- |
| `id` | `string` (optional) | Unique identifier for the plugin. |
| `render` | `Type<any>` | The Angular component class to render as the plugin panel content. |
| `name` | `string \| Type<any>` | Display name for the tab title. Can be a plain string or an Angular component class for custom rendering. |
| `inputs` | `Record<string, any>` (optional) | Additional inputs passed to the plugin component via `setInput()`. |
| `defaultOpen` | `boolean` (optional) | Whether this plugin tab should be open by default. |

## Key Differences from Other Frameworks

The Angular adapter uses `component` (an Angular component class reference) instead of `render` (a JSX element) in plugin definitions. Inputs are provided through the `inputs` field and bound to the component with `setInput()`, rather than being embedded directly in a JSX expression or passed via `v-bind`.

```typescript
import { Component } from '@angular/core'
import { TanStackDevtools } from '@tanstack/angular-devtools'
import { AngularQueryDevtoolsPanel } from '@tanstack/angular-query-devtools'

@Component({
selector: 'app-root',
standalone: true,
imports: [TanStackDevtools],
template: `
<tanstack-devtools [plugins]="plugins" />
`,
})
export class App {
plugins = [
{
name: 'Angular Query',
render: AngularQueryDevtoolsPanel,
inputs: { style: 'height: 100%' },
},
]
}
```

## Exports

The `@tanstack/angular-devtools` package exports:

- **`TanStackDevtools`** -- The main Angular standalone component that renders the devtools panel.
- **`TanStackDevtoolsAngularPlugin`** (type) -- The type for plugin definitions.
- **`TanStackDevtoolsAngularInit`** (type) -- The inputs interface for the `TanStackDevtoolsComponent`.

The package depends on `@tanstack/devtools` (the core package), which provides `TanStackDevtoolsCore`, `TanStackDevtoolsConfig`, `ClientEventBusConfig`, and other core utilities.
61 changes: 61 additions & 0 deletions docs/framework/angular/basic-setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: Basic setup
id: basic-setup
---

TanStack Devtools provides you with an easy-to-use and modular client that allows you to compose multiple devtools into one easy-to-use panel.

## Setup

Install the [TanStack Devtools](https://www.npmjs.com/package/@tanstack/angular-devtools) library. This will install the devtools core as well as provide you with the Angular-specific adapter.

```bash
npm i @tanstack/angular-devtools
```

Next, in the root of your application, import the `TanStackDevtoolsComponent` from `@tanstack/angular-devtools` and add it to your template.

```typescript
import { Component } from '@angular/core'
import { TanStackDevtoolsComponent } from '@tanstack/angular-devtools'

@Component({
selector: 'app-root',
standalone: true,
imports: [TanStackDevtools],
template: `
<app-content />
<tanstack-devtools />
`,
})
export class App {}
```

Import the desired devtools and provide them to the `TanStackDevtools` via the `[plugins]` input along with a label for the menu.

```typescript
import { Component } from '@angular/core'
import { TanStackDevtools } from '@tanstack/angular-devtools'
import type { TanStackDevtoolsAngularPlugin } from '@tanstack/angular-devtools'
import { AngularQueryDevtoolsPanel } from '@tanstack/angular-query-devtools'

@Component({
selector: 'app-root',
standalone: true,
imports: [TanStackDevtools],
template: `
<app-content />
<tanstack-devtools [plugins]="plugins" />
`,
})
export class AppComponent {
plugins: Array<TanStackDevtoolsAngularPlugin> = [
{
name: 'Angular Query',
render: AngularQueryDevtoolsPanel,
},
]
}
```

Finally, add any additional configuration you desire to the `TanStackDevtools`. More information can be found under the [TanStack Devtools Configuration](../../configuration) section.
Loading