Skip to content

Releases: jonathangaldino/kouch

Release list

Kouch 0.1.0

Choose a tag to compare

@jonathangaldino jonathangaldino released this 16 Oct 16:29

First release: a behavioral port of TanStack Query (@tanstack/query-core 5.104.3,
@tanstack/query-persist-client-core 5.104.3 and @tanstack/query-async-storage-persister 5.104.3). It is checked
by 176 scenarios that run against both TanStack and Kouch.

Added

  • Kouch core:
    • Query keys, query state, Query, QueryCache, QueryClient and QueryObserver, including
      getOptimisticResult and an AsyncStream of results.
    • Stale time, garbage collection, deduplication, retries and backoff, cancellation (including abort when the last
      observer leaves) and invalidation.
    • Network modes and focus/reconnect refetching (OnlineManager backed by NWPathMonitor, FocusManager).
    • Mutations: Mutation, MutationCache, MutationObserver, scopes, and defaults set with setMutationDefaults.
    • Infinite queries: InfiniteQueryObserver, fetchInfiniteQuery, maxPages.
    • QueriesObserver with combine.
    • Streamed queries: streamedQuery with the reset, append and replace modes.
    • dehydrate / hydrate.
    • Persistence: restore, save, subscribePersistence, persist, and StoragePersister with throttling and
      removeOldestQuery retry. Storage options are FileQueryStorage and InMemoryQueryStorage. Persisted data is
      Codable and decoded lazily.
    • Options:
      • meta, and function contexts carrying client, meta and mutationKey.
      • Values computed per query: StaleTime.dynamic, RefetchTrigger.dynamic, RefetchInterval.dynamic,
        .enabled { }, .initialData { }.
      • retryOnMount, skipToken, and throwOnError on refetches.
      • getQueriesData / setQueriesData, mutationCache.find.
  • KouchSwiftUI:
    • .queryClient(_:) and .queryClient(_:persister:), which restores the cache before queries mount.
    • @ObservedQuery, @ObservedSelectQuery, @ObservedInfiniteQuery, @ObservedQueries, @ObservedMutation,
      @ObservedIsFetching, @ObservedIsMutating and @ObservedMutationState.

Installation

.package(url: "https://github.com/jonathangaldino/kouch.git", from: "0.1.0")

Thanks

Kouch is a behavioral port of TanStack Query. All of its behavior is TanStack Query's design, checked against the real implementation. Thank you, Tanner Linsley and every TanStack contributor.