BREAKING CHANGE(core): major architectural refactoring with fetch-like API
This commit is contained in:
27
changelog.md
27
changelog.md
@@ -1,5 +1,32 @@
|
||||
# Changelog
|
||||
|
||||
## 2025-07-27 - 3.0.0 - BREAKING CHANGE(core)
|
||||
Major architectural refactoring with fetch-like API
|
||||
|
||||
**Breaking Changes:**
|
||||
- Legacy API functions are now imported from `@push.rocks/smartrequest/legacy` instead of the main export
|
||||
- Modern API response objects now use fetch-like methods (`.json()`, `.text()`, `.arrayBuffer()`, `.stream()`) instead of direct `.body` access
|
||||
- Renamed `responseType()` method to `accept()` in modern API
|
||||
- Removed automatic defaults:
|
||||
- No default keepAlive (must be explicitly set)
|
||||
- No default timeouts
|
||||
- No automatic JSON parsing in core
|
||||
- Complete internal architecture refactoring:
|
||||
- Core module now always returns raw streams
|
||||
- Response parsing happens in SmartResponse methods
|
||||
- Legacy API is now just an adapter over the core module
|
||||
|
||||
**Features:**
|
||||
- New fetch-like response API with single-use body consumption
|
||||
- Better TypeScript support and type safety
|
||||
- Cleaner separation of concerns between request and response
|
||||
- More predictable behavior aligned with fetch API standards
|
||||
|
||||
**Documentation:**
|
||||
- Updated all examples to show correct import paths
|
||||
- Added comprehensive examples for the new response API
|
||||
- Enhanced migration guide
|
||||
|
||||
## 2025-04-03 - 2.1.0 - feat(docs)
|
||||
Enhance documentation and tests with modern API usage examples and migration guide
|
||||
|
||||
|
Reference in New Issue
Block a user