Skip to content

Commit

Permalink
docs: Solid Query - Add overview, ts, install sections (#7368)
Browse files Browse the repository at this point in the history
  • Loading branch information
ardeora committed May 3, 2024
1 parent 538e02b commit ed12e18
Show file tree
Hide file tree
Showing 6 changed files with 601 additions and 190 deletions.
12 changes: 12 additions & 0 deletions docs/config.json
Expand Up @@ -58,9 +58,21 @@
"label": "Overview",
"to": "framework/solid/overview"
},
{
"label": "Quick Start",
"to": "framework/solid/quick-start"
},
{
"label": "Installation",
"to": "framework/solid/installation"
},
{
"label": "Devtools",
"to": "framework/solid/devtools"
},
{
"label": "TypeScript",
"to": "framework/solid/typescript"
}
]
},
Expand Down
4 changes: 1 addition & 3 deletions docs/framework/solid/devtools.md
Expand Up @@ -7,8 +7,6 @@ Wave your hands in the air and shout hooray because Solid Query comes with dedic

When you begin your Solid Query journey, you'll want these devtools by your side. They help visualize all of the inner workings of Solid Query and will likely save you hours of debugging if you find yourself in a pinch!

> Also note that you can use these devtools to observe queries, but **not mutations** (yet).
## Install and Import the Devtools

The devtools are a separate package that you need to install:
Expand All @@ -29,7 +27,7 @@ You can import the devtools like this:
import { SolidQueryDevtools } from '@tanstack/solid-query-devtools'
```

By default, Solid Query Devtools are only included in bundles when `process.env.NODE_ENV === 'development'`, so you don't need to worry about excluding them during a production build.
By default, Solid Query Devtools are only included in bundles when `isServer === true` ([`isServer`](https://github.com/solidjs/solid/blob/a72d393a07b22f9b7496e5eb93712188ccce0d28/packages/solid/web/src/index.ts#L37) comes from the `solid-js/web` package), so you don't need to worry about excluding them during a production build.

## Floating Mode

Expand Down
47 changes: 47 additions & 0 deletions docs/framework/solid/installation.md
@@ -0,0 +1,47 @@
---
id: installation
title: Installation
---

You can install Solid Query via [NPM](https://npmjs.com/),
or a good ol' `<script>` via
[ESM.sh](https://esm.sh/).

### NPM

```bash
$ npm i @tanstack/solid-query
# or
$ pnpm add @tanstack/solid-query
# or
$ yarn add @tanstack/solid-query
# or
$ bun add @tanstack/solid-query
```

> Wanna give it a spin before you download? Try out the [simple](../examples/simple) or [basic](../examples/basic) examples!
### CDN

If you're not using a module bundler or package manager, you can also use this library via an ESM-compatible CDN such as [ESM.sh](https://esm.sh/). Simply add a `<script type="module">` tag to the bottom of your HTML file:

```html
<script type="module">
import { QueryClient } from 'https://esm.sh/@tanstack/solid-query'
</script>
```

### Requirements

Solid Query is optimized for modern browsers. It is compatible with the following browsers config

```
Chrome >= 91
Firefox >= 90
Edge >= 91
Safari >= 15
iOS >= 15
Opera >= 77
```

> Depending on your environment, you might need to add polyfills. If you want to support older browsers, you need to transpile the library from `node_modules` yourselves.

0 comments on commit ed12e18

Please sign in to comment.