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)
| Metric | Target |
|---|---|
| Compiled JS (excluding images) | under 200 KB |
| Framework | Prefer plain HTML + small libs — no React/Next |
| Images | Optimize; avoid multi‑MB backgrounds when possible |
Practices
- Preload CSS, scripts, and critical images (
link rel="preload"). - One IIFE
main.js— tsup bundles@mobyapps/splash+ Motion + your code (~75 KB raw / ~26 KB gzip with current demo). - Use Motion (or CSS) sparingly; prefer tree-shaken ESM via the bundle over shipping the full UMD (~136 KB).
- Do not import
@mobyapps/sdkor@mobyapps/bridgeinto splash. - Keep
src/main.tsfocused on intro animation + update handler. pnpm buildruns Tailwind via PostCSS with cssnano and tsup minify formain.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.