# @svelte-lean/query/parts

> allParts and the seven optional engine parts for createClient({ parts }): nothing to do in a small app, every part in the first load of a large one.

Page: https://svelte-lean.vercel.app/query/api/parts · Markdown: https://svelte-lean.vercel.app/query/api/parts.md · Index: https://svelte-lean.vercel.app/llms.txt

The optional engine parts as values for createClient({ parts }). Small apps: nothing to do, each part loads the first time the client needs it. Large apps: include the parts statically, so they are in the first load with no loading step.

## Import

`import`

```ts
import { allParts } from '@svelte-lean/query/parts';
```

## Usage

`src/routes/+layout.svelte`

```ts
// src/routes/+layout.svelte (script): an admin panel uses every part
import { createClient } from '@svelte-lean/query';
import { http } from '@svelte-lean/query/http';
import { allParts } from '@svelte-lean/query/parts';

// Every engine part in the first load: no chunk request, no loading step.
createClient({ transport: http({ base: '/' }), parts: allParts });

import { access, limiter, polling } from '@svelte-lean/query/parts';

// Only some; the others still load on first use.
createClient({ transport: http({ base: '/' }), parts: [access, limiter, polling] });
```

## Size

Production Vite builds of a small consumer entry, Svelte external. A marginal row is the bytes the entry adds over the row it names.

| Build | Over | gzip | brotli | Budget (gzip) |
| --- | --- | --- | --- | --- |
| `every part (static, marginal)` | `query` | 3880 B | 3544 B | 4300 B |
| `query + every part (static)` | – | 15667 B | 14383 B | 15700 B |

Read from `packages/query/artifacts/size.json`. Every entry and its method: [Performance](https://svelte-lean.vercel.app/query/performance.md).

## Parts

Each export is a plain object, so a bundler keeps only the parts an application names. A part that is not listed still loads on first use.

### Exports

Runtime exports of the entry.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| # `allParts` | `readonly EnginePart[]` | – | Every part below: nothing loads lazily. |
| # `polling` | `EnginePart` | – | Polling and job watching (poll, poll.until). |
| # `connectivity` | `EnginePart` | – | Visibility, focus and network events, offline detection, parked retries. |
| # `access` | `EnginePart` | – | Access rules: verdicts, the forbidden-entry watcher, the wait for rights. |
| # `memory` | `EnginePart` | – | keep lanes and the memory budgets of unobserved entries. |
| # `limiter` | `EnginePart` | – | The per-origin priority queue with its concurrency cap. |
| # `identity` | `EnginePart` | – | Unchanged rows keep their objects across refetches. |
| # `paramIndex` | `EnginePart` | – | The index of partial targets on endpoints with many entries. |

## Guide

How to use it, with examples: [Client setup](https://svelte-lean.vercel.app/query/client.md). All entry points: [Svelte Lean Query](https://svelte-lean.vercel.app/query.md).
