Releases: gaucho-labs/leptos-query
v0.5.3
What's Changed: Leptos Query v0.5.3
- Infinite suspense fix by @nicoburniske in #31
- Improved crate overview docs
What's Changed: Leptos Query Devtools v0.1.3
- Fixed styling bug
- Improved crate overview docs
Full Changelog: v0.5.2...v0.5.3
v0.5.2
What's Changed
- Fix Devtools by @nicoburniske in #26
- Persister for IndexDB by @nicoburniske in #25
- Update Observers of all existing cache entries upon registration by @nicoburniske in #27
Devtools version updated to v0.1.1
which fixed the following:
- Fix overflow of toolbar
- Fix stale_time and gc_time logic (properly showing infinity)
- Ensure that observer_count is remains positive
Full Changelog: v0.5.1...v0.5.2
v0.5.1
What's Changed
- Fix spawn local outside localset by @nicoburniske in #24
- Bug fix for having query in root route and not on navigation
- Introduce
with_query_supression
for running a closure with query suppression
Full Changelog: v0.5.0...v0.5.1
v0.5.0
What's Changed
New Features
- Introduce
create_query
to group common query types. Removes the necessity of having to supply <K,V> types to query client methods (very error prone). - Cache Observers
leptos_query::cache_observer::CacheObserver
- Configurable Cache-wide default options
leptos_query::DefaultOptions
- Added Devtools crate to introspect state, and interact with, queries.
- Query Cache can be cleared
QueryClient::clear()
- Client side persisters
leptos_query::query_persister::QueryPersister
- LocalStorage impl provided
leptos_query::query_persister::LocalStoragePersister
- LocalStorage impl provided
- Add local resource option to QueryOptions (for create_local_resource)
- Query cancellation
QueryClient::cancel_query
Breaking changes
-
Renamed
cache_time
togc_time
(garbage collection time) -
is_stale
field removed fromQueryResult
-
fetch_query and prefetch_query are now async functions for one off mutations
-
IMPORTANT Query Key types may not correspond to multiple value types anymore. A
Key
type may only be globally associated with a singleValue
type.- Otherwise it is very bug prone. Becomes too easy to mistakenly supply wrong types to
QueryClient
, and have nothing happen.
- Otherwise it is very bug prone. Becomes too easy to mistakenly supply wrong types to
Misc changes
- Remove signals from core entirely. "Observer" pattern is used more.
- More efficient and reliable query eviction
Full Changelog: v0.4.0...v0.5.0
v0.4.0
What's Changed
Added support for Leptos 0.6
- Update Cargo.toml by @ifiokjr in #16
- Upgrade leptos dependency to 0.6 by @SleeplessOne1917 in #19
New Contributors
- @ifiokjr made their first contribution in #16
- @SleeplessOne1917 made their first contribution in #19
Full Changelog: v0.3.0...v0.4.0
v0.3.0
What's Changed
- readme: Link to leptos resource docs by @srid in #4
- Improve README and add FAQ by @nicoburniske in #10
- Upgrade to leptos v0.5.0-rc2 by @DonAlonzo in #12
- Finalize 0.5 Release by @nicoburniske in #13
New Contributors
- @srid made their first contribution in #4
- @DonAlonzo made their first contribution in #12
Full Changelog: v0.2.3...v0.3.0
v0.2.3
Bug Fix
- Fixed improper usage of
create_memo
that caused aBorrowError
when invalidating an active query
Query Client Improvements
- Added
invalidate_query_type
andinvalidate_all
methods - Removed redundant
QueryClient::set_query_data_now
- Improve ergonomics of QueryClient methods using
std::borrow::Borrow
- Add examples to docs
What's Changed
- Query Client Improvements by @nicoburniske in #5
Full Changelog: v0.2.0...v0.2.3
v0.2.0
Changes
New version based on introduction of QueryState<V>
enum
Fix premature Query eviction from cache
A Query will only be evicted from cache once it are no longer being used, and the specified cache_time
has elapsed since the last update. If a query gets marked for eviction, then receives an update as it's being used, it will not get evicted from cache and the timeout will restart.
New QueryState<V>
enum
QueryResult
now contains a signal for the current QueryState
. This required a lot of changes internally, but only a few for users.
Stale is intentionally not a state, and is instead a derived signal inside of QueryResult
. This distinction allows for a query to be stale, while also having a descriptive state.
Here's what it looks like:
pub enum QueryState<V> {
/// The initial state of a Query upon its creation.
Created,
/// Query is fetching for the first time.
Loading,
/// A Query is in the process of fetching, not being its first fetch.
Fetching(QueryData<V>),
/// The state indicating that a query has successfully completed a fetch operation.
Loaded(QueryData<V>),
/// The state indicating that a query has completed a fetch, but the fetched data is marked as invalid.
Invalid(QueryData<V>),
}
Refactor of QueryResult
QueryResult now becomes QueryResult<V, impl RefetchFn>
RefetchFn
is equivalent toFn() + Clone
QueryResult::refetch
is nowFn() + Clone
instead ofSignalSetter<()>
QueryResult
now contains aQueryState<V>
- Removed Signal for
updated_at
Misc
- Removed
QueryClient::get_query_data
due to inconsistent behavior.
What's Changed
- Reactive Key for use_query by @nicoburniske in #1
- Query state enum refactor + Fixing Cache Cleanup by @nicoburniske in #3
New Contributors
- @nicoburniske made their first contribution in #1
Full Changelog: https://github.com/nicoburniske/leptos_query/commits/v0.2.0