Skip to content

Commit 64ebece

Browse files
authored
Merge pull request #8 from TanStack/chore/update-docs
chore: update jsdoc and docs
2 parents 46a1d14 + f09a556 commit 64ebece

File tree

17 files changed

+913
-332
lines changed

17 files changed

+913
-332
lines changed

.changeset/weak-items-sin.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@tanstack/react-devtools': patch
3+
'@tanstack/solid-devtools': patch
4+
'@tanstack/devtools': patch
5+
---
6+
7+
Updated the JSdoc descriptions for easier usage

docs/framework/react/reference/index.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/framework/solid/reference/functions/tanstackdevtools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ title: TanstackDevtools
1111
function TanstackDevtools(__namedParameters): Element
1212
```
1313

14-
Defined in: [devtools.tsx:32](https://github.com/TanStack/devtools/blob/main/packages/solid-devtools/src/devtools.tsx#L32)
14+
Defined in: [devtools.tsx:91](https://github.com/TanStack/devtools/blob/main/packages/solid-devtools/src/devtools.tsx#L91)
1515

1616
## Parameters
1717

docs/framework/solid/reference/type-aliases/tanstackdevtoolssolidplugin.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,43 @@ Defined in: [devtools.tsx:20](https://github.com/TanStack/devtools/blob/main/pac
2121
name: string | SolidPluginRender;
2222
```
2323

24+
Name to be displayed in the devtools UI.
25+
If a string, it will be used as the plugin name.
26+
If a function, it will be called with the mount element.
27+
28+
Example:
29+
```ts
30+
{
31+
name: "Your Plugin",
32+
render: () => <CustomPluginComponent />,
33+
}
34+
```
35+
or
36+
```ts
37+
{
38+
name: <h1>Your Plugin title</h1>,
39+
render: () => <CustomPluginComponent />,
40+
}
41+
```
42+
2443
### render
2544

2645
```ts
2746
render: SolidPluginRender;
2847
```
48+
49+
The render function can be a SolidJS element or a function that returns a SolidJS element.
50+
If it's a function, it will be called to render the plugin, otherwise it will be rendered directly.
51+
52+
Example:
53+
```ts
54+
{
55+
render: () => <CustomPluginComponent />,
56+
}
57+
```
58+
or
59+
```ts
60+
{
61+
render: <CustomPluginComponent />,
62+
}
63+
```

docs/reference/classes/tanstackdevtoolscore.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: TanStackDevtoolsCore
77

88
# Class: TanStackDevtoolsCore
99

