Skip to content

Releases: cloudflare/miniflare

v1.2.0

10 Jul 17:56
Compare
Choose a tag to compare

Features

Fixes

  • Fixed Windows support, closes issue #10
  • Fixed issue where scripts were not reloaded correctly when editing script path in wrangler.toml. Scripts are now always reloaded on options change. Miniflare.reloadScript() is now deprecated. You should use Miniflare.reloadOptions() instead.

v1.1.0

03 Jul 16:11
Compare
Choose a tag to compare

Features

  • Added support for namespaced caches with caches.open. See ✨ Cache for more details.

v1.0.0

02 Jul 23:37
Compare
Choose a tag to compare

Breaking Changes

  • The first and only argument to the Miniflare constructor is now an object. Scripts should be specified via the script option for strings and the scriptPath option for files:

    // Previous version
    import vm from "vm";
    import { Miniflare } from "miniflare";
    
    const mf1 = new Miniflare(
      new vm.Script(`addEventListener("fetch", (event) => { ... })`),
      { kvPersist: true }
    );
    const mf2 = new Miniflare("script.js", { kvPersist: true });
    // New version
    import { Miniflare } from "miniflare";
    
    const mf1 = new Miniflare({
      script: `addEventListener("fetch", (event) => { ... })`,
      kvPersist: true,
    });
    const mf2 = new Miniflare({
      scriptPath: "script.js",
      kvPersist: true,
    });
  • The Miniflare.getNamespace method has been renamed to Miniflare.getKVNamespace

  • Logged errors will now throw a MiniflareError if no log is provided

  • When using file system KV persistence, key names are now sanitised to replace special characters such as :, /, and \. Reading keys containing these characters may now return null if a value was stored in the previous version.

Features

Fixes

  • Fixed error if options object (containing type and cacheTtl properties) passed as second parameter to KV get method, closes issue #3
  • Fixed error if ArrayBuffer passed as data to crypto.subtle.digest("md5", data)
  • Fixed handling of ignoreMethod option for Cache match and delete
  • Disabled edge caching when using Workers Sites, files are now always loaded from disk
  • Provide Set and WeakSet from Miniflare's realm to sandbox, removing Promise, so (async () => {})() instanceof Promise evaluates to true

v0.1.0

20 May 10:50
Compare
Choose a tag to compare
v0.1.0 Pre-release
Pre-release

Initial Release

Features