This repository was archived by the owner on Mar 13, 2025. It is now read-only.
v2.0.0-rc.3
Pre-release
Pre-release
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 inwrangler.tomlusing theroute/routes/miniflare.route/miniflare.routesoptions for them to be accessible. See 🔌 Multiple Workers for more details. This feature was inspired bymultiflare, created by @dan-lee. - All file-path-valued options are now resolved relative to the
--rootoption Miniflare#dispatchFetchwill now rewrite the request's URL/Hostheader to match the upstream URL if specifiedconvertNodeRequestno longer accepts anupstreamparameter, it now always uses the request'sHostheader
Features
- Make
Request/Responsebodys byte streams, allowing them to be read with bring-your-own-buffer readers - Allow setting the
wrangler.tomlenvironment when mounting workers with the CLI. For example,--mount api=./api@devmounts the worker in the./apidirectory asapi, using thedevenvironment in./api/wrangler.toml. - Allow setting the Durable Object
script_nameoption via the CLI. For example,--do COUNTER=Counter@apibinds theCOUNTERDurable Object namespace using theCounterclass exported by the mountedapiworker. - Update error message when attempting to access bindings via global in modules mode for Cloudflare Pages
- When the
fetch_refuses_unknown_protocolscompatibility flag isn't set, log a warning when attempting to use a protocol other thanhttporhttps - The upstream URL is now validated on startup if specified
Fixes
- Copy
webSocketwhen constructing aResponsefrom an existingResponse, closes issue #100, thanks @universse - Allow constructing
nullbody with empty-string, closes issue #101, thanks @PH4NTOMiki - Remove ASCII whitespace from
atobinput, closes issue #104, thanks @dan-lee - Remove keys limit from Durable Objects
list()method, closes issue #105, thanks @vzaramel - Allow
Sec-WebSocket-Protocolheader in WebSocketfetch, closes issue #106, thanks @f5io - Fix uncaught rejection when closing server-sent events connection, closes issue #107, thanks @dan-lee
- Bump
undicito4.11.1, allowingResponses withnullbodies to be cloned, closes issue #110, thanks @payellodevsupport - Allow forbidden header mutation on
Request/Responseinstances, 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_protocolscompatibility flag isn't set, correctly replace non-standard protocols (e.g.random://) withhttp://infetch. - Remove types dependency on
lib.webworker - Incoming
httpsrequests will now havehttpsURLs