Releases: cloudflare/miniflare
v3.0.0-next.11
Features
-
Add support for D1 via the
d1Databases
option (#519)Note instead of providing a
D1Database
binding with the database name like Miniflare 2, we now provide a regularFetcher
service binding like the real runtime. -
Add support for the
durableObjectsPersist
option (#517) -
Log
cause
s of errors returned with theMF-Experimental-Error-Stack
header (#519) -
Propagate errors returned with the
MF-Experimental-Error-Stack
header throughdispatchFetch()
(assuming theAccept
header prevents thetext/html
-typed pretty-error page being returned) (#519)
Fixes
- Strip
MF-Custom-Service
header fromrequest
s to custom service bindings, closes #475 (#515) - Strip restricted headers from requests back from
workerd
to Miniflare, closes #476 (#515) - Allow clean exit when using the Cache API, closes #481 (#515)
- Preserve URL passed to
Miniflare#dispatchFetch()
and custom service bindingfetch()
, closes #488 (#515) - Bump
better-sqlite3
to8.1.0
allowing installation on Node 19, closes #518 (#521)
v2.12.1
⚠️ Security Update
Fixes
- Bump
undici
to5.20.0
, addressing GHSA-5r9g-qh6m-jxff and GHSA-r6ch-mqf9-qc9w. Thanks @WalshyDev and @Cherry for the PR. - Ensure global uniqueness of Durable Objects across mounts. Previously, it was possible to have multiple Durable Object instances with the same ID if they were created from different mounts. Closes #461, thanks @Finistere.
- Return a
R2MultipartUpload
instead of aPromise<R2MultipartUpload>
fromR2Bucket#resumeMultipartUpload()
. Thanks @notorca for the PR. - Copy known-lengths from
FixedLengthStream
s andRequest
/Response
body
streams when callingReadableStream#tee()
. Closes issue #506, thanks @notorca.
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.
v3.0.0-next.10
Fixes
- Ensure required scripts for WSL and Docker runtimes are included in the
npm
distribution 🤦♂️
v3.0.0-next.9
Features
- Log uncaught errors to the console with source-maps (#446)
- Respect
cf.cacheKey
when using the Cache API (#447) - Add WebSocket support to
fetch
andMiniflare#dispatchFetch
, as supported
in Workers and Miniflare 2 (#453) - Allow custom function service bindings to return WebSocket
Response
s, as
they could in Miniflare 2 (#453) - Allow the
cf
object to be customised withMiniflare#dispatchFetch
(#453) - Allow specifying
port: 0
option to bind to any accessible port (#453)
Fixes
- Fix caching of
ReadableStream
-bodiedResponse
s (#447)
v3.0.0-next.8
v3.0.0-next.7
v3.0.0-next.6
Fixes
- Allow
fetch
requests to internal IP addresses (#412) - Bump
workerd
to1.20221111.5
to fix installation issues on Windows
v3.0.0-next.4
Fixes
- Fix issue when
@miniflare/tre
was included withundici >= 5.12.0
v3.0.0-next.3
Features
- Add support for
__STATIC_CONTENT_MANIFEST
module allowing module mode sites (#398) - Add support for the DevTools inspector protocol via the
inspectorPort: <number>
option (#426) - Allow
workerd
verbose mode to be enabled via theverbose: true
option (#426) - Add support for the Cache API (#428)
- Add support for live reload via the
liveReload: true
option (#429) - Add support for SQLite as a KV/R2/cache storage backend via the
sqlite:
persist schema (#419) - Add experimental support for remote KV storage via the
remote:
persist schema (#430)