github cloudflare/miniflare v2.0.0-rc.1

latest releases: v2.14.2, v3.20231025.0, v3.20231023.0...
pre-release2 years ago

Breaking Changes

  • Changed the priority of bindings, so it matches Miniflare 1. The new 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
  • The result of dispatchScheduled will no longer include undefined if a module scheduled handler doesn't return a value

Features

  • Added a custom Jest test environment for Miniflare. This allows you to run unit tests in the Miniflare sandbox, with isolated storage for each test. Install jest-environment-miniflare@next to get started and see ๐Ÿคน Jest Environment for more details.
  • Added support for running multiple workers in the same Miniflare instance. See ๐Ÿ”Œ Multiple Workers for more details.
  • Added support for the Durable Object script_name option. See ๐Ÿ“Œ Durable Objects for more details.
  • Added support for the new __STATIC_CONTENT_MANIFEST text module for using Workers Sites in modules mode
  • Throw an error when a Durable Object fetch handler doesn't return a Response
  • Added queueMicrotask to the sandbox
  • Added the Miniflare#getCaches method for accessing the global caches outside workers
  • Added back the sourceMap option to Miniflare
  • Changed the default location for the update-check and cf.json files to inside node_modules
  • Switched the CRON validation and scheduling package from node-cron to cron-schedule. This improves error messages for invalid CRON expressions, and removes a transitive dependency on moment-timezone, reducing the installation size by a further 5MB.

Fixes

  • Allow any close code when a client closes a WebSocket connection. Closes issue #86, thanks @TimTinkers.
  • Wait for worker response before opening WebSocket in client, closes issue #88, thanks @TimTinkers.
  • Pass the --env flag to wrangler build when --wrangler-env is set for type = "webpack"/"rust" builds
  • Set correct Host header with --upstream flag set
  • Fixed memory leak in HTMLRewriter when passing non-ArrayBuffer(View) chunks
  • Marked @miniflare/core and @miniflare/storage-memory as dependencies of @miniflare/durable-objects
  • Removed ServiceWorkerGlobalScope#dispose() from global scope

Don't miss a new miniflare release

NewReleases is sending notifications on new releases.