- Fixed linking of modules with cyclic imports, allowing new Rust workers to be run with Miniflare. Closes issue #41, thanks @nuvanti.
- Fixed handling of
ArrayBufferView
s asResponse
bodies
- Added
Event
andEventTarget
to the sandbox. The global scope andWebSocket
now inherit fromEventTarget
soremoveEventListener
is now supported. Closes issue #18, thanks @jayphelps. - Added workers' uncompressed size to logs, closes issue #23, thanks @ItsWendell
- Switch to lighter dependencies, thanks @lukeed. There's still lots of work to do here for the next major release.
- Require the
GET
method for WebSocket upgrades, closes issue #25, thanks @ItsWendell - Added
WebSocket
to the sandbox, closes issue #30, thanks @ItsWendell. Note you still need to useWebSocketPair
andfetch
to set up WebSocket connections. See ✉️ WebSockets for more details. - Fixed caching with
URL
request keys, closes issue #33, thanks @TimTinkers - Disable the watcher whilst rebuilding, closes issue #34, thanks @TimTinkers
- Added an option to disable default and named caches. When disabled, the caches will still be available in the sandbox, they just won't cache anything. Thanks @frandiox for the suggestion. See ✨ Cache for more details.
- Added the corresponding
wrangler.toml
key for the--disable-updater
flag:miniflare.disable_updater
- Fixed the
package.json
file path the update checker checked against
- Responses are now streamed when using the built-in HTTP(S) server
- Return values of Durable Object transaction closures are now propagated as the
return value of the
transaction
call
- Upgraded
html-rewriter-wasm
to version0.3.2
, fixingasync
handler support, closeshtml-rewriter-wasm
issue #1
- Upgraded
html-rewriter-wasm
to version0.3.1
, fixing the return type ofElement.attributes
- Switched to a
lol-html
-based WebAssembly implementation ofHTMLRewriter
for a more accurate simulation of the real Workers environment. See 📄 HTMLRewriter for more details. - Added HTTPS support for local development, thanks @RichiCoder1 for the suggestion (#12). See 💻 Using the CLI and 🧰 Using the API for more details.
- When using the CLI, the
--watch
flag is now assumed if--build-watch-path
is set, thanks @evanderkoogh for the PR (#8) - Added source maps to
CommonJS
module transformation
- Switched to real values for the
cf
property, thanks @chase for the PR (#11) - Upgraded the TOML parser to support dotted keys, thanks @leader22 for the PR (#13)
- Added
CryptoKey
to the sandbox, thanks @mosch for the PR (#14)
- Added Redis persistence support for 📦 KV, ✨ Cache and 📌 Durable Objects
- Added support for loading scripts from
package.json
, closes issue #7. See 💻 Using the CLI and ⚡️ Developing with esbuild for more details. - Added
FormData
to the sandbox, closes issue #6 - Added an automatic update checker. See 💻 Using the CLI for more details.
- 📚 Modules mode is now always enabled when specifying 📌 Durable Objects bindings
- 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 useMiniflare.reloadOptions()
instead.
- Added support for namespaced caches with
caches.open
. See ✨ Cache for more details.
- Fixed
/usr/bin/env: 'node --experimental-vm-modules': No such file or directory
error when running the CLI in Linux. See 💻 Using the CLI for more details.
-
The first and only argument to the
Miniflare
constructor is now an object. Scripts should be specified via thescript
option for strings and thescriptPath
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 toMiniflare.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 returnnull
if a value was stored in the previous version.
- Added support for 📚 Modules (requires
--experimental-vm-modules
flag) - Added support for 📌 Durable Objects
- Added support for ✉️ Web Sockets (client and server)
- Added support for 🛠 Builds (custom builds
and
webpack
/rust
Wrangler builds) - Added support for ⚙️ WebAssembly
- Added support for 📄 HTMLRewriter
- Made CLI
script
parameter optional, it can now be inferred in some cases fromwrangler.toml
- Added
host
option (--host
/-H
flag) for restricting hosts the HTTP server listens on - Added
Miniflare.dispose
method for cleaning up file watcher - Added
CF-*
headers andcf
object to HTTP server requests - Added
cron
property to ⏰ Scheduled Events - Added manual triggering for
⏰ Scheduled Events via
/.mf/scheduled
HTTP endpoint - Added pretty error page powered by Youch
- Added many more tests
- Fixed error if options object (containing
type
andcacheTtl
properties) passed as second parameter to KVget
method, closes issue #3 - Fixed error if
ArrayBuffer
passed asdata
tocrypto.subtle.digest("md5", data)
- Fixed handling of
ignoreMethod
option forCache
match
anddelete
- Disabled edge caching when using Workers Sites, files are now always loaded from disk
- Provided
Set
andWeakSet
from Miniflare's realm to sandbox, removingPromise
, so(async () => {})() instanceof Promise
evaluates totrue
- Depend on
@mrbbot/node-fetch
from npm instead of GitHub, closes issue #2
Initial Release
- Added support for 📨 Fetch Events
- Added support for ⏰ Scheduled Events
- Added support for 🔑 Variables and Secrets
- Added support for 📦 KV
- Added support for ✨ Cache
- Added support for 🌐 Workers Sites
- Added support for 🗺 Source Maps