Skip to content

Commit

Permalink
Bump versions to 2.4.0, update CHANGELOG.md and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbbot committed Apr 2, 2022
1 parent bce7ecf commit 6c26e32
Show file tree
Hide file tree
Showing 29 changed files with 443 additions and 366 deletions.
30 changes: 30 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# 🚧 Changelog

## 2.4.0

### Features

- Add support for `[text_blobs]`. Closes
[issue #211](https://github.com/cloudflare/miniflare/issues/211), thanks
[@caass](https://github.com/caass) for
[the PR](https://github.com/cloudflare/miniflare/pull/228).
- Add support for `[data_blobs]`. Closes
[issue #231](https://github.com/cloudflare/miniflare/issues/231), thanks
[@threepointone](https://github.com/threepointone) for
[the PR](https://github.com/cloudflare/miniflare/pull/232).
- Do not display the pretty error page when making requests with `curl`. Closes
[issue #198](https://github.com/cloudflare/miniflare/issues/198), thanks
[@GregBrimble](https://github.com/GregBrimble) for
[the PR](https://github.com/cloudflare/miniflare/pull/210).

### Fixes

- Pass correctly-typed value to `webcrypto.getRandomValues()`. Closes
[issue #188](https://github.com/cloudflare/miniflare/issues/188), thanks
[@vlovich](https://github.com/vlovich).
- Fix `fetch` with `Content-Length: 0` header. Closes
[issue #193](https://github.com/cloudflare/miniflare/issues/193), thanks
[@orls](https://github.com/orls) for
[the PR](https://github.com/cloudflare/miniflare/pull/204).
- Bind `this` to `webcrypto` methods, fixing `crypto.getRandomValues()` and
`crypto.subtle.generateKey()`. Thanks [@szkl](https://github.com/szkl) for
[the PR](https://github.com/cloudflare/miniflare/pull/216).

## 2.3.0

### Features
Expand Down
34 changes: 33 additions & 1 deletion docs/src/content/core/variables-secrets.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,36 @@ const mf = new Miniflare({

</ConfigTabs>

## Text and Data Blobs

Text and data blobs can be loaded from files. File contents will be read and
bound as `string`s and `ArrayBuffer`s respectively.

<ConfigTabs>

```sh
$ miniflare --text-blob text.txt --data-blob data.bin
```

```toml
---
filename: wrangler.toml
---
[text_blobs]
TEXT = "text.txt"
[data_blobs]
DATA = "data.bin"
```

```js
const mf = new Miniflare({
textBlobBindings: { TEXT: "text.txt" },
dataBlobBindings: { DATA: "data.bin" },
});
```

</ConfigTabs>

## Bindings Priority

Higher priority bindings override lower priority bindings with the same name.
Expand All @@ -81,7 +111,9 @@ The order (from lowest to highest priority) is:
1. Variables from `wrangler.toml` `[vars]`
2. Variables from `.env` files
3. WASM module bindings (`--wasm`, `[wasm_modules]`)
4. Custom bindings (`--binding`, `bindings`)
4. Text blob bindings (`--text-blob`, `[text_blobs]`)
5. Data blob bindings (`--data-blob`, `[data_blobs]`)
6. Custom bindings (`--binding`, `bindings`)

## Globals

Expand Down
2 changes: 2 additions & 0 deletions docs/src/content/get-started/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,8 @@ const mf = new Miniflare({
bindings: { SECRET: "sssh" }, // Binds variable/secret to environment
globals: { LOG: () => console.log("magic") }, // Binds variable/secret to global scope
wasmBindings: { ADD_MODULE: "./add.wasm" }, // WASM module to bind
textBlobBindings: { TEXT: "./text.txt" }, // Text blob to bind
dataBlobBindings: { DATA: "./data.bin" }, // Data blob to bind
});

await mf.reload(); // Reload scripts and configuration files
Expand Down
7 changes: 7 additions & 0 deletions docs/src/content/get-started/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ Bindings Options:
-b, --binding Binds variable/secret to environment [array:KEY=VALUE]
--global Binds variable/secret to global scope [array:KEY=VALUE]
--wasm WASM module to bind [array:NAME=PATH]
--text-blob Text blob to bind [array:NAME=PATH]
--data-blob Data blob to bind [array:NAME=PATH]
-S, --service Mounted service to bind [array:NAME=MOUNT[@ENV]]
```

### Wrangler Configuration
Expand Down Expand Up @@ -348,6 +351,10 @@ globs = ["**/*.js"]

[wasm_modules] # --wasm
MODULE = "module.wasm"
[text_blobs] # --text-blob
TEXT = "text.txt"
[data_blobs] # --data-blob
DATA = "data.bin"

[miniflare]
host = "127.0.0.1" # --host
Expand Down
Loading

0 comments on commit 6c26e32

Please sign in to comment.