From 9c035d50d8fb9265a5d2761af57372e5c45f3ecd Mon Sep 17 00:00:00 2001 From: Maccesch Date: Mon, 8 Jul 2024 17:16:54 +0100 Subject: [PATCH] added docs and changelog --- CHANGELOG.md | 28 ++++++++++++-------- docs/book/src/SUMMARY.md | 1 + docs/book/src/utilities/use_derive_signal.md | 5 ++++ src/utils/use_derive_signal.rs | 3 +++ 4 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 docs/book/src/utilities/use_derive_signal.md diff --git a/CHANGELOG.md b/CHANGELOG.md index a9d18f2..a95080c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,23 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### New Features 🚀 -- 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 - string. - - This required feature `base64` - - It can be wrapped for example like this: `Base64`. -- There is now an `OptionCodec` wrapper that allows to wrap any string codec that encodes `T` to encode `Option`. - - Use it like this: `OptionCodec>`. +- 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`. + - There is now an `OptionCodec` wrapper that allows to wrap any string codec that encodes `T` to encode `Option`. + - Use it like this: `OptionCodec>`. + - `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`. 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. diff --git a/docs/book/src/SUMMARY.md b/docs/book/src/SUMMARY.md index 5c32d80..ba3a16b 100644 --- a/docs/book/src/SUMMARY.md +++ b/docs/book/src/SUMMARY.md @@ -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) diff --git a/docs/book/src/utilities/use_derive_signal.md b/docs/book/src/utilities/use_derive_signal.md new file mode 100644 index 0000000..a9ee135 --- /dev/null +++ b/docs/book/src/utilities/use_derive_signal.md @@ -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. diff --git a/src/utils/use_derive_signal.rs b/src/utils/use_derive_signal.rs index 1fafc75..1e7e9c2 100644 --- a/src/utils/use_derive_signal.rs +++ b/src/utils/use_derive_signal.rs @@ -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 { (