Releases: cloudflare/miniflare
v3.20230628.0
What's Changed
- Add
https
option to have miniflare accept https requests by @jspspike in #612 - [Miniflare 3] Allow custom services to respond with
Content-Encoding
and multipleSet-Cookie
headers by @mrbbot in #613 - [Miniflare 3] Use
localhost
instead of127.0.0.1
for loopback hostname by @mrbbot in #615 - [Miniflare 3] Correctly resolve relative source mapped URLs by @mrbbot in #617
- [Miniflare 3] Add changelog entries for
3.0.x
releases by @mrbbot in #619 - [Miniflare 3] Mark WebSocket
fetch()
close test as flaky by @mrbbot in #620 - [Miniflare 3] Update API docs with
routes
,queue*
,https*
, andupstream
by @mrbbot in #618 - [Miniflare 3] Use
http.STATUS_CODES
for logging status text by @mrbbot in #616 - [Miniflare 3] Minor API docs fixes by @mrbbot in #621
- Bump
workerd
version by @penalosa in #623
Full Changelog: v3.0.2...v3.20230628.0
v3.0.2
v3.0.1
v3.0.0
Miniflare v3 now uses workerd
, the open-source Cloudflare Workers runtime. This is the same runtime that's deployed on Cloudflare’s network, giving bug-for-bug compatibility and practically eliminating behavior mismatches. Refer to the Miniflare v3 and Wrangler v3 announcements for more information.
Missing Features
Several features from Miniflare v2 are not supported in Miniflare v3's initial release. However, they are on the roadmap, and will be added back soon:
- Step-through debugging
- Automatically triggering scheduled events via CRON schedules, or manually triggering them via
/.mf/scheduled
or/cdn-cgi/mf/scheduled
(manually triggering events is supported via the--test-scheduled
Wrangler flag and visiting/__scheduled
) - Starting an HTTPS server
- Mocking outbound
fetch()
requests - The
get{Bindings,KVNamespace,R2Bucket,Caches,DurableObjectNamespace}()
methods
CLI Changes
Miniflare v3 no longer includes a standalone CLI. To get the same functionality, you will need to switch over to Wrangler. Wrangler v3 uses Miniflare v3 by default. To start a local development server, run:
$ npx wrangler@3 dev
If there are features from the Miniflare CLI you would like to see in Wrangler, please open an issue on GitHub.
API Changes
We have tried to keep Miniflare v3's API close to Miniflare v2 where possible, but many options and methods have been removed or changed with the switch to the open-source workerd
runtime. See the 📚 GitHub README
for the new API docs, and the ⬆️ Migration Guide for the full list of removals and changes.
v3.0.0-rc.1
Features
- Implement a new underlying storage system, using SQLite for metadata, and a separate file-system/in-memory backed blob store supporting streamed, ranged reads. Note, previously persisted data is incompatible with this system and must be deleted. (#555, #562, #563, #565)
- Add support for R2 multipart uploads (#565)
- Add support for R2 multipart, weak, and wildcard
ETag
s (#575) - Add support for Queues (#566)
- Add stub CLI recommending
wrangler dev
(#570) - Add support for specifying custom
upstream
s (#568)
Fixes
v2.14.0
Features
- Add support for the
Ed25519
algorithm and markX448
/Ed448
algorithms as unsupported. Thanks @panva forjose
's comprehensive test suite. - Add
ExecutionContext
as a global value to Miniflare's unit testing environments' global types. Miniflare injects theExecutionContext
class into testing environments, so they can be constructed and passed to imported module event handlers. This change ensuresnew ExecutionContext()
isn't a type error. - Allow
wrangler.toml
build.watch_dir
to be an array of directories. Thanks @sj-e2digital for the PR.
Fixes
- Ensure queue consumers are registered when using Miniflare's unit testing environments.
- Fix crash when calling
Miniflare#reload()
with queue consumers set. Closes issue #560, thanks @calebmer. - Add
@miniflare/core
as a dependency of@miniflare/r2
. Closes issue #559, thanks @calebmer. - Update
@miniflare/d1
README
with new API
v3.0.0-next.13
Features
- Add native support for Windows (#551)
- Add support for routing to multiple Workers (#520)
- Add support for logging incoming HTTP requests (#550)
- Improve support for newer R2 features (#524)
- Add support for deleting multiple keys in
R2Bucket#delete()
- Add support for ranged-gets with a
Range
header inR2Bucket#get()
- Add support for
R2Bucket#list()
startAfter
option - Add support for
sha*
checksums inR2Bucket#put()
and return fromR2Bucket#{get,head}
- Add support for conditional
R2Bucket#put()
- Add support for
secondsGranularity
option inR2Conditional
s - Add validation for
customMetadata
size toR2Bucket#put()
- Return
range
information fromR2Bucket#head()
- Add support for deleting multiple keys in
Fixes
- Use UTC timezone when checking if compatibility date is in the future (#558)
v2.13.0
Features
- Add support for
DurableObjectNamespace#jurisdiction()
method. Note the passedjurisdiction
is validated but otherwise ignored. IDs generated by sub-namespaces in different jurisdictions will be the same. Thanks @DaniFoldi for the PR. - Add support for the non-standard
crypto.subtle.timingSafeEqual()
function. Thanks @DaniFoldi for the PR. - Remove requirement for
experimental
compatibility flag alongsidenodejs_compat
to usenode:assert
,node:buffer
andnode:util
modules. Closes issue #547, thanks @Skye-31 and @DaniFoldi for the PR.
Fixes
- Fix binding of
?N
parameters in D1 prepared statements. Closes issues #504, #526, cloudflare/workers-sdk#2811 and cloudflare/workers-sdk#2887. Thanks @ruslantalpa and @maurerbot. - Fix cloning of
Response
s constructed with byte streams. Notably, byte streams are returned from lots of Workers runtime APIs (e.g. KV, R2) to support BYOB reads. Closes issue #527, thanks @cwkang1998. - Copy
Content-Length
fromRequest
/Response
body
streams when constructing a newRequest
/Response
or callingfetch
. Closes issue #522, thanks @notorca.
v2.12.2
Fixes
- Fix detection of read-only D1 SQL statements in Jest. Closes issue #529, thanks @jschlesser for the PR.
v3.0.0-next.12
Fixes
- Use
SIGINT
when terminating runtime process to avoid gracefully draining HTTP connections, and immediatelydispose()
/setOptions()