You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> This package changes extremely often, and is not meant to be used directly. Unless you know what you're doing, use the main package instead.
29
29
30
-
###Module overview
30
+
## Module overview
31
31
32
32
The debugger is split into four submodules:
33
33
@@ -48,33 +48,33 @@ The debugger needs to be setup before it can be used. To do that, import the `./
48
48
```ts
49
49
import'@solid-devtools/debugger/setup'
50
50
51
-
import {useDebugger} from'@solid-devtools/debugger/bundled'// or from '@solid-devtools/debugger'
51
+
import {useDebugger} from'@solid-devtools/debugger/bundled'// or from '@solid-devtools/debugger'
52
52
53
53
const debug =useDebugger()
54
54
```
55
55
56
-
###Using component locator
56
+
## Using component locator
57
57
58
58
_Debugger feature inspired by [LocatorJS](https://www.locatorjs.com)_
59
59
60
60
Locator let's you locate components on the page, and go to their source code in your IDE. All you need to do is configure it by calling `setLocatorOptions` with some options.
61
61
62
62
```ts
63
-
import {useDebugger} from'@solid-devtools/debugger'// or 'solid-devtools/setup'
63
+
import {useDebugger} from'@solid-devtools/debugger'// or 'solid-devtools/setup'
64
64
65
65
const debug =useDebugger()
66
66
debug.setLocatorOptions()
67
67
```
68
68
69
69
It will not allow you to highlight hovered components on the page and reveal them in the IDE or the Chrome Extension. _(depending of if the extension panel is open or not)_
70
70
71
-
####Locator Options
71
+
### Locator Options
72
72
73
73
Not passing any options will enable the locator with <kbd>Alt</kbd> as the trigger key and no `targetIDE` selected.
74
74
75
75
Currently Locator allows for specifying these props:
76
76
77
-
#####`targetIDE`
77
+
#### `targetIDE`
78
78
79
79
Choose in which IDE the component source code should be revealed.
80
80
@@ -111,7 +111,7 @@ setLocatorOptions({
111
111
})
112
112
```
113
113
114
-
#####`key`
114
+
#### `key`
115
115
116
116
Holding which key should enable the locator overlay? It's `"Alt"` by default — <kbd>Alt</kbd> on Windows, and <kbd>Option</kbd> or <kbd>⌥</kbd> on macOS.
117
117
@@ -123,14 +123,41 @@ setLocatorOptions({
123
123
})
124
124
```
125
125
126
-
####Using the Locator on the page
126
+
### Using the Locator on the page
127
127
128
128
To activate the Locator module — you have to hold down the <kbd>Alt</kbd>/<kbd>Option</kbd> key and move your mouse around the page to highlight components and their different HTML Elements.
129
129
130
130
Clicking the component should take you to the component source code, given that you specified the [`targetIDE`](#targetIDE) option.
By default the debugger assumes you are using `"solid-js/web"` as jsx renderer and that the rendered elements are `HTMLElement`s.
137
+
138
+
If you are using a custom renderer—such as Three.js, Pixi.js, or Lightning.js—you need to provide the debugger with an `ElementInterface` implementation.
0 commit comments