The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- (@feral-dot-io) The use
use_<type>_storage
functions have been rewritten to useCodec
s instead of always requiringserde
.- This also removes the feature
storage
- By default the
StringCodec
is used which relies on types implementingFromString + ToString
- If you want to use
JsonCodec
you have to enable the featureserde
- If you want to use
ProstCodec
(new!) you have to enable the featureprost
.
- This also removes the feature
- (@feral-dot-io) The Rust flag
--cfg=web_sys_unstable_apis
is not needed anymore since relevantweb_sys
APIs are now stable. This affects in particularuse_element_size
use_resize_observer
use_raf_fn
anduse_timestamp
no longer spam warnings because ofget
ting signals outside of reactive contexts.use_infinite_scroll
no longer calls the callback twice for the same eventuse_scroll
now usestry_get_untracked
in the debounced callback to avoid panics if the context has been destroyed while the callback was waiting to be called.
- Fixed SSR for
- use_timestamp
- use_raf_fn
- use_idle
- Using strings for
ElementMaybeSignal
andElementsMaybeSignal
is now SSR safe.- This fixes specifically
use_color_mode
to work on the server.
- This fixes specifically
use_web_notification
(thanks to @centershocks44)use_infinite_scroll
use_service_worker
(thanks to @lpotthast)
use_scroll
returnsimpl Fn(T) + Clone
instead ofBox<dyn Fn(T)>
.
UseScrollReturn
is now documented
- Some functions still used
window()
which could lead to panics in SSR. This is now fixed. Specifically foruse_draggable
.
use_sorted
use_timestamp
use_idle
use_document
use_window
use_geolocation
signal_debounced
signal_throttled
- Leptos version is now 0.5
- No
cx: Scope
params are supported/needed anymore because of the changes in Leptos. Please check the release notes of Leptos 0.5 for how to upgrade. watch
is now deprecated in favor ofleptos::watch
and will be removed in a future release.watch_with_options
will continue to exist.use_event_listener_with_options
now takes aUseEventListenerOptions
instead of aweb_sys::AddEventListenerOptions
.use_mutation_observer_with_options
now takes aUseMutationObserverOptions
instead of aweb_sys::MutationObserverInit
.use_websocket
:- takes now a
&str
instead of aString
as itsurl
parameter. - same for the returned
send
method. - The
ready_state
return type is now renamed toConnectionReadyState
instead ofUseWebSocketReadyState
. - The returned signals
ready_state
,message
,message_bytes
have now the typeSignal<...>
instead ofReadSignal<...>
to make them more consistent with other functions. - The options
reconnect_limit
andreconnect_interval
now take au64
instead ofOption<u64>
to improve DX. - The option
manual
has been renamed toimmediate
to make it more consistent with other functions. To port please note thatimmediate
is the inverse ofmanual
(immediate
=!manual
). - Added documentation how pass it ergonomically as context.
- takes now a
use_color_mode
:- The optional
on_changed
handler parameters have changed slightly. Please refer to the docs for more details.
- The optional
- Throttled or debounced functions cannot be
FnOnce
anymore. - All traits
ClonableFn...
have been removed.
use_websocket
can use relative urls now- Callbacks in options don't require to be cloneable anymore
- Callback in
use_raf_fn
doesn't require to be cloneable anymore - All (!) functions can now be safely called on the server. Specifically this includes the following that before
panicked on the server:
use_scroll
use_event_listener
use_element_hover
on_click_outside
use_drop_zone
use_element_size
use_element_visibility
use_resize_observer
use_intersection_observer
use_mutation_observer
use_element_visibility
didn't work in some cases on Chrome properly. This has been fixed.
use_websocket
panicked after unmount
use_event_listener_with_options
removes the handlers now correctly.
use_storage
now uses.get_untracked()
to avoid warnings.
use_draggable
use_to_string
is_err
is_ok
is_none
is_some
use_raf_fn
- The following functions now accept a
MaybeRwSignal
as their initial/default value which means you can use a synchronizedRwSignal
in those places.use_color_mode
use_cycle_list
use_favicon
use_storage
use_local_storage
use_session_storage
- Instead of returning
ReadSignal
, the following functions now returnSignal
.use_color_mode
use_favicon
use_storage
use_local_storage
use_session_storage
use_drop_zone
now uses.get_untracked()
in event handlers
use_drop_zone
use_websocket
(thanks @sectore)use_intl_number_format
- Crate is ready for Server-Side Rendering. Enable feature
ssr
like you do forleptos
.
use_window_focus
use_window_scroll
use_document_visibility
- Required
leptos
version is now 0.4 - Following the changes in
leptos
there is no longer astable
crate feature required in order to use this library with a stable toolchain. If you want to use it with a nightly toolchain you have to enable thenightly
feature only onleptos
directly. No change is required forleptos-use
itself.
use_color_mode
use_cycle_list
use_active_element
- You can now use this crate with the
stable
toolchain (thanks @lpotthast) - Set leptos dependency to
default-features = false
in order to enable SSR.
use_css_var
use_element_hover
use_interval_fn
use_interval
use_event_listener
no longer returns aBox<dyn Fn()>
but aimpl Fn() + Clone
- You can now specify a
&str
orSignal<String>
with CSS selectors wherever a node ref is accepted - Callbacks of the following functions no longer require
Clone
use_resize_observer
use_intersection_observer
- These functions now also accept multiple target elements in addition to a single one:
use_resize_observer
use_intersection_observer
whenever
use_mutation_observer
use_abs
on_click_outside
use_intersection_observer
use_element_visibility
watch
doesn't acceptimmediate
as a direct argument anymore. This is only provided by the option variant.watch
has now variantwatch_with_options
which allows for debouncing and throttling.
use_storage
use_local_storage
use_session_storage
watch_debounced
watch_throttled
watch_pausable
use_ceil
use_round
use_media_query
use_preferred_dark
use_preferred_contrast
use_favicon
use_breakpoints
- Function count badge in readme
- Fixed documentation and doc tests running for functions behind
#[cfg(web_sys_unstable_apis)]
use_element_size
- Fixed documentation so all feature are documented
use_floor
use_max
use_min
- New feature:
math
that has to be activated in order to use the math functions.
use_supported
use_resize_observer
watch
use_mouse
- Use the crate
default-struct-builder
to provide ergonimic function options.
use_scroll
use_debounce_fn
- Better and more beautiful demo integration into the guide.