Skip to content

Releases: blorbb/leptos-mview

v0.4.0

01 Dec 09:10
d2d6308
Compare
Choose a tag to compare

Support for Leptos 0.7.

A few unfortunate changes:

  • Error reporting has significantly degraded due to traits not being fulfilled. This makes the entire macro output become an error, so it is impossible for error reporting to be at reasonable spans. Most errors will show up for the entire macro call site.
  • Now require leptos::prelude::* to be imported since attributes are checked and come from traits. It is possible to use a fully qualified trait path, but it may provide worse autocomplete. Better autocomplete at the cost of requiring the prelude to be imported seems to be a good trade off.
  • "nightly" feature required for nightly diagnostics, as proc-macro-error2 does not automatically detect nightly.

Breaking changes:

  • Special class and id directives on components now just use the attribute spreading that already comes with Leptos instead of the custom solution of setting the class and id arguments.

Full Changelog: v0.3.2...v0.4.0

v0.3.2

25 Jun 05:16
Compare
Choose a tag to compare

Added support for leptos-rs/leptos#2534 and some minor span improvements.

Full Changelog: v0.3.1...v0.3.2

v0.3.1

31 Mar 23:38
Compare
Choose a tag to compare

Minor fix to improve r-a support, see #13.

Full Changelog: v0.3.0...v0.3.1

v0.3.0

22 Feb 03:40
c43e25b
Compare
Choose a tag to compare

A whole ton of fixes and improvements!

BREAKING:

  • use: directives now call .into() on their values, which is what leptos::view! also does. See leptos-rs/leptos#2248
  • Events like on:click are now always delegated - they were previously always undelegated. This may break some event listeners' behaviour.

Enhancements:

  • Support for qualified paths in component names like leptos::Show.
  • Generics can be used with or without the turbofish.
  • Support for the :undelegated modifier on event listeners.
  • Significantly improved error recovery, spans, messages and syntax highlighting.

Full Changelog: v0.2.3...v0.3.0

v0.2.3

27 Jan 08:11
Compare
Choose a tag to compare

Compatible with leptos 0.6! (by just fixing some tests :))

One new feature: children blocks can be wrapped in either braces or parentheses. No functional differences, just a stylistic choice.

mview! {
    p("these are " em("my") " " strong("children"))
}

Full Changelog: v0.2.2...v0.2.3

v0.2.2

18 Jan 05:24
Compare
Choose a tag to compare

Minor update to what is being spanned due to updates to proc macro stuff in rust-analyzer. All tokens in quote_spanned! will show their documentation at that span, leading to component names having documentation for things like std and vec!.

The macro now adds a #[allow(unreachable_code)] for better error messages, but means that this lint may be disabled in attributes.

Hopefully nothing else has broken :)

Full Changelog: v0.2.1...v0.2.2

v0.2.1

23 Nov 03:43
Compare
Choose a tag to compare

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.
  • A new value shorthand: f["{:.3}", some_number()]: adding the f prefix adds format! 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 shorthand Component.some-class #some-id to add it to these attributes, and/or the class: 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 of optional.
    • 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 on syn 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

v0.2.0

25 Oct 09:02
Compare
Choose a tag to compare

Supporting directives from Leptos 0.5.2, as well as some breaking changes cause I'm indecisive :)

Breaking Changes:

  • #4: Rename macro from view! to mview!.

    A full-word search-and-replace for view! -> mview! and leptos_mview::view -> leptos_mview::mview should fix everything.

  • #3: clone: directive now takes a single identifier, clone:thing instead of clone:{thing}.

Enhancements:

  • #3: added use: directive to elements. Syntax is the same as leptos, use:dir or use:dir={param}.

v0.1.0

30 Sep 03:45
Compare
Choose a tag to compare

First release! See README.md for details.