Skip to content

Releases: cloudflare/miniflare

v3.0.0-next.11

27 Feb 14:57
Compare
Choose a tag to compare
v3.0.0-next.11 Pre-release
Pre-release

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 regular Fetcher service binding like the real runtime.

  • Add support for the durableObjectsPersist option (#517)

  • Log causes of errors returned with the MF-Experimental-Error-Stack header (#519)

  • Propagate errors returned with the MF-Experimental-Error-Stack header through dispatchFetch() (assuming the Accept header prevents the text/html-typed pretty-error page being returned) (#519)

Fixes

  • Strip MF-Custom-Service header from requests 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 binding fetch(), closes #488 (#515)
  • Bump better-sqlite3 to 8.1.0 allowing installation on Node 19, closes #518 (#521)

v2.12.1

20 Feb 20:59
3dfd60b
Compare
Choose a tag to compare

⚠️ Security Update

Fixes

  • Bump undici to 5.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 a Promise<R2MultipartUpload> from R2Bucket#resumeMultipartUpload(). Thanks @notorca for the PR.
  • Copy known-lengths from FixedLengthStreams and Request/Response body streams when calling ReadableStream#tee(). Closes issue #506, thanks @notorca.

v2.12.0

14 Feb 12:10
f671590
Compare
Choose a tag to compare

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 to fetch-with-Upgrade: websocket for creating WebSocket clients.

  • Add support for the nodejs_compat compatibility flag, specifically the node:assert, node:async_hooks, node:buffer, node:events, and node:util modules. For now, the experimental compatibility flag must also be enabled to use node:assert, node:buffer or node:events. Thanks @GregBrimble for the PR.

  • Extract out types for test environment global helper functions. Add either jest-environment-miniflare/globals or vitest-environment-miniflare/globals to your tsconfig.json's types 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 as rocket-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 and transformstream_enable_standard_constructor compatibility flags to 2022-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 to R2Bucket#get().

  • Add support for R2 SHA-* checksums, and return these from R2Bucket#{get,head}.

  • Implement the export_commonjs_default/export_commonjs_namespace compatibility flags. Note Miniflare previously implemented export_commonjs_default behaviour for CommonJS modules, but export_commonjs_namespace behaviour for all other types. This change switches everything to the correct export_commonjs_default by default, but allows old behaviour to be enabled by setting export_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 the fetchMock option. Thanks @robertcepa for the PR.
  • Respect the maxBatchSize setting of queue consumers. Thanks @a-robinson for the PR.
  • Fix jest-environment-miniflare's homepage 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 enable workers-rs to provide queue bindings. Thanks @zebp for the PR.
  • Reset internal body stream when cloning Requests and Responses. This ensures both clones' bodies can be read. Thanks @DSergiu for the PR.
  • Bump npx-import to 1.1.4, fixing require is not defined error when using D1. Closes issue #400, thanks @tgriesser and @geelen.
  • Bump undici to 5.11.0, allowing third-party FormData/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 to 8.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.

v3.0.0-next.10

14 Dec 15:39
Compare
Choose a tag to compare
v3.0.0-next.10 Pre-release
Pre-release

Fixes

  • Ensure required scripts for WSL and Docker runtimes are included in the npm distribution 🤦‍♂️

v3.0.0-next.9

13 Dec 18:49
Compare
Choose a tag to compare
v3.0.0-next.9 Pre-release
Pre-release

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 and Miniflare#dispatchFetch, as supported
    in Workers and Miniflare 2 (#453)
  • Allow custom function service bindings to return WebSocket Responses, as
    they could in Miniflare 2 (#453)
  • Allow the cf object to be customised with Miniflare#dispatchFetch (#453)
  • Allow specifying port: 0 option to bind to any accessible port (#453)

Fixes

  • Fix caching of ReadableStream-bodied Responses (#447)

v3.0.0-next.8

12 Dec 20:01
Compare
Choose a tag to compare
v3.0.0-next.8 Pre-release
Pre-release

Features

  • Export Fetch API classes, types and functions from @miniflare/tre (#440, thanks @GregBrimble)

Fixes

  • Fix Linux and WSL support (#443, #445)
  • Use correct binding name for kvNamespaces/r2Buckets specified as string[]s (#439, thanks @sgentle)

v3.0.0-next.7

18 Nov 12:34
f42ea31
Compare
Choose a tag to compare
v3.0.0-next.7 Pre-release
Pre-release

Features

  • Allow kvNamespaces/r2Buckets to be specified as string[]s like in Miniflare 2 (#432)
  • Add configurable logger (#434)
  • Add support for workerd's network, external and disk services (#435)
  • Add support for pretty-error pages (#436)

Fixes

  • Enable cache persistence (#433)
  • Disable caching of Workers Sites assets (#433)
  • Respect cache: false option to disable caching (#433)
  • Respect cacheWarnUsage: true option for workers.dev subdomains (#433)

v3.0.0-next.6

15 Nov 17:52
Compare
Choose a tag to compare
v3.0.0-next.6 Pre-release
Pre-release

Fixes

  • Allow fetch requests to internal IP addresses (#412)
  • Bump workerd to 1.20221111.5 to fix installation issues on Windows

v3.0.0-next.4

14 Nov 15:38
Compare
Choose a tag to compare
v3.0.0-next.4 Pre-release
Pre-release

Fixes

  • Fix issue when @miniflare/tre was included with undici >= 5.12.0

v3.0.0-next.3

14 Nov 15:10
Compare
Choose a tag to compare
v3.0.0-next.3 Pre-release
Pre-release

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 the verbose: 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)

Fixes

  • Pass --experimental flag to workerd allowing compatibility flags without a default-on compatibility date to be used (#397)
  • Fix KV cacheTtl validation (#416)
  • Respect port and host options (#424)
  • Apply setOptions() in execution order (#425)