Skip to content

Commit c4c7d93

Browse files
committed
feat(devtools): update to devtools utils, add solid devtools
1 parent efa5dd7 commit c4c7d93

File tree

49 files changed

+706
-149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+706
-149
lines changed

.changeset/config.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@
88
"access": "public",
99
"baseBranch": "main",
1010
"updateInternalDependencies": "patch",
11-
"fixed": [],
11+
"fixed": [
12+
[
13+
"@tanstack/form-devtools",
14+
"@tanstack/react-form-devtools",
15+
"@tanstack/solid-form-devtools"
16+
]
17+
],
1218
"linked": [],
1319
"ignore": []
1420
}

.changeset/petite-ducks-cough.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@tanstack/react-form-devtools': minor
3+
'@tanstack/solid-form-devtools': minor
4+
'@tanstack/form-devtools': minor
5+
---
6+
7+
Migrated to devtools utils, adds support for solid devtools. Renamed plugin to reflect tanstack plugin schema (FormDevtoolsPlugin to formDevtoolsPlugin)

codecov.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ coverage:
99
ignore:
1010
- 'packages/form-devtools'
1111
- 'packages/react-form-devtools'
12+
- 'packages/solid-form-devtools'

docs/framework/react/guides/devtools.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ createRoot(document.getElementById('root')!).render(
3030
)
3131
```
3232

33-
Import the `FormDevtoolsPlugin` from **TanStack Form** and provide it to the `TanStackDevtools` component.
33+
Import the `formDevtoolsPlugin` from **TanStack Form** and provide it to the `TanStackDevtools` component.
3434

3535
```tsx
3636
import { TanStackDevtools } from '@tanstack/react-devtools'
37-
import { FormDevtoolsPlugin } from '@tanstack/react-form-devtools'
37+
import { formDevtoolsPlugin } from '@tanstack/react-form-devtools'
3838

3939
import App from './App'
4040