10-
Defined in: [core.tsx:15](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/core.tsx#L15)
10+
Defined in: [core.tsx:39](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/core.tsx#L39)
1111

1212
## Constructors
1313

@@ -17,7 +17,7 @@ Defined in: [core.tsx:15](https://github.com/TanStack/devtools/blob/main/package
1717
new TanStackDevtoolsCore(init): TanStackDevtoolsCore
1818
```
1919

20-
Defined in: [core.tsx:24](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/core.tsx#L24)
20+
Defined in: [core.tsx:48](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/core.tsx#L48)
2121

2222
#### Parameters
2323

@@ -37,7 +37,7 @@ Defined in: [core.tsx:24](https://github.com/TanStack/devtools/blob/main/package
3737
mount<T>(el): void
3838
```
3939

40-
Defined in: [core.tsx:32](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/core.tsx#L32)
40+
Defined in: [core.tsx:56](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/core.tsx#L56)
4141

4242
#### Type Parameters
4343

@@ -61,7 +61,7 @@ Defined in: [core.tsx:32](https://github.com/TanStack/devtools/blob/main/package
6161
setConfig(config): void
6262
```
6363

64-
Defined in: [core.tsx:63](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/core.tsx#L63)
64+
Defined in: [core.tsx:87](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/core.tsx#L87)
6565

6666
#### Parameters
6767

@@ -81,7 +81,7 @@ Defined in: [core.tsx:63](https://github.com/TanStack/devtools/blob/main/package
8181
unmount(): void
8282
```
8383

84-
Defined in: [core.tsx:55](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/core.tsx#L55)
84+
Defined in: [core.tsx:79](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/core.tsx#L79)
8585

8686
#### Returns
8787

docs/reference/interfaces/tanstackdevtoolsinit.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ optional config: Partial<{
2525
}>;
2626
```
2727

28-
Defined in: [core.tsx:11](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/core.tsx#L11)
28+
Defined in: [core.tsx:16](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/core.tsx#L16)
29+
30+
Configuration for the devtools shell. These configuration options are used to set the
31+
initial state of the devtools when it is started for the first time. Afterwards,
32+
the settings are persisted in local storage and changed through the settings panel.
2933

3034
***
3135

@@ -35,4 +39,22 @@ Defined in: [core.tsx:11](https://github.com/TanStack/devtools/blob/main/package
3539
optional plugins: TanStackDevtoolsPlugin[];
3640
```
3741

38-
Defined in: [core.tsx:12](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/core.tsx#L12)
42+
Defined in: [core.tsx:36](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/core.tsx#L36)
43+
44+
Array of plugins to be used in the devtools.
45+
Each plugin has a `render` function that gives you the dom node to mount into
46+
47+
Example:
48+
```ts
49+
const devtools = new TanStackDevtoolsCore({
50+
plugins: [
51+
{
52+
id: "your-plugin-id",
53+
name: "Your Plugin",
54+
render: (el) => {
55+
// Your render logic here
56+
},
57+
},
58+
],
59+
})
60+
```

docs/reference/interfaces/tanstackdevtoolsplugin.md

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ Defined in: [context/devtools-context.tsx:15](https://github.com/TanStack/devtoo
1717
optional id: string;
1818
```
1919

20-
Defined in: [context/devtools-context.tsx:17](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/context/devtools-context.tsx#L17)
20+
Defined in: [context/devtools-context.tsx:47](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/context/devtools-context.tsx#L47)
21+
22+
Unique identifier for the plugin.
23+
If not provided, it will be generated based on the name.
2124

2225
***
2326

@@ -27,7 +30,32 @@ Defined in: [context/devtools-context.tsx:17](https://github.com/TanStack/devtoo
2730
name: string | (el) => void;
2831
```
2932

30-
Defined in: [context/devtools-context.tsx:16](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/context/devtools-context.tsx#L16)
33+
Defined in: [context/devtools-context.tsx:42](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/context/devtools-context.tsx#L42)
34+
35+
Name to be displayed in the devtools UI.
36+
If a string, it will be used as the plugin name.
37+
If a function, it will be called with the mount element.
38+
39+
Example:
40+
```ts
41+
{
42+
// If a string, it will be used as the plugin name
43+
name: "Your Plugin",
44+
render: () => {}
45+
}
46+
```
47+
or
48+
49+
```ts
50+
{
51+
// If a function, it will be called with the mount element
52+
name: (el) => {
53+
el.innerText = "Your Plugin Name"
54+
// Your name logic here
55+
},
56+
render: () => {}
57+
}
58+
```
3159

3260
***
3361

@@ -37,14 +65,28 @@ Defined in: [context/devtools-context.tsx:16](https://github.com/TanStack/devtoo
3765
render: (el) => void;
3866
```
3967

40-
Defined in: [context/devtools-context.tsx:18](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/context/devtools-context.tsx#L18)
68+
Defined in: [context/devtools-context.tsx:61](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/context/devtools-context.tsx#L61)
69+
70+
Render the plugin UI by using the provided element. This function will be called
71+
when the plugin tab is clicked and expected to be mounted.
4172

4273
#### Parameters
4374

4475
##### el
4576

4677
`HTMLDivElement`
4778

79+
The mount element for the plugin.
80+
4881
#### Returns
4982

5083
`void`
84+
85+
void
86+
87+
Example:
88+
```ts
89+
render: (el) => {
90+
el.innerHTML = "<h1>Your Plugin</h1>"
91+
}
92+
```

docs/reference/type-aliases/tanstackdevtoolsconfig.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ title: TanStackDevtoolsConfig
1111
type TanStackDevtoolsConfig = DevtoolsStore["settings"];
1212
```
1313

14-
Defined in: [context/devtools-context.tsx:82](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/context/devtools-context.tsx#L82)
14+
Defined in: [context/devtools-context.tsx:125](https://github.com/TanStack/devtools/blob/main/packages/devtools/src/context/devtools-context.tsx#L125)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"@faker-js/faker": "^9.7.0",
5656
"@size-limit/preset-small-lib": "^11.2.0",
5757
"@svitejs/changesets-changelog-github-compact": "^1.2.0",
58-
"@tanstack/config": "0.18.0",
58+
"@tanstack/config": "0.20.0",
5959
"@testing-library/jest-dom": "^6.6.3",
6060
"@types/node": "^22.15.2",
6161
"eslint": "^9.25.1",

packages/devtools/src/components/main-panel.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import clsx from 'clsx'
22
import { useDevtoolsSettings, useHeight } from '../context/use-devtools-context'
33
import { useStyles } from '../styles/use-styles'
44
import { TANSTACK_DEVTOOLS } from '../utils/storage'
5-
import type { JSX } from 'solid-js/jsx-runtime'
6-
import type { Accessor } from 'solid-js'
5+
import type { Accessor, JSX } from 'solid-js'
76

87
export const MainPanel = (props: {
98
isOpen: Accessor<boolean>

0 commit comments

Comments
 (0)