🚧 Changelog
1.4.1
Fixes
- Fixed linking of modules with cyclic imports, allowing new Rust workers to be run with Miniflare. Closes issue #41, thanks @nuvanti.
- Fixed handling of
ArrayBufferViews asResponsebodies
1.4.0
Features
- Added
EventandEventTargetto the sandbox. The global scope andWebSocketnow inherit fromEventTargetsoremoveEventListeneris 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.
Fixes
- Require the
GETmethod for WebSocket upgrades, closes issue #25, thanks @ItsWendell - Added
WebSocketto the sandbox, closes issue #30, thanks @ItsWendell. Note you still need to useWebSocketPairandfetchto set up WebSocket connections. See ✉️ WebSockets for more details. - Fixed caching with
URLrequest keys, closes issue #33, thanks @TimTinkers - Disable the watcher whilst rebuilding, closes issue #34, thanks @TimTinkers
1.3.3
Features
- 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.tomlkey for the--disable-updaterflag:miniflare.disable_updater
Fixes
- Fixed the
package.jsonfile path the update checker checked against
1.3.2
Features
- 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
transactioncall
Fixes
- Upgraded
html-rewriter-wasmto version0.3.2, fixingasynchandler support, closeshtml-rewriter-wasmissue #1
1.3.1
Fixes
- Upgraded
html-rewriter-wasmto version0.3.1, fixing the return type ofElement.attributes
1.3.0
Features
- Switched to a
lol-html-based WebAssembly implementation ofHTMLRewriterfor 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
--watchflag is now assumed if--build-watch-pathis set, thanks @evanderkoogh for the PR (#8) - Added source maps to
CommonJSmodule transformation
Fixes
- Switched to real values for the
cfproperty, thanks @chase for the PR (#11) - Upgraded the TOML parser to support dotted keys, thanks @leader22 for the PR (#13)
- Added
CryptoKeyto the sandbox, thanks @mosch for the PR (#14)
1.2.0
Features
- 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
FormDatato 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
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 useMiniflare.reloadOptions()instead.
1.1.0
Features
- Added support for namespaced caches with
caches.open. See ✨ Cache for more details.
1.0.1
Fixes
- Fixed
/usr/bin/env: 'node --experimental-vm-modules': No such file or directoryerror when running the CLI in Linux. See 💻 Using the CLI for more details.
1.0.0
Breaking Changes
The first and only argument to the
Miniflareconstructor is now an object. Scripts should be specified via thescriptoption for strings and thescriptPathoption 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.getNamespacemethod has been renamed toMiniflare.getKVNamespaceLogged errors will now throw a
MiniflareErrorif no log is providedWhen using file system KV persistence, key names are now sanitised to replace special characters such as
:,/, and\. Reading keys containing these characters may now returnnullif a value was stored in the previous version.
Features
- Added support for 📚 Modules (requires
--experimental-vm-modulesflag) - Added support for 📌 Durable Objects
- Added support for ✉️ Web Sockets (client and server)
- Added support for 🛠 Builds (custom builds and
webpack/rustWrangler builds) - Added support for ⚙️ WebAssembly
- Added support for 📄 HTMLRewriter
- Made CLI
scriptparameter optional, it can now be inferred in some cases fromwrangler.toml - Added
hostoption (--host/-Hflag) for restricting hosts the HTTP server listens on - Added
Miniflare.disposemethod for cleaning up file watcher - Added
CF-*headers andcfobject to HTTP server requests - Added
cronproperty to ⏰ Scheduled Events - Added manual triggering for ⏰ Scheduled Events via
/.mf/scheduledHTTP endpoint - Added pretty error page powered by Youch
- Added many more tests
Fixes
- Fixed error if options object (containing
typeandcacheTtlproperties) passed as second parameter to KVgetmethod, closes issue #3 - Fixed error if
ArrayBufferpassed asdatatocrypto.subtle.digest("md5", data) - Fixed handling of
ignoreMethodoption forCachematchanddelete - Disabled edge caching when using Workers Sites, files are now always loaded from disk
- Provided
SetandWeakSetfrom Miniflare's realm to sandbox, removingPromise, so(async () => {})() instanceof Promiseevaluates totrue
0.1.1
Fixes
- Depend on
@mrbbot/node-fetchfrom npm instead of GitHub, closes issue #2
0.1.0
Initial Release
Features
- 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