Skip to content

Releases: Synphonyte/leptos-use

Version 0.13.0

28 Aug 02:31
Compare
Choose a tag to compare

Changes in this version:

[0.13.0] - 2024-08-28

New Functions 🚀

  • use_toggle
  • use_prefers_reduced_motion (thanks to @hcandelaria)

Breaking Changes 🛠

  • use_websocket now supports different types for sending and receiving messages
  • SyncSignalOptions now can take now either transformations or assignment functions but not both.
  • updated to codee version 0.2.0

Fixes 🍕

  • use_websocket fixed error with cleanup and reconnect (thanks to @BakerNet).

New Features 🚀

  • There is now a feature for almost every function to get better compile and rust-analyzer times.
  • use_web_notification now supports the vibrate option (thanks to @hcandelaria).
  • UseDocument now supports a whole bunch of methods more from document (thanks to @luckynumberke7in).

Version 0.12.0

14 Aug 03:56
Compare
Choose a tag to compare

Changes in this version:

[0.12.0] - 2024-08-14

Make sure you also update cargo-leptos to the latest version if you use that.

Breaking Changes 🛠

  • Updated to web_sys 0.3.70 which unfortunately is breaking some things.
  • use_clipboard doesn't need the unstable flags anymore.
  • use_locale now uses unic_langid::LanguageIdentifier and proper locale matching (thanks to @mondeja).
  • Removed UseMouseEventExtractorDefault and reworked UseMouseCoordType (thanks to @carloskiki)
  • use_preferred_dark and use_color_mode now try to read the Sec-CH-Prefers-Color-Scheme header in SSR. This brings
    the necessity to enable an additional feature for them (axum / actix / spin).

Fixes 🍕

  • Fixed the codec chapter in the book to refer to crate codee.

Version 0.11.4

12 Aug 12:35
Compare
Choose a tag to compare

Changes in this version:

[0.11.4] - 2024-08-12

New Features 🚀

  • use_web_notification now supports the options renotify, silent and image (thanks to @hcandelaria).
  • sync_signal no supports the options assign_ltr and assign_rtl.

Version 0.11.3

02 Sep 11:43
Compare
Choose a tag to compare

Changes in this version:

[0.11.3] - 2024-07-31

Fix 🍕

  • Made use_timeout_fn SSR-safe

Version 0.11.2

30 Jul 12:15
Compare
Choose a tag to compare

Changes in this version:

[0.11.2] - 2024-07-30

Change 🔥

  • use_locale has now a supported locale list.

Version 0.11.1

28 Jul 20:22
Compare
Choose a tag to compare
Version 0.11.1 Pre-release
Pre-release

Changes in this version:

[0.11.1] - 2024-07-28

New Functions 🚀

  • use_locale (thanks to @BrandonDyer64)
  • use_locales (thanks to @BrandonDyer64)
  • header – Standard implementations for reading a header on the server.

Version 0.11.0

27 Jul 18:46
Compare
Choose a tag to compare

Changes in this version:

[0.11.0] - 2024-07-27

New Functions 🚀

  • use_user_media

New Features 🚀

  • Codecs:

    • All codecs now live in their own crate codee
    • There are now binary codecs in addition to string codecs.
      • FromToBytesCodec
      • WebpackSerdeCodec
      • BincodeSerdeCodec
      • ProstCodec (see also the section "Breaking Changes 🛠" below)
    • Every binary codec can be used as a string codec with the Base64 wrapper which encodes the binary data as a
      base64
      string.
      • This required feature base64
      • It can be wrapped for example like this: Base64<WebpackSerdeCodec>.
    • There is now an OptionCodec wrapper that allows to wrap any string codec that encodes T to encode Option<T>.
      • Use it like this: OptionCodec<FromToStringCodec<f64>>.
  • ElementMaybeSignal is now implemented for websys::HtmlElement (thanks to @blorbb).

  • UseStorageOptions now has delay_during_hydration which has to be used when you conditionally show parts of
    the DOM controlled by a value from storage. This leads to hydration errors which can be fixed by setting this new
    option to true.

  • cookie::SameSite is now re-exported

  • Changing the signal returned by use_cookie now tries and changes the headers during SSR.

  • New book chapter about codecs

  • The macro use_derive_signal! is now exported (thanks to @mscofield0).

Breaking Changes 🛠

  • UseStorageOptions and UseEventSourceOptions no longer accept a codec value because this is already provided as a
    generic parameter to the respective function calls.
  • Codecs have been refactored. There are now two traits that codecs implement: Encoder and Decoder. The
    trait StringCodec is gone. The methods are now associated methods and their params now always take references.
    • JsonCodec has been renamed to JsonSerdeCodec.
    • The feature to enable this codec is now called json_serde instead of just serde.
    • ProstCodec now encodes as binary data. If you want to keep using it with string data you can wrap it like
      this: Base64<ProstCodec>.
    • All of these structs, traits and features now live in their own crate called codee
    • A bunch of new codecs are available. Have a look at the docs for crate codee.
  • use_websocket:
    • UseWebsocketOptions has been renamed to UseWebSocketOptions (uppercase S) to be consistent with the return
      type.
    • UseWebSocketOptions::reconnect_limit and UseEventSourceOptions::reconnect_limit is now ReconnectLimit
      instead
      of u64. Use ReconnectLimit::Infinite for infinite retries or ReconnectLimit::Limited(...) for limited
      retries.
    • use_websocket now uses codecs to send typed messages over the network.
      • When calling you have give type parameters for the message type and the
        codec: use_websocket::<String, WebpackSerdeCodec>
      • You can use binary or string codecs.
      • The UseWebSocketReturn::send closure now takes a &T which is encoded using the codec.
      • The UseWebSocketReturn::message signal now returns an Option<T> which is decoded using the codec.
      • UseWebSocketReturn::send_bytes and UseWebSocketReturn::message_bytes are gone.
      • UseWebSocketOptions::on_message and UseWebSocketOptions::on_message_bytes have been renamed
        to on_message_raw and on_message_raw_bytes.
      • The new UseWebSocketOptions::on_message takes a &T.
      • UseWebSocketOptions::on_error now takes a UseWebSocketError instead of a web_sys::Event.
  • use_storage now always saves the default value to storage if the key doesn't exist yet.
  • Renamed BreakpointsSematic to BreakpointsSemantic and breakpoints_sematic to breakpoints_semantic
    (note the n) (thanks to @mondeja).

Fixes 🍕

  • Fixed auto-reconnect in use_websocket
  • Fixed typo in compiler error messages in use_cookie (thanks to @SleeplessOne1917).
  • Fixed potential signal out of scope issue with use_raf_fn

Other Changes 🔥

  • Better links in docs that work both in the book and in rustdoc (thanks to @mondeja).
  • Better CI/CD (thanks to @EstebanBorai).

Version 0.10.10

10 May 23:16
Compare
Choose a tag to compare

Changes in this version:

[0.10.10] - 2024-05-10

Change 🔥

  • Added compile-time warning when you use ssr feature with wasm32. You can enable wasm_ssr to remove the warning.

Version 0.10.9

27 Apr 18:57
Compare
Choose a tag to compare

Changes in this version:

[0.10.9] - 2024-04-27

Fixes 🍕

  • Fixed use_color_mode without cookies and make cookies sync properly with local storage
  • Fixed use_infinite_scroll edge case bug with disposed signals

Version 0.10.8

20 Apr 22:14
Compare
Choose a tag to compare

Changes in this version:

[0.10.8] - 2024-04-19

Change 🔥

  • use_cookie now supports Spin out of the box (thanks to @javierEd).