4141
createRoot(document.getElementById('root')!).render(
4242
<StrictMode>
4343
<App />
4444

45-
<TanStackDevtools plugins={[FormDevtoolsPlugin()]} />
45+
<TanStackDevtools plugins={[formDevtoolsPlugin()]} />
4646
</StrictMode>,
4747
)
4848
```
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
id: devtools
3+
title: Devtools
4+
---
5+
6+
TanStack Form comes with a ready to go suit of devtools.
7+
8+
## Setup
9+
10+
Install the [TanStack Devtools](https://tanstack.com/devtools/latest/docs/quick-start) library and the [TanStack Form plugin](http://npmjs.com/package/@tanstack/solid-form-devtools), from the framework adapter that your working in (in this case `@tanstack/solid-devtools`, and `@tanstack/solid-form-devtools`).
11+
12+
```bash
13+
npm i @tanstack/solid-devtools
14+
npm i @tanstack/solid-form-devtools
15+
```
16+
17+
Next in the root of your application import the `TanStackDevtools`.
18+
19+
```tsx
20+
import { TanStackDevtools } from '@tanstack/solid-devtools'
21+
22+
import App from './App'
23+
24+
render(
25+
() => (
26+
<>
27+
<App />
28+
29+
<TanStackDevtools />
30+
</>
31+
),
32+
root!,
33+
)
34+
```
35+
36+
Import the `formDevtoolsPlugin` from **TanStack Form** and provide it to the `TanStackDevtools` component.
37+
38+
```tsx
39+
import { TanStackDevtools } from '@tanstack/solid-devtools'
40+
import { formDevtoolsPlugin } from '@tanstack/solid-form-devtools'
41+
42+
import App from './app'
43+
44+
const root = document.getElementById('root')
45+
46+
render(
47+
() => (
48+
<>
49+
<App />
50+
51+
<TanStackDevtools plugins={[formDevtoolsPlugin()]} />
52+
</>
53+
),
54+
root!,
55+
)
56+
```
57+
58+
Finally add any additional configuration you desire to the `TanStackDevtools` component, more information can be found under the [TanStack Devtools Configuration](https://tanstack.com/devtools/) section.
59+
60+
A complete working example can be found in our [examples section](https://tanstack.com/form/latest/docs/framework/solid/examples/devtools).

examples/react/array/src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react'
22
import { createRoot } from 'react-dom/client'
33

44
import { TanStackDevtools } from '@tanstack/react-devtools'
5-
import { FormDevtoolsPlugin } from '@tanstack/react-form-devtools'
5+
import { formDevtoolsPlugin } from '@tanstack/react-form-devtools'
66
import { useForm } from '@tanstack/react-form'
77

88
interface Person {
@@ -85,7 +85,7 @@ createRoot(rootElement).render(
8585

8686
<TanStackDevtools
8787
config={{ hideUntilHover: true }}
88-
plugins={[FormDevtoolsPlugin()]}
88+
plugins={[formDevtoolsPlugin()]}
8989
/>
9090
</React.StrictMode>,
9191
)

examples/react/devtools/src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import { StrictMode } from 'react'
22
import { createRoot } from 'react-dom/client'
33

44
import { TanStackDevtools } from '@tanstack/react-devtools'
5-
import { FormDevtoolsPlugin } from '@tanstack/react-form-devtools'
5+
import { formDevtoolsPlugin } from '@tanstack/react-form-devtools'
66

77
import App from './App'
88

99
createRoot(document.getElementById('root')!).render(
1010
<StrictMode>
1111
<App />
1212

13-
<TanStackDevtools plugins={[FormDevtoolsPlugin()]} />
13+
<TanStackDevtools plugins={[formDevtoolsPlugin()]} />
1414
</StrictMode>,
1515
)

examples/react/dynamic/src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { createRoot } from 'react-dom/client'
33
import { z } from 'zod'
44

55
import { TanStackDevtools } from '@tanstack/react-devtools'
6-
import { FormDevtoolsPlugin } from '@tanstack/react-form-devtools'
6+
import { formDevtoolsPlugin } from '@tanstack/react-form-devtools'
77
import { revalidateLogic, useForm } from '@tanstack/react-form'
88

99
import type { AnyFieldApi } from '@tanstack/react-form'
@@ -125,7 +125,7 @@ createRoot(rootElement).render(
125125

126126
<TanStackDevtools
127127
config={{ hideUntilHover: true }}
128-
plugins={[FormDevtoolsPlugin()]}
128+
plugins={[formDevtoolsPlugin()]}
129129
/>
130130
</React.StrictMode>,
131131
)

examples/react/field-errors-from-form-validators/src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { createRoot } from 'react-dom/client'
22

33
import { useForm } from '@tanstack/react-form'
44
import { TanStackDevtools } from '@tanstack/react-devtools'
5-
import { FormDevtoolsPlugin } from '@tanstack/react-form-devtools'
5+
import { formDevtoolsPlugin } from '@tanstack/react-form-devtools'
66

77
async function sleep(ms: number) {
88
return new Promise((resolve) => {
@@ -141,7 +141,7 @@ createRoot(rootElement).render(
141141

142142
<TanStackDevtools
143143
config={{ hideUntilHover: true }}
144-
plugins={[FormDevtoolsPlugin()]}
144+
plugins={[formDevtoolsPlugin()]}
145145
/>
146146
</>,
147147
)

examples/react/large-form/src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react'
22
import { createRoot } from 'react-dom/client'
33

44
import { TanStackDevtools } from '@tanstack/react-devtools'
5-
import { FormDevtoolsPlugin } from '@tanstack/react-form-devtools'
5+
import { formDevtoolsPlugin } from '@tanstack/react-form-devtools'
66

77
import App from './App.tsx'
88

@@ -14,7 +14,7 @@ createRoot(rootElement).render(
1414

1515
<TanStackDevtools
1616
config={{ hideUntilHover: true }}
17-
plugins={[FormDevtoolsPlugin()]}
17+
plugins={[formDevtoolsPlugin()]}
1818
/>
1919
</React.StrictMode>,
2020
)

0 commit comments

Comments
 (0)