hyper-fetch
-
hyper-fetch-v4.0.0
Published by github-actions[bot] over 1 year ago
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.