Skip to main content

Idle and speculative work

Generated from pattern-library/registry.json — do not edit by hand; change the registry and run bun run patterns:build.

Index card — the docs below are the canonical explanation; deep-tier pattern pages additionally carry invariants and emulation notes.

Category: Interaction Velocity · Tier: light · Maturity: implemented · Risk: low — never on a correctness path

Useful non-critical preparation performed after the page is interactive: preloading probable code, hydrating embeds on intersection, and the PWA's idle update toast, which never calls skipWaiting on its own.

When to use: Use to spend the idle time between the critical render and the next interaction — warming caches, loading probable feature code, preparing indexes.

Docs

Code

  • src/lib/nav/preload.ts — preloadOnIdle, with the Safari timeout fallback (GitHub · GitLab)
  • src/lib/actions/hydrate-embeds.ts — Hydrates on intersection rather than on load (GitHub · GitLab)

Depends on


Machine-readable record: velocity-idle-work in pattern-library/registry.json.

← Back to Pattern Library

Think this pattern could be better? Tell us how.

Leave feedback