Skip to content

Releases: cloudflare/workers-rs

Release v0.3.0

19 May 13:26
Compare
Choose a tag to compare

What's Changed

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.

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 and cf 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

Full Changelog: v0.2.0...v0.3.0

Release v0.2.0

29 Apr 00:01
8454d87
Compare
Choose a tag to compare

What's Changed

R2 Improvements

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>> (including worker::Error).
  • Introduces FromRequest trait, and handler request type can be any type that implements this trait. Implementations are provided for web_sys::Request, worker::Request, and http::Request<worker::Body>.
  • Introduces IntoResponse trait, and handler response type can be any type that implements this trait. Implementations are provided for web_sys::Response, worker::Response, and http::Response<B> where B: http_body::Body.

Workers RPC

General

  • chore(deps): bump rustls from 0.22.3 to 0.22.4 by @dependabot in #553
  • 🤽 worker-sys Make all methods catch: 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

Full Changelog: v0.1.0...v0.2.0

worker-build v0.1.0

28 Apr 23:22
c9892d3
Compare
Choose a tag to compare
  • 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

04 Apr 19:26
Compare
Choose a tag to compare

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.

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 access D1PreparedStatementSys and raw JsValue 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

New Contributors

Full Changelog: v0.0.24...v0.1.0

Release v0.0.24

29 Mar 12:36
Compare
Choose a tag to compare

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 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 message
  • retry_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
  • It's now possible to set QueueSendOptions when sending a message
    • New builder structs MessageBuilder, BatchMessageBuilder, and RawMessageBuilder added to allow for the creation of messages with options.
  • Allow for sending and receiving of the raw 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 !

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

06 Apr 19:11
Compare
Choose a tag to compare

worker-kv has been moved to this repository from https://github.com/zebp/worker-kv

Thanks @Kakapio !

Changes

  • Mark KvStore as Sync and Send for better ergonomics with axum and other HTTP frameworks.

Release v0.0.23

27 Mar 19:40
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.0.22...v0.0.23

Release v0.0.22

26 Mar 17:21
Compare
Choose a tag to compare

This release continues our conversion to the http crate. In a number of key ways:

  • Convert test suite to use 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):
    • Introduce worker::send to mark arbitrary async functions as Send (useful for axum handler methods).
    • Introduce SendFuture wrapper for marking a specific Future as Send.
    • Introduce SendWrapper for marking a particular object as Send. This is useful for axum router state.
  • 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 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 #493
  • Expose DurableObject Storage's transaction function by @TannerRogalsky in #487

New Contributors

Full Changelog: v0.0.21...v0.0.22

Release v0.0.21

15 Mar 15:29
Compare
Choose a tag to compare

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

New Contributors

Full Changelog: v0.0.20...v0.0.21

V0.0.20

08 Mar 16:05
c0bf5cd
Compare
Choose a tag to compare

What's Changed

  • Add response_body function to r2::ObjectBody. by @mcnulty in #462
  • Add cf.as_organization function by @kpcyrd in #461
  • Added support for R2 Checksums to GET and PUT. by @spigaz in #460

New Contributors

Full Changelog: v0.0.19...v0.0.20