|
1 | 1 | # 🚧 Changelog |
2 | 2 |
|
| 3 | +## 2.12.0 |
| 4 | + |
| 5 | +### Features |
| 6 | + |
| 7 | +- Add support for R2 multipart upload bindings. |
| 8 | +- Add support for dynamic `import()`s. Closes |
| 9 | + [issue #456](https://github.com/cloudflare/miniflare/issues/456), thanks |
| 10 | + [@calebmer](https://github.com/calebmer). |
| 11 | +- Add support for the |
| 12 | + [`new WebSocket()` constructor](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/WebSocket). |
| 13 | + This is an alternative standard API to `fetch`-with-`Upgrade: websocket` for |
| 14 | + creating WebSocket clients. |
| 15 | +- Add support for the `nodejs_compat` compatibility flag, specifically the |
| 16 | + `node:assert`, `node:async_hooks`, `node:buffer`, `node:events`, and |
| 17 | + `node:util` modules. For now, the `experimental` compatibility flag must also |
| 18 | + be enabled to use `node:assert`, `node:buffer` or `node:events`. Thanks |
| 19 | + [@GregBrimble](https://github.com/GregBrimble) for |
| 20 | + [the PR](https://github.com/cloudflare/miniflare/pull/478). |
| 21 | +- Extract out types for test environment global helper functions. Add either |
| 22 | + `jest-environment-miniflare/globals` or `vitest-environment-miniflare/globals` |
| 23 | + to your `tsconfig.json`'s `types` array to include them. Closes |
| 24 | + [issue #94](https://github.com/cloudflare/miniflare/issues/94), thanks |
| 25 | + [@ryan-mars](https://github.com/ryan-mars). |
| 26 | + |
| 27 | + ```jsonc |
| 28 | + // tsconfig.json |
| 29 | + { |
| 30 | + "compilerOptions": { |
| 31 | + // ... |
| 32 | + "types": [ |
| 33 | + "@cloudflare/workers-types", |
| 34 | + // For Jest... |
| 35 | + "jest", |
| 36 | + "jest-environment-miniflare/globals" |
| 37 | + // ...or for Vitest |
| 38 | + "vitest-environment-miniflare/globals" |
| 39 | + ] |
| 40 | + } |
| 41 | + } |
| 42 | + ``` |
| 43 | + |
| 44 | +- Allow direct access to Durable Object instances inside testing environments. |
| 45 | + Thanks [@cdrx](https://github.com/cdrx) for |
| 46 | + [the PR](https://github.com/cloudflare/miniflare/pull/385). See |
| 47 | + [🤹 Jest Environment](https://miniflare.dev/testing/jest#constructing-durable-objects-directly) |
| 48 | + or |
| 49 | + [⚡️ Vitest Environment](https://miniflare.dev/testing/vitest#constructing-durable-objects-directly) |
| 50 | + for more details. |
| 51 | +- Forward `/cdn-cgi/scripts/*` to Cloudflare. This allows scripts such as |
| 52 | + `rocket-loader.min.js` to be loaded during development. Closes |
| 53 | + [issue #421](https://github.com/cloudflare/miniflare/issues/421), thanks |
| 54 | + [@jstevans](https://github.com/jstevans) for |
| 55 | + [the PR](https://github.com/cloudflare/miniflare/pull/422) |
| 56 | +- Implement `structuredClone` `transfer` option for Node.js versions below 17. |
| 57 | + Note Miniflare's minimum supported Node.js version is still 16.13.0. |
| 58 | +- Set default-on date for `streams_enable_constructors` and |
| 59 | + `transformstream_enable_standard_constructor` compatibility flags to |
| 60 | + `2022-11-30`. |
| 61 | +- Add support for the `DurableObjectStorage#sync()` method. See |
| 62 | + [cloudflare/workerd#87](https://github.com/cloudflare/workerd/pull/87) for |
| 63 | + details. |
| 64 | +- Accept |
| 65 | + [multiple keys in `R2Bucket#delete()`](https://community.cloudflare.com/t/2022-9-16-workers-runtime-release-notes/420496). |
| 66 | + Closes [issue #420](https://github.com/cloudflare/miniflare/issues/420), |
| 67 | + thanks [@TateB](https://github.com/TateB). |
| 68 | +- Implement the |
| 69 | + [`r2_list_honor_include`](https://developers.cloudflare.com/workers/platform/compatibility-dates/#r2-bucket-list-respects-the-include-option) |
| 70 | + compatibility flag. |
| 71 | +- Add support for the |
| 72 | + [HTTP `Range` header](https://community.cloudflare.com/t/2022-8-12-workers-runtime-release-notes/410873) |
| 73 | + to `R2Bucket#get()`. |
| 74 | +- Add support for |
| 75 | + [R2 `SHA-*` checksums](https://community.cloudflare.com/t/2022-9-16-workers-runtime-release-notes/420496), |
| 76 | + and return these from `R2Bucket#{get,head}`. |
| 77 | +- Implement the |
| 78 | + [`export_commonjs_default`/`export_commonjs_namespace`](https://developers.cloudflare.com/workers/platform/compatibility-dates/#commonjs-modules-do-not-export-a-module-namespace) |
| 79 | + compatibility flags. Note Miniflare previously implemented |
| 80 | + `export_commonjs_default` behaviour for `CommonJS` modules, but |
| 81 | + `export_commonjs_namespace` behaviour for all other types. This change |
| 82 | + switches everything to the correct `export_commonjs_default` by default, but |
| 83 | + allows old behaviour to be enabled by setting `export_commonjs_namespace`. |
| 84 | +- Add support for `D1Database#dump()` |
| 85 | +- Add support for `meta.{last_row_id,changes}` properties on D1 responses |
| 86 | + |
| 87 | +### Fixes |
| 88 | + |
| 89 | +- Fix request body type when mocking fetch requests in testing environments with |
| 90 | + `getMiniflareFetchMock()` and via the `fetchMock` option. Thanks |
| 91 | + [@robertcepa](https://github.com/robertcepa) for |
| 92 | + [the PR](https://github.com/cloudflare/miniflare/pull/423). |
| 93 | +- Respect the `maxBatchSize` setting of queue consumers. Thanks |
| 94 | + [@a-robinson](https://github.com/a-robinson) for |
| 95 | + [the PR](https://github.com/cloudflare/miniflare/pull/450). |
| 96 | +- Fix `jest-environment-miniflare`'s `homepage` URL. Thanks |
| 97 | + [@aaharu](https://github.com/aaharu) for |
| 98 | + [the PR](https://github.com/cloudflare/miniflare/pull/451). |
| 99 | +- Fix typo in R2 documentation. Thanks [@aarhus](https://github.com/aarhus) for |
| 100 | + [the PR](https://github.com/cloudflare/miniflare/pull/452). |
| 101 | +- Rename queue producer binding class to `WorkerQueue`, matching the name in the |
| 102 | + real runtime. This will enable |
| 103 | + [`workers-rs`](https://github.com/cloudflare/workers-rs) to provide queue |
| 104 | + bindings. Thanks [@zebp](https://github.com/zebp) for |
| 105 | + [the PR](https://github.com/cloudflare/miniflare/pull/455). |
| 106 | +- Reset internal body stream when cloning `Request`s and `Response`s. This |
| 107 | + ensures both clones' bodies can be read. Thanks |
| 108 | + [@DSergiu](https://github.com/DSergiu) for |
| 109 | + [the PR](https://github.com/cloudflare/miniflare/pull/449). |
| 110 | +- Bump `npx-import` to `1.1.4`, fixing `require is not defined` error when using |
| 111 | + D1. Closes [issue #400](https://github.com/cloudflare/miniflare/issues/400), |
| 112 | + thanks [@tgriesser](https://github.com/tgriesser) and |
| 113 | + [@geelen](https://github.com/geelen). |
| 114 | +- Bump `undici` to `5.11.0`, allowing third-party `FormData`/`Blob` |
| 115 | + `Request`/`Response` bodies. Closes |
| 116 | + [issue #351](https://github.com/cloudflare/miniflare/issues/351), thanks |
| 117 | + [@yusefnapora](https://github.com/yusefnapora). |
| 118 | +- Get `CryptoKey` class from global scope if available. Fixes |
| 119 | + `'instanceof' is not an object` error in Node.js 19 and above. Closes |
| 120 | + [issue #457](https://github.com/cloudflare/miniflare/issues/457), thanks |
| 121 | + [@edevil](https://github.com/edevil) and [@panva](https://github.com/panva). |
| 122 | +- Bump `better-sqlite3` to `8.0.1`, adding support for Node.js 19. |
| 123 | +- Coerce R2 keys to `string`s. |
| 124 | +- Fix return type of `D1PreparedStatement#raw()`. Closes |
| 125 | + [issue cloudflare/workers-sdk#2238](https://github.com/cloudflare/workers-sdk/issues/2238), |
| 126 | + thanks [@repository](https://github.com/repository) for |
| 127 | + [the PR](https://github.com/cloudflare/miniflare/pull/474). |
| 128 | +- Throw when calling `D1PreparedStatement#run()` with statements that return |
| 129 | + data. Closes [issue #441](https://github.com/cloudflare/miniflare/issues/441), |
| 130 | + thanks [@AlexBlokh](https://github.com/AlexBlokh). |
| 131 | +- Fix D1 response envelope format. Closes issues |
| 132 | + [#442](https://github.com/cloudflare/miniflare/issues/442) and |
| 133 | + [cloudflare/workers-sdk#2504](https://github.com/cloudflare/workers-sdk/issues/2504), |
| 134 | + thanks [@jiripospisil](https://github.com/jiripospisil) and |
| 135 | + [@demosjarco](https://github.com/demosjarco). |
| 136 | +- Fix binding/return of `BLOB`-typed values in D1 operations. Closes |
| 137 | + [cloudflare/workers-sdk#2527](https://github.com/cloudflare/workers-sdk/issues/2527), |
| 138 | + thanks [@JoshVazq](https://github.com/JoshVazq). |
| 139 | +- Ensure `D1Database#{batch,exec}()` statements are executed in an implicit |
| 140 | + transaction. Closes |
| 141 | + [issue #484](https://github.com/cloudflare/miniflare/issues/484), thanks |
| 142 | + [@anthonymclaughlin](https://github.com/anthonymclaughlin). |
| 143 | +- Ensure only first statements are executed when calling |
| 144 | + `D1PreparedStatement#{first,run,all,raw}()` |
| 145 | +- Throw an error when KV expiration values exceed 32-bit signed integer bounds. |
| 146 | + Closes [issue #485](https://github.com/cloudflare/miniflare/issues/485), |
| 147 | + thanks [@huw](https://github.com/huw) for |
| 148 | + [the PR](https://github.com/cloudflare/miniflare/pull/487). |
| 149 | +- Pass through WebSocket abnormal closure code. Closes |
| 150 | + [issue #465](https://github.com/cloudflare/miniflare/issues/465), thanks |
| 151 | + [@yw662](https://github.com/yw662). |
| 152 | + |
3 | 153 | ## 2.11.0 |
4 | 154 |
|
5 | 155 | ### Features |
|
0 commit comments