Workers foundations

Use Wrangler development tools

Develop locally, regenerate binding types, validate configuration, and distinguish local resources from remote production state.

8 minute lesson

~~~

Wrangler connects source, configuration, local emulation, resource bindings, deployment, and logs.

Run local development by default and use remote resources only deliberately. Regenerate types after binding changes. Keep local and production data separate so a development command cannot mutate real users’ state by surprise.

npx wrangler dev
npx wrangler types
npx wrangler deploy --dry-run

Every command has a target. Read the active Wrangler environment and binding output before running a mutation, especially when local and remote resources share similar names. Local emulation is the fast default; use a remote resource only for a test that depends on its real behavior and use disposable data.

A dry run validates packaging and configuration without publishing the Worker. It does not prove that production secrets exist, remote migrations ran, or downstream services are reachable. Keep a short deployed smoke check for those boundaries. When diagnosing a deployed request, wrangler tail is useful live evidence, but it is not stored history and can be sampled, so production observability must not depend on an open terminal.

Change one configuration variable, regenerate types, and run a dry deployment validation.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →