Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@
- [Router](/primitives/router.md)
- [Row and Column](/primitives/row_column.md)
- [Visible](/primitives/visible.md)
- Tooling
- [Solid Devtools](/tooling/solid_devtools.md)
63 changes: 63 additions & 0 deletions docs/tools/solid_devtols.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Integrating with Solid Devtools

[Solid Devtools](https://github.com/thetarnav/solid-devtools) provides debugging capabilities for Solid.js applications. This guide explains how to integrate solid-devtools with Lightning Solid to inspect your Lightning applications.

## Installation

For chrome-development install the [Solid Devtools Chrome Extension](https://chrome.google.com/webstore/detail/solid-devtools/kmcfjchnmmaeeagadbhoofajiopoceel).

Then, install the `solid-devtools` package:

```bash
pnpm add -D solid-devtools
```

## Configuration

### 1. Setup Vite Plugin (Optional)

Add the Solid Devtools Vite plugin to your Vite configuration file:

```ts
import devtools from 'solid-devtools/vite';
import solidPlugin from 'vite-plugin-solid';
import { defineConfig } from 'vite';

export default defineConfig({
plugins: [
devtools({
/* features options - all disabled by default */
autoname: true,
locator: {
jsxLocation: true,
componentLocation: true,
targetIDE: 'vscode',
},
}),
solidPlugin({
solid: {
moduleName: '@lightningtv/solid',
generate: 'universal',
},
}),
],
});
```

### 2. Configure Element Interface

Since Lightning.js uses a custom renderer (not DOM-based), you need to provide Solid Devtools with a custom ElementInterface implementation. Fortunately, `@lightningtv/solid` already includes this implementation.

Add the following code to your application entry file (typically `index.tsx`):

```ts
import 'solid-devtools';
import { setElementInterface } from 'solid-devtools/setup';
import { elementInterface } from '@lightningtv/solid/devtools';

setElementInterface(elementInterface);
```

This allows the Solid Devtools panel to properly display and interact with your Lightning application's component tree.

For more information on supporting custom renderers in Solid Devtools, refer to the [official documentation](https://github.com/thetarnav/solid-devtools/tree/main/packages/debugger#supporting-custom-renderers).
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
"types": "./dist/src/primitives/index.d.ts",
"default": "./dist/src/primitives/index.js"
}
},
"./devtools": {
"import": {
"@lightningtv/source": "./src/devtools/index.ts",
"types": "./dist/src/devtools/index.d.ts",
"default": "./dist/src/devtools/index.js"
}
}
},
"sideEffects": false,
Expand Down Expand Up @@ -65,7 +72,8 @@
"release-it": "^17.10.0",
"solid-js": "^1.9.3",
"typescript": "^5.7.2",
"typescript-eslint": "^8.17.0"
"typescript-eslint": "^8.17.0",
"@solid-devtools/debugger": "^0.27.0"
},
"lint-staged": {
"*.ts": [
Expand All @@ -79,6 +87,9 @@
"@solidjs/router": "^0.15.1",
"solid-js": "*"
},
"optionalDependencies": {
"@solid-devtools/debugger": "^0.27.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/lightning-tv/solid.git"
Expand Down
190 changes: 190 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading