Releases: cloudflare/workers-rs
Release v0.4.0
What's Changed
- Relax type of callback arguments to
Router
methods. This uses APIT to allow more types than a function pointer to implement handlers (i.e. async closure) by @compiler-errors in #605 - Fix typos in CORS argument names by @OliverEvans96 in #629
- Implement
get_all
function to return non-folding set-cookie headers by @nakamura-shuta in #597 - Add
FormData
conversion intoJsValue
by @thibmeu in #634
New Contributors
- @lkolbly made their first contribution in #625
- @compiler-errors made their first contribution in #605
- @OliverEvans96 made their first contribution in #629
- @nakamura-shuta made their first contribution in #597
- @thibmeu made their first contribution in #634
Full Changelog: v0.3.4...v0.4.0
Release v0.3.4
What's Changed
- Fix breaking change in
js-sys
/web-sys
. Remove HeaderExt and AbortSignalExt by @kflansburg in #621
Full Changelog: v0.3.3...v0.3.4
Release v0.3.3
What's Changed
- durable: add ___location hint support by @Noah-Kennedy in #614
New Contributors
- @Noah-Kennedy made their first contribution in #614
Full Changelog: v0.3.2...v0.3.3
Release v0.3.2
What's Changed
- Fix linter warnings by @GoncaloGarcia in #607
- Publicly expose VersionMetadataBinding by @GoncaloGarcia in #606
- Fix broken durable object jurisdiction link by @mendess in #610
Full Changelog: v0.3.1...v0.3.2
Release v0.3.1
What's Changed
- Expose
Hyperdrive
from the worker crate by @ramnivas in #584 - Add a binding to meta object for
D1Result
. by @langyo in #591 - Use
wasm-pack
as crate dependency by @kflansburg in #592 - Support sha256 cert fingerprints in TlsClientAuth by @fisherdarling in #601
- Add support for Version Metadata Binding by @GoncaloGarcia in #598
New Contributors
- @ramnivas made their first contribution in #584
- @langyo made their first contribution in #591
- @GoncaloGarcia made their first contribution in #598
Full Changelog: v0.3.0...v0.3.1
Release v0.3.0
What's Changed
- Rust-friendly DigestStream API (see example) by @dakom in #529
- Introduce cargo generate templates and update getting started by @kflansburg in #559
Tip
You can now get started in seconds by running cargo generate cloudflare/workers-rs
!
- Implement Send, Sync and Clone for some Durable Object types for better
axum
ergonomics by @avsaase in #563 - Hyperdrive binding by @avsaase in #566
Tip
You can now use Workers Hyperdrive to speed up connections to your SQL database using tokio-postgres
. Check out our updated example.
Caution
Rust 1.75 or greater is now required due to use of impl Trait
in trait method return type.
- Use
u64
for R2 range requests by @kflansburg in #564
Caution
In order to support range requests larger than 4GB, worker_sys::R2Range
now accepts f64
instead of u32
. worker::Range
options have changed to make the functionality more clear and now accept u64
instead of u32
.
- Add
encodeBody
andcf
to ResponseInit. Adopt builder pattern. by @kflansburg in #568
Caution
This change removes ResponseInit
, which is replaced by an idiomatic ResponseBuilder
pattern, all other APIs should remain unchanged. In addition, the encodeBody
property is now available to support returning pre-compressed data.
New Contributors
- @sachaos made their first contribution in #572
- @thiskevinwang made their first contribution in #575
Full Changelog: v0.2.0...v0.3.0
Release v0.2.0
What's Changed
R2 Improvements
- 💡 Expose
uploadId
for multipart uploads by @Jasper-Bekkers in #542 - 🎏 Add ReadableStream to Data by @Jasper-Bekkers in #548
- feat: Allow instantiating an UploadPart from its constituent parts by @lwansbrough in #552
worker-kv
- Move KV test suite to
worker-sandbox
and fix bug in KV put metadata. by @kflansburg in #550
API Flexibility
- WorkerRequest/WorkerResponse traits by @dakom in #530
- Allow returning any error that implements
std::error::Error
by @kflansburg in #527
Note
These changes should not be breaking: they should only expand the set of request, response, and error types supported by the event
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
.
Workers RPC
- Experimental RPC Support (see README for details) by @kflansburg in #551
General
- chore(deps): bump rustls from 0.22.3 to 0.22.4 by @dependabot in #553
- 🤽
worker-sys
Make all methodscatch
: this greatly improves error reporting for exceptions which originate in JavaScript by @Jasper-Bekkers in #546
Caution
Making worker-sys
methods catch
changes them all to return Result
. worker
crate APIs should not have breaking changes, but if you use worker-sys
APIs directly (including some user-facing APIs such as D1ExecResult
), then you may need update your code to handle this change.
New Contributors
- @Jasper-Bekkers made their first contribution in #542
- @lwansbrough made their first contribution in #552
Full Changelog: v0.1.0...v0.2.0
worker-build v0.1.0
- Introduce new binary,
worker-codegen
, which generates RPC client bindings from WIT schemas. - Move to
worker-rs
's new versioning scheme.
Release v0.1.0
New Versioning Pattern
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.
What's Changed
Sockets
- Add
Socket.opened
for checking if socket connection was successful, by @Kakapio in #509 - Add socket tests and fixed
Socket.closed
getter, by @kflansburg in #518
Binary Size
- Make chrono-tz an optional dependency. This dependency was found to be a major contributor to binary size. By @kflansburg in #520
Caution
Breaking: You will now need the timezone
feature to access Cf.timezone
.
- Introduce
axum
feature by @kflansburg in #534
Caution
Breaking: You will now need axum
feature to have From<worker::Response> for http::Response<axum::body::Body>
D1
- Introduce methods on
D1PreparedStatement
to accessD1PreparedStatementSys
and rawJsValue
query results, by @dakom in #521
HTTP
- More flexible fetch handler signature allowing any type implementing
From<web_sys::Request>
for request argument by @dakom in #525
Other Fixes
- Fix issue with data corruption in web_sys::WebSocket by @kflansburg in #523
- Return 500 instead of panicking when returning error to fetch handler by @avsaase in #524
Dependabot
- chore(deps-dev): bump vite from 4.5.2 to 4.5.3 by @dependabot in #532
New Contributors
Full Changelog: v0.0.24...v0.1.0
Release v0.0.24
Major Changes to Queues API
In #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 likebody
,timestamp
, andid
are no longer public, andMessage
can no longer be created from a struct literal. Instead, these fields must be accessed via methodsbody()
,timestamp()
, andid()
.iter()
onMessageBatch
no longer has a lifetime.MessageBatch::new()
has been removed.
New features:
ack()
andretry()
are now available on the individual messageretry_with_options()
was added to allow specifying theQueueRetryOptions
ack_all()
is now available onMessageBatch
retry_all_with_options()
was added toMessageBatch
to allow specifying theQueueRetryOptions
send_batch()
is now available onQueue
- It's now possible to set
QueueSendOptions
when sending a message- New builder structs
MessageBuilder
,BatchMessageBuilder
, andRawMessageBuilder
added to allow for the creation of messages with options.
- New builder structs
- Allow for sending and receiving of the raw
JsValue
(eitherText
orV8
content types):Message
now has araw_body
function that returns aJsValue
.raw_iter()
fn has been added toMessageBatch
.Queue
now has asend_raw
andsend_raw_batch
function that allows sending ofJsValue
.
Thanks to @jdon !
Other Changes
- Add worker-kv crate to repository. by @Kakapio in #494
- chore(deps-dev): bump ansi-regex from 5.0.0 to 5.0.1 in /worker-kv/tests by @dependabot in #506
- chore(deps-dev): bump the npm_and_yarn group group in /worker-kv/tests with 1 update by @dependabot in #508
- Add semver checks and sanity-check build to create-release-pr by @kflansburg in #512
Full Changelog: v0.0.23...v0.0.24