This repository was archived by the owner on Mar 13, 2025. It is now read-only.
v2.8.0
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 returneddescribefunction instead of the regulardescribe/suitefunctions imported fromvitest. See ⚡️ Vitest Environment for more details. - 🌐 Populate Workers Sites
__STATIC_CONTENT_MANIFESTwith 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 andExecutionContextclass to the Jest and Vitest testing environments. This can be used toawaitthe results ofwaitUntiledPromises 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
IdentityTransformStreamclass. - Add support for the
streams_enable_constructorscompatibility flag.ReadableStreamandWritableStreamconstructors will throw unless this flag is enabled.ReadableByteStreamController,ReadableStreamBYOBRequest,ReadableStreamDefaultControllerandWritableStreamDefaultControllerwill only be included in the sandbox if this flag is enabled. - Add support for the
transformstream_enable_standard_constructorcompatibility flag.TransformStreamwill behave likeIdentityTransformStreamif this isn't enabled, ignoring custom transformers. Iftransformstream_enable_standard_constructoris set, butstreams_enable_constructorsisn't, theTransformStreamconstructor will throw.TransformStreamDefaultControllerwill only be included in the sandbox if both flags are enabled. - Add support for BYOB reads to the non-standard
FixedLengthStreamclass.
- Add support for the non-standard
- 🇬🇧 Add support for Queues. Docs coming soon™... 👀
- 🙉 Allow calls to
addEventListener,removeEventListeneranddispatchEventin modules mode. Please note, callingaddEventListenerwith a special event type (e.g.fetch,scheduled) will log a warning prompting you to use theexport defaultsyntax. 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/inaccurateCpuoption. Closes issue #161. Thanks @alexandernst and @y21. - 🦄 Automatically enable watch mode when
live_reload = trueis set inwrangler.toml.
Fixes
- Return
Responses with immutable headers fromfetches to Durable Objects and service bindings. Closes issue #346, thanks @Cherry. - Fix
CryptoKey#algorithm.nameproperty ofNODE-ED25519keys. Closes issue panva/jose#446, thanks @ItalyPaleAle. - Disable automatic insertion of
Sec-WebSocket-Protocolheader. Closes issue #179, thanks @aboodman and @grgbkr. - Return
Content-Lengthheader is customContent-Encodingis specified. Closes issue #313, thanks @vlovich. - Require
"automatic"instead of"auto"for theencodeBodyoption when constructingRequests. Closes issue #357, thanks @GregBrimble for the PR. - Remove
request.cf.cacheTtl/request.cf.cacheTtlByStatussupport from the Cache API to match the behaviour of the Workers runtime, which only supportsrequest.cf.cacheKey.