This repository was archived by the owner on Mar 13, 2025. It is now read-only.
v2.0.0-rc.1
Pre-release
Pre-release
Breaking Changes
- Changed the priority of bindings, so it matches Miniflare 1. The new order (from lowest to highest priority) is:
- Variables from
wrangler.toml[vars] - Variables from
.envfiles - WASM module bindings (
--wasm,[wasm_modules]) - Custom bindings
- Variables from
- The result of
dispatchScheduledwill no longer includeundefinedif a module scheduled handler doesn't return a value
Features
- Added a custom Jest test environment for Miniflare. This allows you to run unit tests in the Miniflare sandbox, with isolated storage for each test. Install
jest-environment-miniflare@nextto get started and see 🤹 Jest Environment for more details. - Added support for running multiple workers in the same Miniflare instance. See 🔌 Multiple Workers for more details.
- Added support for the Durable Object
script_nameoption. See 📌 Durable Objects for more details. - Added support for the new
__STATIC_CONTENT_MANIFESTtext module for using Workers Sites in modules mode - Throw an error when a Durable Object
fetchhandler doesn't return aResponse - Added
queueMicrotaskto the sandbox - Added the
Miniflare#getCachesmethod for accessing the globalcachesoutside workers - Added back the
sourceMapoption toMiniflare - Changed the default location for the
update-checkandcf.jsonfiles to insidenode_modules - Switched the CRON validation and scheduling package from
node-crontocron-schedule. This improves error messages for invalid CRON expressions, and removes a transitive dependency onmoment-timezone, reducing the installation size by a further 5MB.
Fixes
- Allow any close code when a client closes a WebSocket connection. Closes issue #86, thanks @TimTinkers.
- Wait for worker response before opening WebSocket in client, closes issue #88, thanks @TimTinkers.
- Pass the
--envflag towrangler buildwhen--wrangler-envis set fortype = "webpack"/"rust"builds - Set correct
Hostheader with--upstreamflag set - Fixed memory leak in
HTMLRewriterwhen passing non-ArrayBuffer(View)chunks - Marked
@miniflare/coreand@miniflare/storage-memoryasdependenciesof@miniflare/durable-objects - Removed
ServiceWorkerGlobalScope#dispose()from global scope