github cloudflare/miniflare v2.0.0-rc.3

latest releases: v2.14.2, v3.20231025.0, v3.20231023.0...
pre-release2 years ago

The Miniflare docs now include a migration guide for upgrading from version 1.

Breaking Changes

  • Mounts are no longer accessible by default via /<mount_name>. You must specify routes in wrangler.toml using the route/routes/miniflare.route/miniflare.routes options for them to be accessible. See 🔌 Multiple Workers for more details. This feature was inspired by multiflare, created by @dan-lee.
  • All file-path-valued options are now resolved relative to the --root option
  • Miniflare#dispatchFetch will now rewrite the request's URL/Host header to match the upstream URL if specified
  • convertNodeRequest no longer accepts an upstream parameter, it now always uses the request's Host header

Features

  • Make Request/Response bodys byte streams, allowing them to be read with bring-your-own-buffer readers
  • Allow setting the wrangler.toml environment when mounting workers with the CLI. For example, --mount api=./api@dev mounts the worker in the ./api directory as api, using the dev environment in ./api/wrangler.toml.
  • Allow setting the Durable Object script_name option via the CLI. For example, --do COUNTER=Counter@api binds the COUNTER Durable Object namespace using the Counter class exported by the mounted api worker.
  • Update error message when attempting to access bindings via global in modules mode for Cloudflare Pages
  • When the fetch_refuses_unknown_protocols compatibility flag isn't set, log a warning when attempting to use a protocol other than http or https
  • The upstream URL is now validated on startup if specified

Fixes

  • Copy webSocket when constructing a Response from an existing Response, closes issue #100, thanks @universse
  • Allow constructing null body with empty-string, closes issue #101, thanks @PH4NTOMiki
  • Remove ASCII whitespace from atob input, closes issue #104, thanks @dan-lee
  • Remove keys limit from Durable Objects list() method, closes issue #105, thanks @vzaramel
  • Allow Sec-WebSocket-Protocol header in WebSocket fetch, closes issue #106, thanks @f5io
  • Fix uncaught rejection when closing server-sent events connection, closes issue #107, thanks @dan-lee
  • Bump undici to 4.11.1, allowing Responses with null bodies to be cloned, closes issue #110, thanks @payellodevsupport
  • Allow forbidden header mutation on Request/Response instances, closes cloudflare/wrangler2 issue #59, thanks @oliverjam
  • Allow missing parent script with mounted workers
  • Correctly handle attempting to read a key in a namespace that is also a key when using FileStorage, and throw when trying to write in this case (this is a limitation of Miniflare's file-system storage).
  • When the fetch_refuses_unknown_protocols compatibility flag isn't set, correctly replace non-standard protocols (e.g. random://) with http:// in fetch.
  • Remove types dependency on lib.webworker
  • Incoming https requests will now have https URLs

Don't miss a new miniflare release

NewReleases is sending notifications on new releases.