Search Documentation

Search guides, functions, classes, interfaces, and more

Splash performance

Splash runs from disk at every cold start. Large JS delays first paint and feels broken.

Budget (FR-SP-03)

MetricTarget
Compiled JS (excluding images)under 200 KB
FrameworkPrefer plain HTML + small libs — no React/Next
ImagesOptimize; avoid multi‑MB backgrounds when possible

Practices

  1. Preload CSS, scripts, and critical images (link rel="preload").
  2. One IIFE main.js — tsup bundles @mobyapps/splash + Motion + your code (~75 KB raw / ~26 KB gzip with current demo).
  3. Use Motion (or CSS) sparingly; prefer tree-shaken ESM via the bundle over shipping the full UMD (~136 KB).
  4. Do not import @mobyapps/sdk or @mobyapps/bridge into splash.
  5. Keep src/main.ts focused on intro animation + update handler.
  6. pnpm build runs Tailwind via PostCSS with cssnano and tsup minify for main.js.

Measure

pnpm build
wc -c dist/main.js dist/styles.css

Scaffold

@mobyapps/create-splash starts from the lean HTML template. See Create splash.