sveltelean Query
Version v0.2.0

Import

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

Usage

src/routes/+layout.svelte
// 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.

BuildOvergzipbrotliBudget (gzip)
every part (static, marginal)query3880 B3544 B4300 B
query + every part (static)–15667 B14383 B15700 B

Read from packages/query/artifacts/size.json. Every entry and its method: Performance.

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.

NameTypeDefaultDescription
# 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. All entry points: Svelte Lean Query.