Skip to content

Commit 89b1493

Browse files
feat: improve open source funtionality (#61)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 578a3b8 commit 89b1493

File tree

16 files changed

+1251
-33
lines changed

16 files changed

+1251
-33
lines changed

.changeset/rude-ideas-carry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/devtools-vite': patch
3+
---
4+
5+
add better handling for open source to respect parent info

docs/config.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@
2424
{
2525
"label": "Installation",
2626
"to": "installation"
27+
},
28+
{
29+
"label": "Vite plugin",
30+
"to": "vite-plugin"
2731
}
2832
],
29-
3033
"frameworks": [
3134
{
3235
"label": "react",
@@ -56,7 +59,6 @@
5659
}
5760
]
5861
},
59-
6062
{
6163
"label": "Guides",
6264
"children": [],
@@ -76,7 +78,6 @@
7678
}
7779
]
7880
},
79-
8081
{
8182
"label": "API Reference",
8283
"children": [
@@ -106,7 +107,6 @@
106107
}
107108
]
108109
},
109-
110110
{
111111
"label": "Examples",
112112
"children": [],
@@ -140,4 +140,4 @@
140140
]
141141
}
142142
]
143-
}
143+
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ title: TanStackDevtools
88
# Function: TanStackDevtools()
99

1010
```ts
11-
function TanStackDevtools(__namedParameters): Element
11+
function TanStackDevtools(props): any
1212
```
1313

14-
Defined in: [devtools.tsx:96](https://github.com/TanStack/devtools/blob/main/packages/solid-devtools/src/devtools.tsx#L96)
14+
Defined in: [index.ts:4](https://github.com/TanStack/devtools/blob/main/packages/solid-devtools/src/index.ts#L4)
1515

1616
## Parameters
1717

18-
### \_\_namedParameters
18+
### props
1919

20-
`TanStackDevtoolsInit`
20+
`TanStackDevtoolsInit` & `object`
2121

2222
## Returns
2323

24-
`Element`
24+
`any`

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ title: TanStackDevtoolsSolidPlugin
1111
type TanStackDevtoolsSolidPlugin = Omit<TanStackDevtoolsPlugin, "render" | "name"> & object;
1212
```
1313

14-
Defined in: [devtools.tsx:21](https://github.com/TanStack/devtools/blob/main/packages/solid-devtools/src/devtools.tsx#L21)
14+
Defined in: [core.tsx:21](https://github.com/TanStack/devtools/blob/main/packages/solid-devtools/src/core.tsx#L21)
1515

1616
## Type declaration
1717

docs/vite-plugin.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ export default {
7070
- `editor` - The open in editor configuration which has two fields, `name` and `open`,
7171
`name` is the name of your editor, and `open` is a function that opens the editor with the given file and line number. You can implement your version for your editor as follows:
7272

73+
> [!IMPORTANT] `editor` is only needed for editors that are NOT VS Code, by default this works OOTB with VS Code.
74+
7375
```ts
7476
const open = (file: string, line: number) => {
7577
// implement your editor opening logic here
@@ -94,6 +96,16 @@ const open = (file: string, line: number) => {
9496
}
9597
```
9698

99+
- `injectSource` - Configuration for source injection. Defaults to enabled.
100+
101+
```ts
102+
{
103+
injectSource: {
104+
enabled: true
105+
}
106+
}
107+
```
108+
97109
## Features
98110

99111
### Go to source
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { Button } from './button'
2+
3+
export const ButtonWithProps = (props: { children: React.ReactNode }) => {
4+
return <Button {...props} />
5+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const Button = (props: any) => {
2+
return <button {...props} />
3+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Button } from './button'
2+
import { ButtonWithProps } from './button-with-props-only'
3+
4+
export const Feature = () => {
5+
return (
6+
<div>
7+
<h2>Feature component</h2>
8+
<Button>Nested</Button>
9+
<ButtonWithProps>With props</ButtonWithProps>
10+
</div>
11+
)
12+
}

examples/react/basic/src/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { createRoot } from 'react-dom/client'
22
import Devtools from './setup'
33
import { queryPlugin } from './plugin'
4+
import { Button } from './button'
5+
import { Feature } from './feature'
46

57
setTimeout(() => {
68
queryPlugin.emit('test', {
@@ -18,6 +20,8 @@ function App() {
1820
return (
1921
<div>
2022
<h1>TanStack Devtools React Basic Example</h1>
23+
<Button>Click me</Button>
24+
<Feature />
2125
<Devtools />
2226
</div>
2327
)

packages/devtools-vite/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"devDependencies": {
6363
"@types/babel__core": "^7.20.5",
6464
"@types/babel__generator": "^7.27.0",
65-
"@types/babel__traverse": "^7.28.0"
65+
"@types/babel__traverse": "^7.28.0",
66+
"happy-dom": "^18.0.1"
6667
}
6768
}

0 commit comments

Comments
 (0)