Write Cloudflare Workers in 100% Rust via WebAssembly
uploadId
for multipart uploads by @Jasper-Bekkers in https://github.com/cloudflare/workers-rs/pull/542
worker-kv
worker-sandbox
and fix bug in KV put metadata. by @kflansburg in https://github.com/cloudflare/workers-rs/pull/550
std::error::Error
by @kflansburg in https://github.com/cloudflare/workers-rs/pull/527
[!NOTE]
These changes should not be breaking: they should only expand the set of request, response, and error types supported by theevent
macro:
- The error type returned can now be any type which implements
Into<Box<dyn std::error::Error>>
(includingworker::Error
).- Introduces
FromRequest
trait, and handler request type can be any type that implements this trait. Implementations are provided forweb_sys::Request
,worker::Request
, andhttp::Request<worker::Body>
.- Introduces
IntoResponse
trait, and handler response type can be any type that implements this trait. Implementations are provided forweb_sys::Response
,worker::Response
, andhttp::Response<B> where B: http_body::Body
.
worker-sys
Make all methods catch
: this greatly improves error reporting for exceptions which originate in JavaScript by @Jasper-Bekkers in https://github.com/cloudflare/workers-rs/pull/546
[!CAUTION]
Makingworker-sys
methodscatch
changes them all to returnResult
.worker
crate APIs should not have breaking changes, but if you useworker-sys
APIs directly (including some user-facing APIs such asD1ExecResult
), then you may need update your code to handle this change.
Full Changelog: https://github.com/cloudflare/workers-rs/compare/v0.1.0...v0.2.0
worker-codegen
, which generates RPC client bindings from WIT schemas.worker-rs
's new versioning scheme.worker-kv
has been moved to this repository from https://github.com/zebp/worker-kv
Thanks @Kakapio !
KvStore
as Sync
and Send
for better ergonomics with axum
and other HTTP frameworks.We will be using 0.x.y
as our version pattern going forward so that we can better use semantic versioning. Minor version (x
) changes will be used to indicate breaking changes, and patch version (y
) changes will indicate non-breaking changes. We will continue be using 0
for our major version.
Socket.opened
for checking if socket connection was successful, by @Kakapio in https://github.com/cloudflare/workers-rs/pull/509
Socket.closed
getter, by @kflansburg in https://github.com/cloudflare/workers-rs/pull/518
[!CAUTION] Breaking: You will now need the
timezone
feature to accessCf.timezone
.
axum
feature by @kflansburg in https://github.com/cloudflare/workers-rs/pull/534
[!CAUTION] Breaking: You will now need
axum
feature to haveFrom<worker::Response> for http::Response<axum::body::Body>
D1PreparedStatement
to access D1PreparedStatementSys
and raw JsValue
query results, by @dakom in https://github.com/cloudflare/workers-rs/pull/521
From<web_sys::Request>
for request argument by @dakom in https://github.com/cloudflare/workers-rs/pull/525
Full Changelog: https://github.com/cloudflare/workers-rs/compare/v0.0.24...v0.1.0
In https://github.com/cloudflare/workers-rs/pull/335, major changes were made to the Queues API to bring it to parity with new features that have been introduced to the JavaScript API over time. This includes things like content type, delaying messages, and explicit acknowledgement and retries.
This comes with a few breaking changes:
Message
fields like body
, timestamp
, and id
are no longer public, and Message
can no longer be created from a struct literal. Instead, these fields must be accessed via methods body()
, timestamp()
, and id()
.iter()
on MessageBatch
no longer has a lifetime.MessageBatch::new()
has been removed.New features:
ack()
and retry()
are now available on the individual messageretry_with_options()
was added to allow specifying the QueueRetryOptions
ack_all()
is now available on MessageBatch
retry_all_with_options()
was added to MessageBatch
to allow specifying the QueueRetryOptions
send_batch()
is now available on Queue
QueueSendOptions
when sending a message
MessageBuilder
, BatchMessageBuilder
, and RawMessageBuilder
added to allow for the creation of messages with options.JsValue
(either Text
or V8
content types):
Message
now has a raw_body
function that returns a JsValue
.raw_iter()
fn has been added to MessageBatch
.Queue
now has a send_raw
and send_raw_batch
function that allows sending of JsValue
.Thanks to @jdon !
Full Changelog: https://github.com/cloudflare/workers-rs/compare/v0.0.23...v0.0.24
Full Changelog: https://github.com/cloudflare/workers-rs/compare/v0.0.22...v0.0.23
This release continues our conversion to the http
crate. In a number of key ways:
axum
when http
feature is enabled. This was a great dogfooding exercise and helped to identify ergonomics issues. Based on this we developed the utilities (see documentation):
worker::send
to mark arbitrary async
functions as Send
(useful for axum
handler methods).SendFuture
wrapper for marking a specific Future
as Send
.SendWrapper
for marking a particular object as Send
. This is useful for axum
router state.axum
. Thanks @avsaase!We will continue to make ergonomic improvements to simplify usage of axum
and other frameworks which generally expect objects to be Send
, Sync
, and Clone
.
D1PreparedStatement.bind_refs
and batch_bind
which does not take ownership of arguments, and enables more ergonomic and performant use of the D1 API. It also introduces D1Type
which provides better type safety for these arguments than the previous API which allowed arbitrary JsValue
. @kflansburg in https://github.com/cloudflare/workers-rs/pull/493
Full Changelog: https://github.com/cloudflare/workers-rs/compare/v0.0.21...v0.0.22
http
feature flagA feature flag (http
) was introduced to begin migrating from custom request and response types to widely used types in the http
crate. See the README for more information.
http
feature for http
crate types by @kflansburg in https://github.com/cloudflare/workers-rs/pull/477
Full Changelog: https://github.com/cloudflare/workers-rs/compare/v0.0.20...v0.0.21
response_body
function to r2::ObjectBody
. by @mcnulty in https://github.com/cloudflare/workers-rs/pull/462
Full Changelog: https://github.com/cloudflare/workers-rs/compare/v0.0.19...v0.0.20
matchit
introduced some breaking changes in path params.DurableObject
by @eric-seppanen in https://github.com/cloudflare/workers-rs/pull/431
text/html; charset=utf-8
by @kpcyrd in https://github.com/cloudflare/workers-rs/pull/447
Full Changelog: https://github.com/cloudflare/workers-rs/compare/v0.0.18...v0.0.19