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
.env
files - WASM module bindings (
--wasm
,[wasm_modules]
) - Custom bindings
- Variables from
- The result of
dispatchScheduled
will no longer includeundefined
if 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@next
to 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_name
option. See 📌 Durable Objects for more details. - Added support for the new
__STATIC_CONTENT_MANIFEST
text module for using Workers Sites in modules mode - Throw an error when a Durable Object
fetch
handler doesn't return aResponse
- Added
queueMicrotask
to the sandbox - Added the
Miniflare#getCaches
method for accessing the globalcaches
outside workers - Added back the
sourceMap
option toMiniflare
- Changed the default location for the
update-check
andcf.json
files to insidenode_modules
- Switched the CRON validation and scheduling package from
node-cron
tocron-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
--env
flag towrangler build
when--wrangler-env
is set fortype = "webpack"
/"rust"
builds - Set correct
Host
header with--upstream
flag set - Fixed memory leak in
HTMLRewriter
when passing non-ArrayBuffer(View)
chunks - Marked
@miniflare/core
and@miniflare/storage-memory
asdependencies
of@miniflare/durable-objects
- Removed
ServiceWorkerGlobalScope#dispose()
from global scope