added docs and changelog

This commit is contained in:
Maccesch 2024-07-08 17:16:54 +01:00
parent e4ad9f11af
commit 9c035d50d8
4 changed files with 26 additions and 11 deletions

View file

@ -7,23 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### New Features 🚀
- Codecs:
- All codecs now live in their own crate `codee`
- There are now binary codecs in addition to string codecs.
- `FromToBytesCodec`
- `WebpackSerdeCodec` (requires feature `webpack_serde`)
- `BincodeSerdeCodec` (requires feature `bincode_serde`)
- `ProstCodec` (requires feature `prost`) (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
- `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
- New book chapter about codecs
- The macro `use_derive_signal!` is now exported (thanks to @mscofield0).
### Breaking Changes 🛠
@ -35,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- 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>`. You have to enable both features `prost` and `base64` for this.
- All of these structs, traits and features now live in their own crate called `codee`
- `use_websocket`:
- `UseWebsocketOptions` has been renamed to `UseWebSocketOptions` (uppercase S) to be consistent with the return
type.

View file

@ -104,6 +104,7 @@
- [is_some](utilities/is_some.md)
- [use_cycle_list](utilities/use_cycle_list.md)
- [use_debounce_fn](utilities/use_debounce_fn.md)
- [use_derive_signal!](utilities/use_derive_signal.md)
- [use_supported](utilities/use_supported.md)
- [use_throttle_fn](utilities/use_throttle_fn.md)
- [use_to_string](utilities/use_to_string.md)

View file

@ -0,0 +1,5 @@
# use_derive_signal!
Macro to easily create helper functions that derive a signal using a piece of code.
See [`is_ok`](is_ok.md) or [`use_to_string`](use_to_string.md) as examples.

View file

@ -1,3 +1,6 @@
/// Macro to easily create helper functions that derive a signal using a piece of code.
///
/// See [`is_ok`] or [`use_to_string`] as examples.
#[macro_export]
macro_rules! use_derive_signal {
(