@@ -184,13 +184,37 @@ if you're upgrading from version 1.
184184 [ as per the Workers runtime] ( https://developers.cloudflare.com/workers/platform/limits#account-plan-limits ) .
185185 Closes [ issue #117 ] ( https://github.com/cloudflare/miniflare/issues/117 ) ,
186186 thanks [ @leader22 ] ( https://github.com/leader22 ) for the suggestion.
187+ - To match the behaviour of the Workers runtime, some functionality, such as
188+ asynchronous I/O (` fetch ` , Cache API, KV), timeouts (` setTimeout ` ,
189+ ` setInterval ` ), and generating cryptographically-secure random values
190+ (` crypto.getRandomValues ` , ` crypto.subtle.generateKey ` ), can now only be
191+ performed while handling a request.
192+
193+ This behaviour can be disabled by setting the
194+ ` --global-async-io ` /` globalAsyncIO ` , ` --global-timers ` /` globalTimers ` and
195+ ` --global-random ` /` globalRandom ` options respectively, which may be useful for
196+ tests or libraries that need async I/O for setup during local development.
197+ Note the Miniflare Jest environment automatically enables these options.
198+
199+ KV namespaces and caches returned from ` Miniflare#getKVNamespace() ` and
200+ ` getCaches() ` are unaffected by this change, so they can still be used in
201+ tests without setting any additional options.
202+
203+ - To match the behaviour of the Workers runtime, Miniflare now enforces
204+ recursion depth limits. Durable Object ` fetch ` es can recurse up to 16 times,
205+ and service bindings can recurse up to 32 times. This means if a Durable
206+ Object fetch triggers another Durable Object fetch, and so on 16 times, an
207+ error will be thrown.
187208- Incoming request headers are now immutable. Closes
188209 [ issue #36 ] ( https://github.com/cloudflare/miniflare/issues/36 ) , thanks
189210 [ @grahamlyons ] ( https://github.com/grahamlyons ) .
190211- Disabled dynamic WebAssembly compilation in the Miniflare sandbox
191- - Fixed ` instanceof ` on primitives such as ` Object ` , ` Array ` , ` Promise ` , etc.
192- from outside the Miniflare sandbox. This makes it much easier to run Rust
193- workers in Miniflare, as ` wasm-bindgen ` frequently generates this code.
212+ - Added a new ` --proxy-primitive ` /` proxyPrimitiveInstanceOf: true ` option. If
213+ set, ` instanceof ` checks on primitives such as ` Object ` , ` Array ` , ` Promise ` ,
214+ etc. from outside the Miniflare sandbox will pass. This makes it much easier
215+ to run Rust workers in Miniflare, as ` wasm-bindgen ` frequently generates this
216+ code. Beware enabling this option will cause ` Object ` ` constructor ` /prototype
217+ checks to fail.
194218- Added a new ` --verbose ` /` verbose: true ` option that enables verbose logging
195219 with more debugging information
196220- Throw a more helpful error with suggested fixes when Miniflare can't find your
0 commit comments