v0.2.1
Totally didn't forget to make a github release
Copied from CHANGELOG.md:
Hopefully no breaking changes, just a whole bunch of new DX features!
Features:
- Support for slots! Prefix the slot element with
slot:
to use it as a slot. The parameter name in the parent component must be the same name as the slot, in snake_case.- See
Slots
for more details.
- See
- A new value shorthand:
f["{:.3}", some_number()]
: adding thef
prefix addsformat!
into the closure; equivalent to[format!(...)]
or{move || format!(...)}
. - On components, if you have the parameters
#[prop(into, optional)] class: TextProp
or#[prop(optional)] id: &'static str
, you can use the selector shorthandComponent.some-class #some-id
to add it to these attributes, and/or theclass:
directive for reactive classes.impl Default for TextProp
is currently in the Leptos git main / future v0.5.3 release; for 0.5.2 or earlier, you need to use#[prop(default="".into())]
instead ofoptional
.- Reactive classes in this way are not very performant as a
String
is constructed every time any of the signals change. If you only use the selector shorthand, they will be compiled into one string literal (no performance downsides). - This is also supported on slots, using the same fields.
- See Special Attributes for more details.
Enhancements:
- Fixed up a whole lot of spans to improve a whole bunch of error messages: hopefully, there are no more errors that cause the entire macro to be spanned, errors should always be localized to a relevant spot.
- Better rust-analyzer support in some invalid macro situations.
- Better syntax highlighting for the selector shorthand on HTML elements.
Other minor things:
- Removed extra
syn
features, now this just depends onsyn
with its default features (no "full" or "extra-traits"). This doesn't do much because Leptos requires these features anyways.
Full Changelog: v0.2.0...v0.2.1