Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 1dfb005

Browse files
committed
Bump versions to 2.0.0-rc.4, update CHANGELOG.md and docs
1 parent 3be9fd9 commit 1dfb005

File tree

26 files changed

+337
-291
lines changed

26 files changed

+337
-291
lines changed

docs/CHANGELOG.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ goals:
1111
testing.
1212
2.**Lightweight:** Miniflare 1 included
1313
[122 third-party packages](http://npm.anvaka.com/#/view/2d/miniflare) with a
14-
total install size of `88.3MB`. Miniflare 2 reduces this to **24 packages and
14+
total install size of `88MB`. Miniflare 2 reduces this to **24 packages and
1515
`6MB`** by leveraging features included with Node.js 16.
1616
3.**Accurate:** Miniflare 2 more accurately replicates the quirks and thrown
1717
errors of the real Workers runtime, so you'll know before you deploy if
@@ -175,6 +175,15 @@ if you're upgrading from version 1.
175175
more likely to work with Miniflare now. Closes
176176
[issue #44](https://github.com/cloudflare/miniflare/issues/44), thanks
177177
[@TimTinkers](https://github.com/TimTinkers).
178+
- Don't crash on unhandled promise rejections when using the CLI. Instead, log
179+
them. Closes [issue #115](https://github.com/cloudflare/miniflare/issues/115),
180+
thanks [@togglydev](https://github.com/togglydev).
181+
- Limit the number of
182+
[subrequests](https://developers.cloudflare.com/workers/platform/limits#subrequests)
183+
to 50,
184+
[as per the Workers runtime](https://developers.cloudflare.com/workers/platform/limits#account-plan-limits).
185+
Closes [issue #117](https://github.com/cloudflare/miniflare/issues/117),
186+
thanks [@leader22](https://github.com/leader22) for the suggestion.
178187
- Incoming request headers are now immutable. Closes
179188
[issue #36](https://github.com/cloudflare/miniflare/issues/36), thanks
180189
[@grahamlyons](https://github.com/grahamlyons).
@@ -242,12 +251,18 @@ if you're upgrading from version 1.
242251
- **Added support for
243252
[`crypto.randomUUID()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID)**
244253
- **Added support for
245-
[`structuredClone`](https://developer.mozilla.org/en-US/docs/Web/API/structuredClone)**
254+
[`structuredClone`](https://developer.mozilla.org/en-US/docs/Web/API/structuredClone)**.
255+
Note the `transfer` option is only supported on Node.js >= 17.
246256
- **Added support for
247257
[`queueMicrotask`](https://developer.mozilla.org/en-US/docs/Web/API/queueMicrotask)**
248258
- **Added support for the `NODE-ED25519` algorithm** to `crypto.subtle.sign()`
249-
and `crypto.subtle.verify()` Note the `transfer` option is only supported on
250-
Node.js >= 17.
259+
and `crypto.subtle.verify()`
260+
- Added support for `AbortSignal.timeout()`
261+
- Added support for `crypto.DigestStream`
262+
- Added support for `scheduler.wait()`
263+
- Added support for `FixedLengthStream`. Closes
264+
[issue #123](https://github.com/cloudflare/miniflare/issues/123), thanks
265+
[@vlovich](https://github.com/vlovich).
251266
- Throw an error when attempting to create a new `TextDecoder` with a non-UTF-8
252267
encoding
253268
- Throw errors when attempting to use `FetchEvent`/`ScheduledEvent` methods with
@@ -315,7 +330,7 @@ if you're upgrading from version 1.
315330
- Throw an error if the ID passed to `DurableObjectNamespace#get(id)` is for a
316331
different Durable Object
317332
- Throw an error when keys are greater than `2KiB` or `undefined`
318-
- Throw an error when values are greater than `32KiB`
333+
- Throw an error when values are greater than `128KiB`
319334
- Throw an error when attempting to `get`, `put` or `delete` more than `128`
320335
keys, or when attempting to modify more than `128` keys in a transaction
321336
- Throw an error when attempting to `put` an `undefined` value
@@ -366,6 +381,12 @@ if you're upgrading from version 1.
366381
});
367382
```
368383

384+
- Added `--open`/`-O` option that automatically opens your browser once your
385+
worker is running. You can optionally specify a different URL to open with
386+
`--open https://example.com`. Closes
387+
[issue #121](https://github.com/cloudflare/miniflare/issues/121), thanks
388+
[@third774](https://github.com/third774) for the suggestion.
389+
369390
- **Automatically fetch the incoming `Request#cf` object** from a trusted
370391
Cloudflare endpoint, so the values are the same as you'd get for real. Closes
371392
[issue #61](https://github.com/cloudflare/miniflare/issues/61), thanks

docs/src/content/core/standards.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ Miniflare supports the following Web Standards in its sandbox:
1717

1818
- **Console:** `console.*`
1919
- **Timers:** `setTimeout`, `setInterval`, `clearTimeout`, `clearInterval`,
20-
`queueMicrotask`
20+
`queueMicrotask`, `AbortSignal.timeout`, `scheduler.wait`
2121
- **Base64:** `atob`, `btoa`
2222
- **Web Crypto**: `crypto.getRandomValues`, `crypto.randomUUID`,
2323
`crypto.subtle.*` (with support for `MD5` digests and `NODE-ED25519`
24-
signatures)
24+
signatures), `crypto.DigestStream`
2525
- **Encoding:** `TextEncoder`, `TextDecoder`
2626
- **Fetch:** `fetch`, `Headers` (including
2727
[non-standard `getAll` method](https://developers.cloudflare.com/workers/runtime-apis/headers#differences)),
@@ -32,8 +32,16 @@ Miniflare supports the following Web Standards in its sandbox:
3232
(including non-standard `readAtLeast` method), `ReadableStreamBYOBRequest`,
3333
`ReadableStreamDefaultController`, `ReadableStreamDefaultReader`,
3434
`TransformStream`, `TransformStreamDefaultController`, `WritableStream`,
35-
`WritableStreamDefaultController`, `WritableStreamDefaultWriter`
35+
`WritableStreamDefaultController`, `WritableStreamDefaultWriter`,
36+
`FixedLengthStream`
3637
- **Events:** `Event`, `EventTarget`, `AbortController`, `AbortSignal`
3738
- **Event Types:** `fetch`, `scheduled`, `unhandledrejection`,
3839
`rejectionhandled`
3940
- **Misc:** `structuredClone`
41+
42+
## Subrequests
43+
44+
Like the real workers runtime, Miniflare limits you to
45+
[50 subrequests per request](https://developers.cloudflare.com/workers/platform/limits#account-plan-limits).
46+
Each call to `fetch()`, each URL in a redirect chain, and each call to a Cache
47+
API method (`put()`/`match()`/`delete()`) counts as a subrequest.

docs/src/content/get-started/cli.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,16 @@ encrypted, use the `--https-passphrase` flag to set the passphrase:
199199
$ miniflare worker.js --https-key ./key.pem --https-cert ./cert.pem
200200
```
201201

202+
### Opening the Browser
203+
204+
Add the `--open`/`-O` flag to automatically open your default browser to the
205+
worker, once the HTTP server has started:
206+
207+
```sh
208+
$ miniflare worker.js --open # Opens http://localhost:8787
209+
$ miniflare worker.js --open https://example.com # Opens https://example.com
210+
```
211+
202212
### Update Checker
203213

204214
The CLI includes an automatic update checker that looks for new versions of

docs/src/content/storage/cache.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,10 @@ const mf = new Miniflare({
153153
```
154154

155155
</ConfigTabs>
156+
157+
## Subrequests
158+
159+
Like the real workers runtime, Miniflare limits you to
160+
[50 subrequests per request](https://developers.cloudflare.com/workers/platform/limits#account-plan-limits).
161+
Each call to `fetch()`, each URL in a redirect chain, and each call to a Cache
162+
API method (`put()`/`match()`/`delete()`) counts as a subrequest.

0 commit comments

Comments
 (0)