Skip to catalogue

76

offline-first

The phone is the source of truth until the network returns. Queue writes. Do not pretend you are online.

What is offline-first?

Offline-first means the app reads and writes a local store, and syncs when it can. The UI shows pending, failed, and conflict states. Online-only with a spinner is a different product.

Why does offline-first matter when vibe coding?

Models build mobile screens that `fetch` on mount and render nothing in a tunnel. Name offline-first or you shipped a website in a WebView costume.

How do you do offline-first?

Local read model. A queue of mutations with ids. Sync on reconnect. Surface conflicts instead of last-write-wins by accident. Show pending on the row.

How do you ask a model for offline-first?

Offline-first for (feature). Read from local storage. Queue writes with an idempotency key. Sync when online. Show pending and failed. Do not blank the screen when the network fails.

What goes wrong with offline-first?

A cache of the last GET and no write queue. That is offline-read, and you will lose the user’s edit.

adjacent