Releases: BetterTyped/hyper-fetch
hyper-fetch-v5.2.0
hyper-fetch-v5.1.2
hyper-fetch-v5.1.1
hyper-fetch-v5.1.0
hyper-fetch-v5.0.2
hyper-fetch-v5.0.1
hyper-fetch-v5.0.0
5.0.0 (2023-06-08)
⚔️ New Realtime Connectors
- Added new realtime connectors with the following features:
- Ability to directly change cache by
update
orset
methods - Easier way to invalidate cache from listeners
- Ability to directly change cache by
🧨 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
hyper-fetch-v4.0.2
hyper-fetch-v4.0.1
hyper-fetch-v4.0.0
4.0.0 (2023-05-19)
Highlights
✨ New response interface
We have changed the structure of our response interface. Instead of an array, it now returns an object. The interface also provides additional data objects with adapter-specific data. By default, it gives you response headers.
🔮 Improved adapters
We have improved our adapters. The new interface allows for much greater configuration and extensibility. Now you can easily attach any library with any protocol you want. This comes with a next-level TypeScript interface that controls type safety.
🎭 Mocker
Create your own responses with full support for functionalities like success/error responses, request sequences, upload/download progress, response time, and more.
💎 Request Mappers
Modify, map, or validate requests before sending them to the server.
🚀 Response Mappers
Modify, map, or validate responses from the server.
Other changes:
- 📡 Key mappers - In Hyper Fetch, everything is grouped by keys. Now you can provide global key generation strategies to make this process fully custom.
- 🎡 Flattened cache of response object - This allows for better and easier interactions with the cache.
- 🗺️ Added TSD TypeScript tests - We locked crucial TypeScript rules and made a solid foundation for testing our TypeScript.
- 🪴 Added isSuccess value - This property on the response tells us whether our request was successful.
- 🏵️ Adapters new generic types - We can set custom types for request methods, options, query parameters, and additional data passed with the response.
- 🎸 Stringify Query Params - We added parsing of dates and nested objects in query params.
- 🐛 Tons of bug fixes and tests - We had to improve many parts of the system to make it faster, better, and more customizable. We fixed many TypeScript issues and locked crucial parts with TypeScript tests. FormData fixes on the node adapter.
Bug Fixes
- 🐛 Added setting cache onError, calling unsub each test (4a72bd7)
- 🐛 Env fixes and promise handling improvements (0487b19)
- 🐛 fix: Fixed ClientInstance type and adapterBindings types (c1b9a0c)
- 🐛 Fixed typeof this -> this in Cache generic (0f0c273)
- 🐛 Fixed types issues (0a90619)
- 🐛 missing queryParams in ExtractUnionAdapter (54d43b5)
- 🐛 Object parsing in query params (42520e3)
- 🐛 Options for onValue may be undefined (94e9ea6)
- 🐛 TS fix (a962653)
- 🐛 ts fixes (7e1ff4c)
- 🐛 TS quickfix (ec9d1ee)
Features
- 🎸 AdapterType is now a generic (14e1166)
- 🎸 Added adapter union extraction (6a5b8cf)
- 🎸 Added all firestore methods (base version) (c35efbf)
- 🎸 Added groupByChangeType option for firestore onSnapshot (5b7cf8e)
- 🎸 Added Key mapper (ba9c066)
- 🎸 Added merge option for setDoc (78b7d96)
- 🎸 Added onlyOnce option for onValue method (d5e99ed)
- 🎸 Added request mocker PoC (51f3036)
- 🎸 Added response Headers to the additional data (762b343)
- 🎸 Cache data structure reworked (0c16fd1)
- 🎸 Dispatcher storage update and new request methods (4eb1723)
- 🎸 firebase realtime/firestore web/admin works (d6969dd)
- 🎸 Firestore query constraints are working correctly (13530fd)
- 🎸 Handle Methods type from Adapter generic (ce0fa8f)
- 🎸 Handled emptyResource status for firebase (d84b018)
- 🎸 Improved namings (57e4285)
- 🎸 isSuccess param is now available in the response (c5aafc0)
- 🎸 mocker improvement - additionalData mock, string status (bf5d75e)
- 🎸 Response mapper adjustments (bab277f)
- 🎸 Response mapper adjustments (c45b3ae)
- 🎸 Setup (8e0a8f3)
- 🎸 Typescript improvements (8956ca2)
- 🎸 Working request lifecycle for firebase (9005a47)
BREAKING CHANGES
- 🧨 Dispatcher storage is now storing Request instead of jsons, we changed
the way our hooks interact with bindings and adapter - 🧨 Client now accepts AdapterType instead of AdapterOptionsType as a second
generic.