Features
- ⚡️ Add custom Vitest testing environment. This behaves almost identically to the Jest environment. However, isolated storage must be installed manually in each test file. Call the
setupMiniflareIsolatedStorage()
global function and use the returneddescribe
function instead of the regulardescribe
/suite
functions imported fromvitest
. See ⚡️ Vitest Environment for more details. - 🌐 Populate Workers Sites
__STATIC_CONTENT_MANIFEST
with site files instead of an empty object. Miniflare will still disable caching of Workers Sites files to ensure the most up-to-date files are always returned. Closes issues #233, #326 and cloudflare/wrangler2#1632. Thanks @ItalyPaleAle, @Skye-31, @CraigglesO, @Hexstream and @PolariTOON. - ⏱ Add global
getMiniflareWaitUntil()
method andExecutionContext
class to the Jest and Vitest testing environments. This can be used toawait
the results ofwaitUntil
edPromise
s in tests. See 🤹️ Jest Environment and ⚡️ Vitest Environment for more details. Closes issue #202, thanks @jamesarosen and @CraigglesO for the PR. - ⏳ Match Web Streams implementations with Workers runtime, closes issue #168, thanks @leviwolfe:
- Add support for the non-standard
IdentityTransformStream
class. - Add support for the
streams_enable_constructors
compatibility flag.ReadableStream
andWritableStream
constructors will throw unless this flag is enabled.ReadableByteStreamController
,ReadableStreamBYOBRequest
,ReadableStreamDefaultController
andWritableStreamDefaultController
will only be included in the sandbox if this flag is enabled. - Add support for the
transformstream_enable_standard_constructor
compatibility flag.TransformStream
will behave likeIdentityTransformStream
if this isn't enabled, ignoring custom transformers. Iftransformstream_enable_standard_constructor
is set, butstreams_enable_constructors
isn't, theTransformStream
constructor will throw.TransformStreamDefaultController
will only be included in the sandbox if both flags are enabled. - Add support for BYOB reads to the non-standard
FixedLengthStream
class.
- Add support for the non-standard
- 🇬🇧 Add support for Queues. Docs coming soon™... 👀
- 🙉 Allow calls to
addEventListener
,removeEventListener
anddispatchEvent
in modules mode. Please note, callingaddEventListener
with a special event type (e.g.fetch
,scheduled
) will log a warning prompting you to use theexport default
syntax. Closes issue #207, thanks @Electroid. - 🍟 Add experimental and highly-inaccurate request CPU time measurements. These are not representative of deployed worker performance, should only be used for relative comparisons, and may be removed in the future. Enable measurements with the
--inaccurate-cpu
/[miniflare] inaccurate_cpu
/inaccurateCpu
option. Closes issue #161. Thanks @alexandernst and @y21. - 🦄 Automatically enable watch mode when
live_reload = true
is set inwrangler.toml
.
Fixes
- Return
Response
s with immutable headers fromfetch
es to Durable Objects and service bindings. Closes issue #346, thanks @Cherry. - Fix
CryptoKey#algorithm.name
property ofNODE-ED25519
keys. Closes issue panva/jose#446, thanks @ItalyPaleAle. - Disable automatic insertion of
Sec-WebSocket-Protocol
header. Closes issue #179, thanks @aboodman and @grgbkr. - Return
Content-Length
header is customContent-Encoding
is specified. Closes issue #313, thanks @vlovich. - Require
"automatic"
instead of"auto"
for theencodeBody
option when constructingRequest
s. Closes issue #357, thanks @GregBrimble for the PR. - Remove
request.cf.cacheTtl
/request.cf.cacheTtlByStatus
support from the Cache API to match the behaviour of the Workers runtime, which only supportsrequest.cf.cacheKey
.