|
| 1 | +# Restate Rust SDK v0.9.0 Release Notes |
| 2 | + |
| 3 | +## Highlights |
| 4 | + |
| 5 | +- **MSRV raised to 1.90.0** — a downstream dependency silently raised its MSRV, which would cause build failures for users relying on our previously announced MSRV |
| 6 | +- **`#[lazy_state]` handler attribute** — opt into lazy state loading on a per-handler basis |
| 7 | + |
| 8 | +## Table of Contents |
| 9 | + |
| 10 | +- [Breaking Changes](#breaking-changes) |
| 11 | +- [New Features](#new-features) |
| 12 | + |
| 13 | +## Breaking Changes |
| 14 | + |
| 15 | +### Dependency bumps with user-facing API changes |
| 16 | + |
| 17 | +Several dependencies have been bumped. Most are transparent, but the following affect user code: |
| 18 | + |
| 19 | +#### `rand` 0.9 → 0.10 |
| 20 | + |
| 21 | +The `rand()` method on context types returns `&mut rand::prelude::StdRng`. In rand 0.10, the trait that provides convenience methods like `.random()` and `.random_range()` was renamed from `Rng` to `RngExt`. If you import this trait, update your code: |
| 22 | + |
| 23 | +```diff |
| 24 | +- use rand::Rng; |
| 25 | ++ use rand::RngExt; |
| 26 | +``` |
| 27 | + |
| 28 | +Additionally, the low-level trait `RngCore` (providing `next_u32()`, `next_u64()`, `fill_bytes()`) was renamed to `Rng`: |
| 29 | + |
| 30 | +```diff |
| 31 | +- use rand::RngCore; |
| 32 | ++ use rand::Rng; |
| 33 | +``` |
| 34 | + |
| 35 | +`StdRng` no longer implements `Clone`. If you were cloning the RNG returned by `ctx.rand()`, this is no longer possible. |
| 36 | + |
| 37 | +#### Other dependency bumps (no user-facing changes) |
| 38 | + |
| 39 | +The following dependencies were also bumped but require no changes to user code: |
| 40 | + |
| 41 | +| Dependency | Old | New | |
| 42 | +|---|---|---| |
| 43 | +| `restate-sdk-shared-core` | `0.6.0` | `0.9.0` | |
| 44 | +| `aws_lambda_events` | `0.16.1` | `1.0` | |
| 45 | +| `lambda_runtime` | `0.14.2` | `1.0` | |
| 46 | +| `typify` | `0.1.0` | `0.6` | |
| 47 | +| `jsonptr` | `0.5.1` | `0.7` | |
| 48 | +| `regress` | `0.10.3` | `0.10` | |
| 49 | +| `bytes` | `1.10` | `1.11` | |
| 50 | +| `http` | `1.3` | `1.4` | |
| 51 | +| `hyper` | `1.6` | `1.8` | |
| 52 | +| `tokio` | `1.44` | `1.49` | |
| 53 | +| `uuid` | `1.16.0` | `1.20` | |
| 54 | +| `schemars` | `1.0.0` | `1.2` | |
| 55 | +| `reqwest` (dev) | `0.12` | `0.13` | |
| 56 | +| `testcontainers` | `0.23.3` | `0.27` | |
| 57 | + |
| 58 | +### MSRV raised to 1.90.0 |
| 59 | + |
| 60 | +The minimum supported Rust version (MSRV) has been raised from **1.85.0** to **1.90.0**. |
| 61 | + |
| 62 | +This bump was necessary because a downstream dependency raised its own MSRV without announcing it. Without this change, users relying on our previously announced MSRV of 1.85.0 would encounter build failures. Any user building with a toolchain between 1.85.0 and 1.87.x is affected. Rather than pinning to an older version of the dependency, we chose to follow the ecosystem forward. |
| 63 | + |
| 64 | +**Impact on Users:** |
| 65 | +- Projects using a Rust toolchain older than 1.90.0 will fail to compile against this version of the SDK |
| 66 | +- Your own crate's `edition` field does not need to change, but your installed Rust toolchain must be >= 1.90.0 |
| 67 | + |
| 68 | +**Migration Guidance:** |
| 69 | + |
| 70 | +Update your Rust toolchain: |
| 71 | + |
| 72 | +```bash |
| 73 | +rustup update stable |
| 74 | +``` |
| 75 | + |
| 76 | +Verify your version: |
| 77 | + |
| 78 | +```bash |
| 79 | +rustc --version # Must be >= 1.90.0 |
| 80 | +``` |
| 81 | + |
| 82 | +## New Features |
| 83 | + |
| 84 | +### `#[lazy_state]` handler attribute |
| 85 | + |
| 86 | +You can now annotate individual handlers with `#[lazy_state]` to enable lazy state loading for that handler. When enabled, state is fetched on demand rather than eagerly loaded when the handler is invoked. |
| 87 | + |
| 88 | +**Example:** |
| 89 | + |
| 90 | +```rust |
| 91 | +#[restate_sdk::object] |
| 92 | +pub trait MyObject { |
| 93 | + #[lazy_state] |
| 94 | + async fn my_handler(name: String) -> Result<String, HandlerError>; |
| 95 | +} |
| 96 | +``` |
| 97 | + |
| 98 | +**Related Issues:** |
| 99 | +- PR [#90](https://github.com/restatedev/sdk-rust/pull/90) |
0 commit comments