4.9 KiB
4.9 KiB
Changelog
2025-07-28 - 4.0.0 - BREAKING CHANGE(core)
Complete architectural overhaul with cross-platform support
Breaking Changes:
- Renamed
SmartRequestClient
toSmartRequest
for simpler, cleaner API - Removed legacy API entirely (no more
/legacy
import path) - Major architectural refactoring:
- Added abstraction layer with
core_base
containing abstract classes - Split implementations into
core_node
(Node.js) andcore_fetch
(browser) - Dynamic implementation selection based on environment
- Added abstraction layer with
- Response streaming API changes:
stream()
now always returns web-styleReadableStream<Uint8Array>
- Added
streamNode()
for Node.js streams (throws error in browser)
- Unified type system with single
ICoreRequestOptions
interface - Removed all "Abstract" prefixes from type names
Features:
- Full cross-platform support (Node.js and browsers)
- Automatic platform detection using @push.rocks/smartenv
- Consistent API across platforms with platform-specific capabilities
- Web Streams API support in both environments
- Better error messages for unsupported platform features
Documentation:
- Completely rewritten README with platform-specific examples
- Added architecture overview section
- Added migration guide from v2.x and v3.x
- Updated all examples to use the new
SmartRequest
class name
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 toaccept()
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
- Updated README to include detailed examples for the modern fluent API, covering GET, POST, headers, query, timeout, retries, and pagination
- Added a migration guide comparing the legacy API and modern API usage
- Improved installation instructions with npm, pnpm, and yarn examples
- Added and updated test files for both legacy and modern API functionalities
- Minor formatting improvements in the code and documentation examples
2024-11-06 - 2.0.23 - fix(core)
Enhance type safety for response in binary requests
- Updated the dependency versions in package.json to their latest versions.
- Improved type inference for the response body in getBinary method of smartrequest.binaryrest.ts.
- Introduced generic typing to IExtendedIncomingMessage interface for better type safety.
2024-05-29 - 2.0.22 - Documentation
update description
2024-04-01 - 2.0.21 - Configuration
Updated configuration files
- Updated
tsconfig
- Updated
npmextra.json
: githost
2023-07-10 - 2.0.15 - Structure
Refactored the organization structure
- Switched to a new organization scheme
2022-07-29 - 1.1.57 to 2.0.0 - Major Update
Significant changes and improvements leading to a major version update
- BREAKING CHANGE: Switched the core to use ECMAScript modules (ESM)
2018-08-14 - 1.1.12 to 1.1.13 - Functional Enhancements
Enhanced request capabilities and removed unnecessary dependencies
- Fixed request module to allow sending strings
- Removed CI dependencies
2018-07-19 - 1.1.1 to 1.1.11 - Various Fixes and Improvements
Improvements and fixes across various components
- Added formData capability
- Corrected path resolution to use current working directory (CWD)
- Improved formData handling
- Included correct headers
- Updated request ending method
2018-06-19 - 1.0.14 - Structural Fix
Resolved conflicts with file extensions
- Changed
.json.ts
to.jsonrest.ts
to avoid conflicts
2018-06-13 - 1.0.8 to 1.0.10 - Core Updates
Ensured binary handling compliance
- Enhanced core to uphold latest standards
- Correct binary file handling response
- Fix for handling and returning binary responses
2017-06-09 - 1.0.4 to 1.0.6 - Infrastructure and Type Improvements
Types and infrastructure updates
- Improved types
- Removed need for content type on post requests
- Updated for new infrastructure