Skip to content

Release v0.9.0

Latest

Choose a tag to compare

@github-actions github-actions released this 11 Nov 23:47
· 2 commits to 178a3b0bdec2717f60ab225ec66a36953a2f20d8 since this release
fcc2fae

Minor Changes

  • AbortSignal::reason() now returns JsValue instead of Option<JsValue>, matching web_sys::AbortSignal and the workers-types declaration. Before the signal is aborted the reason is undefined; use signal.aborted() to check. (#1122)
  • Add worker::observability, bindings for Workers custom trace spans. enter_span / enter_span_async run code inside a new span, start_span opens one without making it active, and Span::in_scope / Span::instrument make a span active for a closure or a future, re-entering it on every poll so concurrent futures nest correctly. Every handler and wait_until future now runs under the span active when it started. Needs a runtime with tracing.withActiveSpan. (#1123)
  • Add D1PreparedStatement::raw_with_column_names, which calls raw({ columnNames: true }) and returns the column names alongside the rows as (Vec<String>, Vec<Vec<T>>). The existing raw is unchanged. (#1060)
  • Add State::block_concurrency_while for Durable Objects, binding the runtime's blockConcurrencyWhile with the same call-time semantics as JavaScript: the event delivery gate closes eagerly at the call, and the returned future yields the inner future's value when awaited. Discarding the future instead supports the constructor idiom, where new() gates delivery of all events until async initialization completes. A future returning Err rejects the promise and resets the object, matching a JavaScript throw; return errors inside Ok to propagate them as values. (#1039)
  • Add Storage::get_with_options and Storage::get_multiple_with_options for Durable Objects, taking DurableObjectGetOptions (allowConcurrency, noCache). The existing get and get_multiple are unchanged. (#1101)
  • worker-build no longer rewrites the Wasm import source in build/index.js to a plain import, now that workerd and Wrangler support source phase imports. Needs a Wrangler version whose esbuild parses import source. (#1136)
  • Add MessageExt::attempts(), the number of times a queue message has been delivered, starting at 1. (#1067)
  • Add Queue::metrics(), binding the runtime's Queue.metrics(). It returns a QueueMetrics with the backlog's message count, its size in bytes, and the timestamp of its oldest message (None when the backlog is empty), so producers can apply backpressure. (#1117)
  • Add Request::signal(), which returns the request's AbortSignal. For an incoming request it is aborted when the client disconnects, which requires the enable_request_signal compatibility flag. (#1122)

Patch Changes

  • Serialize Ai::run and Ai::run_bytes inputs as JSON-compatible values, so maps such as tool parameters are no longer sent as {}. Option::None fields are now sent as null; use #[serde(skip_serializing_if = "Option::is_none")] to omit them. (#1062)
  • Make Cf::timezone_name() return Option<String> instead of panicking when the request has no cf.timezone, following the earlier change to as_organization and asn. (#1099)
  • Accept the Node.js Timeout object that setTimeout returns under nodejs_compat (default from compatibility date 2026-08-04) as the Delay timer handle, so Delay no longer panics in worker-build --dev builds. (#1095)
  • Send Durable Object GetAlarmOptions / SetAlarmOptions to the runtime as camelCase (allowConcurrency, allowUnconfirmed) so get_alarm_with_options, set_alarm_with_options and delete_alarm_with_options no longer silently drop the options. (#1100)
  • Default --emscripten builds to a 1MB stack, matching wasm32-unknown-unknown builds. Emscripten's 64KB default overflowed in debug builds of larger async code (e.g. a SQLx PgPool), surfacing as memory access out of bounds. (#1121)
  • #[event(queue)], #[event(email)] and #[event(connect)] handlers can return any error type convertible to Box<dyn std::error::Error + Send + Sync> or Box<dyn std::error::Error> (e.g. anyhow::Error or a custom error), not only worker::Error. Such an Err rejects with a JS Error carrying the source chain, while types that implement Into<JsValue> keep their own conversion. (#1125)
  • Serialize KvStore::put values with serde_json, so HashMap, BTreeMap and serde_json::Value::Object fields are no longer stored as {} and null map entries are kept. (#1094)
  • An Err returned from an #[event(queue)] or #[event(email)] handler now rejects the handler's promise, as #[event(connect)] already does, instead of panicking. On the default (panic=abort) build that panic trapped the Wasm instance, failing other requests in flight in the isolate and reinitializing it, so static state was lost. The runtime still retries a failed queue batch. (#1115)
  • Serialize queue messages sent with the default json content type JSON-compatibly, so HashMap, BTreeMap and serde_json::Value::Object fields no longer arrive at consumers as {} and null map entries are kept. Option::None fields of such messages now arrive as null instead of being omitted, as with serde_json. (#1093)
  • Fix r2::Object::http_metadata() and custom_metadata() panicking on objects returned by Bucket::list() when the listing did not include that metadata; they now return empty metadata. (#1098)
  • Fix r2::Object::range() panicking with expected instance of R2Range on every call; it now reads the runtime's plain { offset, length } object and returns an error when the object was read without a range. (#1097)
  • Cf::request_priority returns None instead of panicking when requestPriority is empty, malformed or has no weight, and ignores unknown keys. (#1108)
  • Make worker-build honour the wasm-bindgen version pinned by the root package in Cargo.lock when several versions are locked, instead of always taking the first (lowest) entry, and accept lockfile entries that carry a source suffix. (#1102)
  • Fix worker-build failing with invalid type: map, expected a string when wasm-bindgen emits a package.json with a dependencies object (wasm-bindgen 0.2.94 and later), which happens whenever a JS snippet imports an NPM package. (#1096)

What's Changed

  • test: ensure socket is destroyed after the TCP handler returns by @ThomasRubini in #1075
  • Take the tokio tag that coalesces hosted wakes only within a drive by @guybedford in #1077
  • worker-build: find emscripten snippets beside the real link output by @guybedford in #1083
  • feat: add bindings for inbound connect() UDP handler by @ThomasRubini in #1073
  • worker-build: keep the producers section in emscripten builds by @JesusFileto in #1104
  • worker-build: let explicit wasm-opt args control wasm names by @JesusFileto in #1091
  • chore(deps-dev): bump vite from 8.2.1 to 8.3.4 by @dependabot[bot] in #1107
  • fix: accept Node.js Timeout objects as the Delay timer handle by @rosalbito in #1095
  • fix(r2): read Object::range() as a plain JS object by @rosalbito in #1097
  • fix(r2): tolerate missing httpMetadata/customMetadata on listed objects by @rosalbito in #1098
  • fix(cf): make timezone_name optional by @rosalbito in #1099
  • fix(worker-build): read the dependencies map from wasm-bindgen's package.json by @rosalbito in #1096
  • deps: update dependencies and wasm-bindgen@0.2.130 by @guybedford in #1119
  • worker-build: default emscripten builds to a 1MB stack by @guybedford in #1121
  • worker-build: emit Wasm source maps for emscripten builds by @JesusFileto in #1110
  • feat: add Request::signal() by @nirajkhetre in #1122
  • fix(worker-build): honour the root package's wasm-bindgen pin in Cargo.lock by @rosalbito in #1102
  • feat(queue): add Queue::metrics() by @rosalbito in #1117
  • Return None from Cf::request_priority for an empty string by @tlq5l in #1108
  • fix(durable): send alarm options as camelCase by @rosalbito in #1100
  • fix(kv): serialize maps as objects in KvStore::put by @rosalbito in #1094
  • fix(macros): reject instead of panicking when a queue or email handler returns Err by @rosalbito in #1115
  • feat(durable): add get options (allowConcurrency, noCache) to Storage by @rosalbito in #1101
  • emscripten-sqlx example by @ranile in #1088
  • fix(http): preserve content length for exact-size response bodies by @nos1dot618 in #1068
  • feat(macros): accept any std error type from queue, email and connect handlers by @guybedford in #1125
  • fix(queue): serialize maps as objects for json content type by @rosalbito in #1093
  • feat(queue): expose message attempt count by @nos1dot618 in #1067
  • Rename template manifests to Cargo.toml.liquid by @connyay in #1085
  • ci: skip unit and http tests on Windows by @guybedford in #1129
  • fix: ai run json compatible serializer by @SameerVers3 in #1062
  • Add worker::observability custom trace spans by @guybedford in #1123
  • feat(d1): add raw_with_column_names for raw({ columnNames: true }) by @mqmalagris in #1060
  • worker-build: keep the Wasm source phase import by @guybedford in #1136

New Contributors

Full Changelog: v0.8.7...v0.9.0