Skip to content

Releases: sunkeydokey/SunKit

0.2.1

Choose a tag to compare

@sunkeydokey sunkeydokey released this 03 Jun 12:51

Patch release for 0.2 documentation.

  • Updates the Swift Package Manager installation examples in the English and Korean READMEs to use from: "0.2.1".
  • No runtime API or behavior changes.

0.2.0

Choose a tag to compare

@sunkeydokey sunkeydokey released this 03 Jun 10:06

SunKit 0.2.0

SunKit 0.2.0 continues the pre-1.0 SwiftUI-first mobile server-state runtime direction. This release expands the SwiftUI adapter surface, improves infinite/paginated query behavior, and updates documentation around the 0.2 positioning.

Highlights

  • Added MutationBinding for SwiftUI mutation flows.
  • Added examples demonstrating mutation-driven invalidation.
  • Added convenience overloads for QueryBinding.
  • Added a state-backed paginated query example and documented page ownership styles.
  • Improved infinite query page refetch behavior.
  • Updated README and DocC wording from the v0.1 preview positioning to the 0.2 line.

SwiftUI

  • @MutationBinding now owns a stable MutationState and reads QueryClient from the SwiftUI environment.
  • Paginated query docs now explain when the page should be owned by PaginatedQueryBinding versus regular SwiftUI @State.
  • Examples now cover mutation invalidation and state-backed pagination patterns.

Core / Infinite Query

  • Infinite query refetching now aligns loaded page behavior more clearly with the documented API semantics.
  • Infinite query docs and tests were updated around accumulated page data and refetch behavior.

Documentation

  • README and DocC now describe 0.2 as a SwiftUI-first, mobile Apple platform line.
  • Completion-based fetcher cancellation and infinite/parallel query limitations are documented as outside the 0.2 API surface where relevant.
  • Korean README link/path casing was corrected.

Not Included

The following remain outside the 0.2 scope:

  • Process-global QueryClient options
  • Disk persistence / offline mutation resume
  • Optimistic updates
  • UIKit observer
  • Global isFetching / isMutating

Installation

.package(url: "https://github.com/sunkeydokey/SunKit", from: "0.2.0")

0.1.1

Choose a tag to compare

@sunkeydokey sunkeydokey released this 27 May 16:57

What's Changed

New Features

Observer-level cache options
QueryState, PaginatedQueryState, and InfiniteQueryState now accept a cacheOptions parameter. This lets each observer define its own staleTime and
gcTime independently of the client defaults. Two views watching the same key can have different stale thresholds, and the last subscriber's gcTime
controls when inactive data is removed.

@QueryBinding(
    cacheOptions: QueryCacheOptions(staleTime: 120)
) private var repositories: QueryState<[Repository], [Repository]>

QueryState convenience accessors
data, error, isPending, isFetching, isSuccess, and isError are now available directly on QueryState. Accessing result is only needed for less common
properties like isStale or isPlaceholderData.

// before
if queryState.result?.isPending == true { ... }

// after
if queryState.isPending { ... }

Bug Fixes

- Fixed queryClient environment not being written through the correct backing key, causing the value to not propagate to child views in some configurations.
- Fixed a crash when SwiftUI adapters were used without .queryClient(...) in the environment — now terminates with a clear fatalError message instead of a
silent misbehavior.

0.1.0

Choose a tag to compare

@sunkeydokey sunkeydokey released this 26 May 02:59

SunKit 0.1.0

Mobile server-state runtime for Swift 6, iOS 18, tvOS 18, macOS 15.

What's included

  • Actor-isolated QueryClient with typed QueryKey<Value> cache
  • fetchQuery, ensureQueryData, in-flight deduplication, retry with exponential backoff
  • Stale-while-revalidate, stale timers, GC timers
  • Query invalidation (exact + prefix), removeQueries, manual cache writes
  • Infinite query (fetchInfiniteQuery, fetchNextPage)
  • Parallel query batch (fetchQueries, AnyParallelQuery)
  • Core mutations with explicit invalidation
  • SwiftUI adapters: QueryBinding, InfiniteQueryBinding, PaginatedQueryBinding, ParallelQueriesBinding, MutationState
  • Dynamic enabled, select, placeholderData: .keepPreviousData
  • refetchOnSubscribe, refetchOnSceneActive, refetchOnNetworkReconnect, refetchInterval

Not included in 0.1

  • Disk persistence, offline mutation resume
  • Optimistic updates
  • UIKit observer
  • Global isFetching / isMutating