|
1 | 1 | # 🚧 Changelog |
2 | 2 |
|
| 3 | +## 2.0.0-rc.1 |
| 4 | + |
| 5 | +### Breaking Changes |
| 6 | + |
| 7 | +- Changed the priority of bindings, so it matches Miniflare 1. The new order |
| 8 | + (from lowest to highest priority) is: |
| 9 | + 1. Variables from `wrangler.toml` `[vars]` |
| 10 | + 2. Variables from `.env` files |
| 11 | + 3. WASM module bindings (`--wasm`, `[wasm_modules]`) |
| 12 | + 4. Custom bindings |
| 13 | +- The result of `dispatchScheduled` will no longer include `undefined` if a |
| 14 | + module scheduled handler doesn't return a value |
| 15 | + |
| 16 | +### Features |
| 17 | + |
| 18 | +- Added a **custom Jest test environment for Miniflare**. This allows you to |
| 19 | + **run unit tests in the Miniflare sandbox**, with **isolated storage** for |
| 20 | + each test. Install the `jest-environment-miniflare` to get started and see |
| 21 | + [🤹 Jest Environment](https://v2.miniflare.dev/jest.html) for more details. |
| 22 | +- Added support for **running multiple workers** in the same Miniflare instance. |
| 23 | + See [🔌 Multiple Workers](https://v2.miniflare.dev/mount.html) for more |
| 24 | + details. |
| 25 | +- Added support for the Durable Object `script_name` option. See |
| 26 | + [📌 Durable Objects](https://v2.miniflare.dev/durable-objects.html#using-a-class-exported-by-another-script) |
| 27 | + for more details. |
| 28 | +- Added support for the new `__STATIC_CONTENT_MANIFEST` text module for using |
| 29 | + Workers Sites in modules mode |
| 30 | +- Throw an error when a Durable Object `fetch` handler doesn't return a |
| 31 | + `Response` |
| 32 | +- Added `queueMicrotask` to the sandbox |
| 33 | +- Added the `Miniflare#getCaches` method for accessing the global `caches` |
| 34 | + outside workers |
| 35 | +- Added back the `sourceMap` option to `Miniflare` |
| 36 | +- Changed the default location for the `update-check` and `cf.json` files to |
| 37 | + inside `node_modules` |
| 38 | +- Switched the CRON validation and scheduling package from |
| 39 | + [`node-cron`](https://www.npmjs.com/package/node-cron) to |
| 40 | + [`cron-schedule`](https://www.npmjs.com/package/cron-schedule). This improves |
| 41 | + error messages for invalid CRON expressions, and removes a transitive |
| 42 | + dependency on `moment-timezone`, reducing the installation size by a further |
| 43 | + 5MB. |
| 44 | + |
| 45 | +### Fixes |
| 46 | + |
| 47 | +- Allow any close code when a client closes a WebSocket connection. Closes |
| 48 | + [issue #86](https://github.com/cloudflare/miniflare/issues/86), thanks |
| 49 | + [@TimTinkers](https://github.com/TimTinkers). |
| 50 | +- Wait for worker response before opening WebSocket in client, closes |
| 51 | + [issue #88](https://github.com/cloudflare/miniflare/issues/88), thanks |
| 52 | + [@TimTinkers](https://github.com/TimTinkers). |
| 53 | +- Pass the `--env` flag to `wrangler build` when `--wrangler-env` is set for |
| 54 | + `type = "webpack"`/`"rust"` builds |
| 55 | +- Set correct `Host` header with `--upstream` flag set |
| 56 | +- Fixed memory leak in `HTMLRewriter` when passing non-`ArrayBuffer(View)` |
| 57 | + chunks |
| 58 | +- Marked `@miniflare/core` and `@miniflare/storage-memory` as `dependencies` of |
| 59 | + `@miniflare/durable-objects` |
| 60 | +- Removed `ServiceWorkerGlobalScope#dispose()` from global scope |
| 61 | + |
3 | 62 | ## 2.0.0-next.3 |
4 | 63 |
|
5 | 64 | ### Fixes |
@@ -121,8 +180,7 @@ The docs will be updated over the next few weeks. |
121 | 180 | much information is logged to the console: |
122 | 181 |
|
123 | 182 | ```js |
124 | | - import { Miniflare } from "miniflare"; |
125 | | - import { Log, LogLevel } from "@miniflare/shared"; |
| 183 | + import { Miniflare, Log, LogLevel } from "miniflare"; |
126 | 184 |
|
127 | 185 | const mf = new Miniflare({ |
128 | 186 | log: new Log(LogLevel.DEBUG), |
@@ -150,6 +208,8 @@ The docs will be updated over the next few weeks. |
150 | 208 | MODULE2 = "module2.wasm" |
151 | 209 | ``` |
152 | 210 |
|
| 211 | +- Renamed the `buildWatchPath` option to `buildWatchPaths`. This is now an array |
| 212 | + of string paths to watch as opposed to a single string. |
153 | 213 | - Replaced the `Miniflare#reloadOptions()` method with the `Miniflare#reload()` |
154 | 214 | and `Miniflare#setOptions({ ... })` methods. `reload()` will reload options |
155 | 215 | from `wrangler.toml` (useful if not watching), and `setOptions()` accepts the |
|
0 commit comments