Releases: cloudflare/workers-rs
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
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
Workers KV 0.7.0
worker-kv
has been moved to this repository from https://github.com/zebp/worker-kv
Thanks @Kakapio !
Changes
- Mark
KvStore
asSync
andSend
for better ergonomics withaxum
and other HTTP frameworks.
Release v0.0.23
Release v0.0.22
This release continues our conversion to the http
crate. In a number of key ways:
- Convert test suite to use
axum
whenhttp
feature is enabled. This was a great dogfooding exercise and helped to identify ergonomics issues. Based on this we developed the utilities (see documentation):- Introduce
worker::send
to mark arbitraryasync
functions asSend
(useful foraxum
handler methods). - Introduce
SendFuture
wrapper for marking a specificFuture
asSend
. - Introduce
SendWrapper
for marking a particular object asSend
. This is useful foraxum
router state.
- Introduce
- Implement Send, Sync, and Clone for Queue, making it easier to use with
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
.
Other Changes
- implement get_tags for hibernatable websockets by @eric-seppanen in #484
- Add tests for Durable + Websocket + Hibernation API by @j-white in #495
- Introduce
D1PreparedStatement.bind_refs
andbatch_bind
which does not take ownership of arguments, and enables more ergonomic and performant use of the D1 API. It also introducesD1Type
which provides better type safety for these arguments than the previous API which allowed arbitraryJsValue
. @kflansburg in #493 - Expose DurableObject Storage's transaction function by @TannerRogalsky in #487
New Contributors
- @avsaase made their first contribution in #483
- @TannerRogalsky made their first contribution in #487
Full Changelog: v0.0.21...v0.0.22
Release v0.0.21
New http
feature flag
A 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.
What's Changed
- chore(deps-dev): bump vite from 4.4.9 to 4.5.2 by @dependabot in #458
- chore(deps-dev): bump miniflare from 3.20230922.0 to 3.20231030.2 by @dependabot in #457
- chore(deps-dev): bump undici from 5.25.3 to 5.28.3 by @dependabot in #455
- chore(deps-dev): bump postcss from 8.4.27 to 8.4.35 by @dependabot in #456
- update/use workspace dependencies (wasm_bindgen, etc) by @NicoZweifel in #472
- Introduce
http
feature forhttp
crate types by @kflansburg in #477
New Contributors
- @NicoZweifel made their first contribution in #472
Full Changelog: v0.0.20...v0.0.21
V0.0.20
v0.0.19
Highlights
- Hibernatable Web Sockets API
- Updated dependencies. Note that
matchit
introduced some breaking changes in path params. - PostgreSQL TLS support
What's Changed
- Allow to pass wasm-coredump-rewriter cli flags by @xtuc in #368
- chore(readme): Remove tab in code sample by @dsmyda in #361
- chore: fix test suite flaking by @zebp in #399
- Postgres TLS Support by @kflansburg in #403
- Update wasm-bindgen from 0.2.86 to 0.2.87 by @fornwall in #388
- 📝 caveat when upgrading to worker 0.0.18 by @vikiival in #400
- update serde wasm bindgen by @carlsverre in #397
- add get_field helper method by @dev-ardi in #398
- chore: bump serde-wasm-bindgen by @zebp in #409
- feat: worker router example by @EstebanBorai in #404
- Use serde to more easily get query parameters by @BrandonDyer64 in #416
- fix docs typos in
DurableObject
by @eric-seppanen in #431 - Update README.md by @andrewdavidmackenzie in #427
- Fix timeout test by @kflansburg in #445
- Serialize cache_ttl_by_status as object in cf properties by @caiges in #443
- Update all dependencies by @kflansburg in #450
- Implement Hibernatable Web Sockets API by @DylanRJohnston in #436
- Clarify units of offset in ScheduledTime by @andrewdavidmackenzie in #430
- Add clone to D1PreparedStatement by @spicyzboss in #422
- add the ability to set the protocol(s) when creating a websocket client by @j-white in #424
- Make Response::from_html use
text/html; charset=utf-8
by @kpcyrd in #447 - docs: remove wrangler init reference in readme. by @admah in #391
- chore(deps): bump mio from 0.8.10 to 0.8.11 by @dependabot in #454
- Release v0.0.19 by @kflansburg in #459
New Contributors
- @dsmyda made their first contribution in #361
- @fornwall made their first contribution in #388
- @vikiival made their first contribution in #400
- @carlsverre made their first contribution in #397
- @dev-ardi made their first contribution in #398
- @EstebanBorai made their first contribution in #404
- @BrandonDyer64 made their first contribution in #416
- @eric-seppanen made their first contribution in #431
- @andrewdavidmackenzie made their first contribution in #427
- @caiges made their first contribution in #443
- @DylanRJohnston made their first contribution in #436
- @spicyzboss made their first contribution in #422
- @j-white made their first contribution in #424
- @kpcyrd made their first contribution in #447
- @admah made their first contribution in #391
- @dependabot made their first contribution in #454
Full Changelog: v0.0.18...v0.0.19