The sed commands will also replace occurrences in comments and strings. Use ast-grep for more precise refactoring.
From 0.21.0 to 0.22.0
MSRV raised to 1.84.0#
The minimum supported Rust version is now 1.84.0. Update your toolchain:
#[function_component] renamed to #[component]#
The #[function_component] attribute has been renamed to #[component] for brevity. The old name is deprecated but still works.
Automated refactor#
# Using sed (simple but also replaces in comments/strings)
# Or using ast-grep (recommended - AST-aware, preserves comments/strings)
# Important: Run the named pattern FIRST to preserve component names
note
- Before
- After
class=(...) syntax removed#
The deprecated class=(expr) syntax has been removed. Use class={classes!(...)} instead.
Finding occurrences#
# Find all files using the old class=(...) syntax
Manual refactor#
The transformation is straightforward: wrap the tuple contents with classes!() and change parentheses to braces:
class=(a, b)→class={classes!(a, b)}class=(expr)→class={classes!(expr)}
- Before
- After
html!
html!
ToHtml trait removed#
The ToHtml trait has been removed. Use IntoPropValue for custom type conversions.
For-loops in html! macro#
You can now use for-loops directly in the html! macro. This is optional but provides cleaner syntax:
- Before (still works)
- After (new syntax)
html!
html!
use_effect_with no longer requires || () return#
Effect hooks no longer require returning || () when there's no cleanup:
- Before
- After
use_effect_with;
use_effect_with;