Releases: D1g1talEntr0py/transportr
Changed some classes to be private and removed some unused code. Optimized the '#request' method.
Changed some classes to be private and removed some unused code. Optimized the '#request' method.
I know, I need a better README.md file...
Fixed regression the 'searchParams' option was not being passed to the method that creates the URL for the request and fixed broken references in some tests.
Fixed regression the 'searchParams' option was not being passed to the method that creates the URL for the request and fixed broken references in some tests.
Fixed regression where the 'Events' static field was renamed erroneously to 'RequestEvents'.
Fixed regression where the 'Events' static field was renamed erroneously to 'RequestEvents'.
Added new classes and refactored parameter handling.
Added new classes and refactored parameter handling.
- Added custom AbortSignal class to allow for aborting requests directly from the signal via a method or timeout.
- Created a constants file to hold static data. Will be adding more to this file as needed.
- Added 'JSON_MERGE_PATCH' to the 'HttpMediaType' constant.
- Created a 'ParameterMap' class to allow for easier aggregation of parameters.
- Removed 'SignalController' class and replaced it with the 'AbortSignal' class.
- Refactored how requests are handled to improve parameter handling and readability. Also added a Proxy to the options and trap for the 'signal' property to allow the timer to start when the signal is accessed in the request.
- Added additional unit tests.
- Updated project dependencies.
Fixed a bug where the #baseUrl was being modified on each request and added the ability to make requests without a path.
Fixed a bug where the #baseUrl was being modified on each request and added the ability to make requests without a path.
- Modified the
#createUrl()
method to create a copy of the #baseUrl on each request. This fixes a bug where some requests were being made to the wrong URL. - Changed the
#request()
method to allow thepath
parameter to be optional. If no path is provided, the#baseUrl
will be used instead. - Modified the JSDoc comments to reflect the fact that the
path
parameter is now optional for all requests. The#baseUrl
will be used if no path is provided.
Changed the default timeout to 30 seconds, instead of 10.
Added ability to abort all active requests and also bypass global event handlers
Title says it all mostly.
Transportr.abortAll()
- Aborts all active requests. Handy for onbeforeunload
event of the window
Transportr.Event.ALL_COMPLETE
can be used to register an event handler. Handy for when you want to process something after all of the requests are complete.
Full Changelog: v1.1.0...v1.2.0
Added event system using the observer pattern
Added an event system that can be used to listen for a set list of events ['configured', 'success', 'error', 'aborted', 'timeout', 'complete']
Fix for bug with accepting FormData as body
Fix for bug with accepting FormData as body. Some other optimizations and unit tests.
Set the default content-type and accept headers to JSON
Set the default content-type and accept headers to JSON. No extra configuration required to send or receive JSON.