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: websocket
for creating WebSocket clients. -
Add support for the
nodejs_compat
compatibility flag, specifically thenode:assert
,node:async_hooks
,node:buffer
,node:events
, andnode:util
modules. For now, theexperimental
compatibility flag must also be enabled to usenode:assert
,node:buffer
ornode:events
. Thanks @GregBrimble for the PR. -
Extract out types for test environment global helper functions. Add either
jest-environment-miniflare/globals
orvitest-environment-miniflare/globals
to yourtsconfig.json
'stypes
array to include them. Closes issue #94, thanks @ryan-mars.// tsconfig.json { "compilerOptions": { // ... "types": [ "@cloudflare/workers-types", // For Jest... "jest", "jest-environment-miniflare/globals" // ...or for Vitest "vitest-environment-miniflare/globals" ] } }
-
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.js
to be loaded during development. Closes issue #421, thanks @jstevans for the PR -
Implement
structuredClone
transfer
option 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_constructors
andtransformstream_enable_standard_constructor
compatibility 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_include
compatibility flag. -
Add support for the HTTP
Range
header toR2Bucket#get()
. -
Add support for R2
SHA-*
checksums, and return these fromR2Bucket#{get,head}
. -
Implement the
export_commonjs_default
/export_commonjs_namespace
compatibility flags. Note Miniflare previously implementedexport_commonjs_default
behaviour forCommonJS
modules, butexport_commonjs_namespace
behaviour for all other types. This change switches everything to the correctexport_commonjs_default
by 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 thefetchMock
option. Thanks @robertcepa for the PR. - Respect the
maxBatchSize
setting of queue consumers. Thanks @a-robinson for the PR. - Fix
jest-environment-miniflare
'shomepage
URL. 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-rs
to provide queue bindings. Thanks @zebp for the PR. - Reset internal body stream when cloning
Request
s andResponse
s. This ensures both clones' bodies can be read. Thanks @DSergiu for the PR. - Bump
npx-import
to1.1.4
, fixingrequire is not defined
error when using D1. Closes issue #400, thanks @tgriesser and @geelen. - Bump
undici
to5.11.0
, allowing third-partyFormData
/Blob
Request
/Response
bodies. Closes issue #351, thanks @yusefnapora. - Get
CryptoKey
class from global scope if available. Fixes'instanceof' is not an object
error in Node.js 19 and above. Closes issue #457, thanks @edevil and @panva. - Bump
better-sqlite3
to8.0.1
, adding support for Node.js 19. - Coerce R2 keys to
string
s. - 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.