v2.12.0
Features
-
Add support for R2 multipart upload bindings.
-
Add support for dynamic
import()s. Closes issue #456, thanks @calebmer. -
Add support for the
new WebSocket()constructor. This is an alternative standard API tofetch-with-Upgrade: websocketfor creating WebSocket clients. -
Add support for the
nodejs_compatcompatibility flag, specifically thenode:assert,node:async_hooks,node:buffer,node:events, andnode:utilmodules. For now, theexperimentalcompatibility flag must also be enabled to usenode:assert,node:bufferornode:events. Thanks @GregBrimble for the PR. -
Extract out types for test environment global helper functions. Add either
jest-environment-miniflare/globalsorvitest-environment-miniflare/globalsto yourtsconfig.json'stypesarray to include them. Closes issue #94, thanks @ryan-mars. -
Allow direct access to Durable Object instances inside testing environments. Thanks @cdrx for the PR. See 🤹 Jest Environment or ⚡️ Vitest Environment for more details.
-
Forward
/cdn-cgi/scripts/*to Cloudflare. This allows scripts such asrocket-loader.min.jsto be loaded during development. Closes issue #421, thanks @jstevans for the PR -
Implement
structuredClonetransferoption for Node.js versions below 17. Note Miniflare's minimum supported Node.js version is still 16.13.0. -
Set default-on date for
streams_enable_constructorsandtransformstream_enable_standard_constructorcompatibility flags to2022-11-30. -
Add support for the
DurableObjectStorage#sync()method. See cloudflare/workerd#87 for details. -
Accept multiple keys in
R2Bucket#delete(). Closes issue #420, thanks @TateB. -
Implement the
r2_list_honor_includecompatibility flag. -
Add support for the HTTP
Rangeheader toR2Bucket#get(). -
Add support for R2
SHA-*checksums, and return these fromR2Bucket#{get,head}. -
Implement the
export_commonjs_default/export_commonjs_namespacecompatibility flags. Note Miniflare previously implementedexport_commonjs_defaultbehaviour forCommonJSmodules, butexport_commonjs_namespacebehaviour for all other types. This change switches everything to the correctexport_commonjs_defaultby default, but allows old behaviour to be enabled by settingexport_commonjs_namespace. -
Add support for
D1Database#dump() -
Add support for
meta.{last_row_id,changes}properties on D1 responses
Fixes
- Fix request body type when mocking fetch requests in testing environments with
getMiniflareFetchMock()and via thefetchMockoption. Thanks @robertcepa for the PR. - Respect the
maxBatchSizesetting of queue consumers. Thanks @a-robinson for the PR. - Fix
jest-environment-miniflare'shomepageURL. Thanks @aaharu for the PR. - Fix typo in R2 documentation. Thanks @aarhus for the PR.
- Rename queue producer binding class to
WorkerQueue, matching the name in the real runtime. This will enableworkers-rsto provide queue bindings. Thanks @zebp for the PR. - Reset internal body stream when cloning
Requests andResponses. This ensures both clones' bodies can be read. Thanks @DSergiu for the PR. - Bump
npx-importto1.1.4, fixingrequire is not definederror when using D1. Closes issue #400, thanks @tgriesser and @geelen. - Bump
undicito5.11.0, allowing third-partyFormData/BlobRequest/Responsebodies. Closes issue #351, thanks @yusefnapora. - Get
CryptoKeyclass from global scope if available. Fixes'instanceof' is not an objecterror in Node.js 19 and above. Closes issue #457, thanks @edevil and @panva. - Bump
better-sqlite3to8.0.1, adding support for Node.js 19. - Coerce R2 keys to
strings. - Fix return type of
D1PreparedStatement#raw(). Closes issue cloudflare/workers-sdk#2238, thanks @repository for the PR. - Throw when calling
D1PreparedStatement#run()with statements that return data. Closes issue #441, thanks @AlexBlokh. - Fix D1 response envelope format. Closes issues #442 and cloudflare/workers-sdk#2504, thanks @jiripospisil and @demosjarco.
- Fix binding/return of
BLOB-typed values in D1 operations. Closes cloudflare/workers-sdk#2527, thanks @JoshVazq. - Ensure
D1Database#{batch,exec}()statements are executed in an implicit transaction. Closes issue #484, thanks @anthonymclaughlin. - Ensure only first statements are executed when calling
D1PreparedStatement#{first,run,all,raw}() - Throw an error when KV expiration values exceed 32-bit signed integer bounds. Closes issue #485, thanks @huw for the PR.
- Pass through WebSocket abnormal closure code. Closes issue #465, thanks @yw662.