juice_network 0.13.0 copy "juice_network: ^0.13.0" to clipboard
juice_network: ^0.13.0 copied to clipboard

Unified network BLoC for Flutter - request coalescing, caching, retry, and interceptors built on the Juice framework.

Changelog #

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

0.13.0 - 2026-08-12 #

Changed #

  • Require juice ^1.6.0 and declare an explicit concurrency policy for every event.
  • Keep HTTP request events intentionally concurrent so request-key coalescing and maxConcurrentRequests continue to govern parallel work.
  • Coalesce overlapping initialization and serialize configuration, cancellation, cache-maintenance, reset, and observability mutations.

0.12.1 - 2026-06-16 #

Changed #

  • Allow juice_storage 2.0.0 (Hive CE migration). No API change.

0.12.0 - 2026-05-28 #

Added #

  • FetchBloc.withConfig(config, {required storageBloc, ...}) — one-step construct-and-initialize, matching the Juice family's withConfig convention (cf. AuthBloc.withConfig). The existing constructor + InitializeFetchEvent path is unchanged.

Changed #

  • Family coherence: FetchGroups is now abstract final; minimum SDK aligned to ^3.5.4. Both additive — no API changes.

0.11.0 - 2026-05-28 #

Fixed #

  • RequestKey identity headers are now matched case-insensitively. Previously only lowercase header names were recognized, so conventionally-capitalized identity headers (Accept, Content-Type, …) were silently dropped from the cache/coalescing key — two requests differing only by such a header could collide and serve the wrong response. (request_key.dart)
  • RequestCoalescer no longer leaks an unhandled async error when a non-coalesced request fails. The internal completer's future is now ignored if no caller coalesced onto it; the error is still rethrown to the originating caller and delivered to any coalesced awaiters. (request_coalescer.dart)

Added #

  • Comprehensive behavioral test coverage: RequestKey canonicalization, all five cache policies, cache-safety rules (auth/sensitive-endpoint/no-store), retry safety (idempotency + opt-in validation), interceptors (auth, API key, ETag, refresh-token singleflight), and cancellation/coalescing semantics.

Changed #

  • doc/SPEC.md reconciled with the shipping implementation; added an Implementation Notes section documenting intentional divergences (code is the source of truth).

0.10.0 - 2026-04-18 #

Changed #

  • Updated core dependency to juice: ^1.4.0
  • Updated storage dependency to juice_storage: ^1.2.0
  • Refreshed README positioning around lifecycle-aware fetch workflows and publishability

0.9.2 - 2026-02-13 #

Fixed #

  • Updated juice_storage dependency to ^1.1.0 which includes the hiveKeys method required by CacheManager

0.9.1 - 2026-02-13 [retracted] #

Fixed #

  • Updated juice_storage dependency from ^0.9.0 to ^1.0.0 (insufficient — hiveKeys was not in published 1.0.0)

0.9.0 - 2026-02-05 #

Added #

  • AuthIdentityProvider - User-specific cache/coalescing isolation for interceptor-injected auth
  • maxConcurrentRequests - Queue-based request concurrency limiting
  • Content-type aware decoding - Automatic JSON/text/bytes detection with proper error handling
  • Namespace filtering - Cache operations can now filter by namespace prefix
  • includeExpired parameter - Control whether expired entries are included in cache operations
  • bytesSent tracking - NetworkStats now tracks outgoing request body sizes
  • hiveKeys support - CacheManager can now scan all disk cache keys

Fixed #

  • deletePattern now scans disk keys, not just memory cache
  • avgResponseTimeMs now only averages successful requests (not failures)
  • Retry knobs (retryable, maxAttempts, idempotencyKey) now properly passed to RetryInterceptor
  • DecodeError now properly emitted on JSON parse and decoder failures

Changed #

  • Example app switched from jsonplaceholder.typicode.com to dummyjson.com (Cloudflare compatibility)

0.7.1 - 2025-01-14 #

Changed #

  • Refactored example app to use pure Juice patterns (StatelessJuiceWidget, dedicated blocs)
  • Removed escape hatch patterns (JuiceAsyncBuilder, StatefulWidget with setState)

0.7.0 - 2025-01-13 #

Initial Release #

Feature-complete release with comprehensive network functionality for the Juice framework.

Added #

  • FetchBloc - Unified BLoC for HTTP requests with Dio integration
  • Request Coalescing - Automatic deduplication of concurrent identical requests
  • Intelligent Caching - Multi-tier caching with configurable policies
    • Memory cache for fast access
    • Disk cache via juice_storage for persistence
    • Five cache policies: networkFirst, cacheFirst, staleWhileRevalidate, cacheOnly, networkOnly
  • Automatic Retry - Configurable retry with exponential backoff
  • Request Tracking - Real-time visibility into inflight requests
  • Statistics - Built-in metrics for cache hits, success rates, response times
  • Interceptors - Extensible interceptor system with priority ordering
    • AuthInterceptor for bearer token authentication
    • LoggingInterceptor for request/response logging
    • RetryInterceptor for custom retry logic
    • ETagInterceptor for conditional requests
    • RefreshTokenInterceptor for automatic token refresh
  • ReconfigureInterceptorsEvent - Runtime interceptor reconfiguration
  • HTTP Methods - Full support for GET, POST, PUT, PATCH, DELETE
  • Error Handling - Typed FetchError hierarchy for precise error handling
  • Rebuild Groups - Targeted widget rebuilds per request/cache/stats

Documentation #

  • Comprehensive README with badges and examples
  • Complete documentation in doc/ folder:
    • Getting Started guide
    • Caching guide
    • Coalescing guide
    • Interceptors reference
    • Errors reference

Dependencies #

  • Requires juice: ^1.2.0
  • Requires juice_storage: ^0.9.0 (updated to ^1.0.0 in 0.9.1)
  • Uses dio: ^5.4.0 for HTTP
2
likes
90
points
112
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Unified network BLoC for Flutter - request coalescing, caching, retry, and interceptors built on the Juice framework.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#bloc #state-management #network #http #caching

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

crypto, dio, flutter, juice, juice_storage

More

Packages that depend on juice_network