From 7adbe2715285d7baedfb91f5e81f5ea64f7d1a5a Mon Sep 17 00:00:00 2001 From: Weicao-CatilGrass <1992414357@qq.com> Date: Fri, 22 May 2026 08:33:46 +0800 Subject: Extract resource injection into shared module and add to #[renderer] --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'CHANGELOG.md') 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 `()` -- cgit