hyper-fetch
-
hyper-fetch-v5.0.0
Published by github-actions[bot] over 1 year ago
5.0.0 (2023-06-08)
βοΈ New Realtime Connectors
- Added new realtime connectors with the following features:
- Ability to directly change cache by
update
or set
methods
- Easier way to invalidate cache from listeners
𧨠Firebase, Graphql, Axios adapters
- Added adapters for Firebase, GraphQL, and Axios with the following capabilities:
-
Firebase: Admin, Firestore, and Realtime adapters for both node and browser
-
GraphQL: Simple GraphQL adapter with tags parsing, compatible with both node and browser
-
Axios: Supercharged Axios adapter for both node and browser
πͺ Sockets Improvements
- Implemented major improvements to sockets with the following enhancements:
- Added adapter bindings to simplyfy adapter creation process
- Introduced parameters support for both listeners and emitters
-
Improved types to indicate the state of instances
- Split the default adapter into WebSocket and SSE adapters
- Listeners now consume options object
- Emitters now consume options object
- Possibility to set
onData
hook to listeners
- New interface for handling websockets acknowledgements
Other changes:
- πΎΒ βRevalidateβ names changed into βinvalidateβ for core and βrefetchβ for react
- π―οΈ Added setEndpointMapper for client to allow parsing graphql DocumentNodes
- ππ»ββοΈ Method setAdapter can return new Client instance now and inherit itβs types
- πͺ’Β Emitter acknowledge event now pass parameters as single object
Bug Fixes
- π Constraints fix for firestore browser adapter (2b1aaa5)
- π Fixed internal issues with endpoint prop change (78ba22d)
- π Fixed setAdapter types (5c363f1)
- π onlyOnce option marked optional, remove unsub from extra (2beb2a7)
- π Types fixes (e4fb176)
Features
- πΈ Added Cache update method, provided callbacks to setter (89d8227)
- πΈ Added EndpointMapper and parsing gql Document (ae3e566)
- πΈ Added firebase sockets error handling (98271c8)
- πΈ Added GraphQl adapter (59413bb)
- πΈ Added query constraints typecheck (a21aa84)
- πΈ Added socket bindings defaults (724bf5d)
- πΈ Added SocketAdapter type, extra type and fixes (efe3b15)
- πΈ Adjusted the structure and naming (ad88ae6)
- πΈ Adjustments to the bindings and types (cf2983f)
- πΈ Axios adapter (3b81cdd)
- πΈ Axios adapter draft (37904cc)
- πΈ Changed revalidation into refetch/invalidate (b192ef6)
- πΈ Changed revalidation into refetch/invalidate (a01fdb7)
- πΈ Created realtime sockets adapter (1550791)
- πΈ Firebase adapter config setup (cf2e674)
- πΈ Firebase realtime sockets admin adapter (54b325f)
- πΈ Firestore Sockets Admin (1ec5a95)
- πΈ Improved createRequest types (163d65a)
- πΈ Improved Firebase adapters (00f17bb)
- πΈ Listener and Emitter API changes (770859b)
- πΈ Mocker improvements (1165675)
- πΈ mocker totalUploaded, totalDownloaded (e3a2be4)
- πΈ Socket command instances name changed to endpoint (b6616c6)
- πΈ Structure improvements (60716c3)
BREAKING CHANGES
- 𧨠'name' property in sockets instances of Emitter or Listener is no longer
valid and it is changed to 'endpoint' instead
- 𧨠Listener and Emitter API changes
- 𧨠Renamed hooks interfaces elements