aboutsummaryrefslogtreecommitdiff
path: root/CHANGELOG.md
diff options
context:
space:
mode:
authorWeicao-CatilGrass <1992414357@qq.com>2026-05-22 08:33:46 +0800
committerWeicao-CatilGrass <1992414357@qq.com>2026-05-22 08:33:46 +0800
commit7adbe2715285d7baedfb91f5e81f5ea64f7d1a5a (patch)
treeb9e4985c5b2980613523eea8ad49974c5d1d1070 /CHANGELOG.md
parent7eed97fe690f214eba43b4784bc2dee3a71a1498 (diff)
Extract resource injection into shared module and add to #[renderer]
Diffstat (limited to 'CHANGELOG.md')
-rw-r--r--CHANGELOG.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e1dd0e7..1b7bf1a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -45,6 +45,18 @@ fn handle_path_pick(prev: PathPick) {
- **`fn foo(x: T)` / `fn foo(x: T) -> ()`** → The generated helper function returns `()`. If the internal `RenderResult` (`dummy_r`) is non-empty, it is automatically printed to stdout.
- **`fn foo(x: T) -> U`** → The generated helper function returns `U`. The internal `RenderResult` is converted via `dummy_r.into()`, and no automatic printing occurs.
+4. **\[macros\]** Resource injection is now shared between `#[chain]` and `#[renderer]`.
+Extracted the common resource injection infrastructure (`ResourceInjection`, `extract_args_info`, `generate_immut_resource_bindings`, `wrap_body_with_mut_resources`) from `chain.rs` into a new `res_injection.rs` module. Both `#[chain]` and `#[renderer]` now reuse the same logic.
+
+The `#[renderer]` attribute now supports resource injection parameters (just like `#[chain]`):
+
+```rust
+#[renderer]
+fn render_greeting(prev: Greeting, res: &MyRes) {
+ println!("{}{}", res.prefix, *prev);
+}
+```
+
#### **BREAKING CHANGES** (API CHANGES):
1. **\[core\]** Panic Unwind will not be supported when the `async` feature is enabled
2. **\[core\]** `modify_res` signature changed: now returns `Return` instead of `()`