fetch_api 2.3.1
fetch_api: ^2.3.1 copied to clipboard
JavaScript bindings for Fetch API, flexible HTTP requests, redirects, streaming and more.
2.3.1 #
- Fix lint errors.
- Use
package:zekfad_lints/lib.yamlwhich aligns with core lints.
2.3.0 #
Requires Dart 3.6
- Use proper JS type checks.
- Add missing docs to public API.
- Add missing
FileandJSDataViewtoRequestBodyunion. - Add missing
JSDataViewtoResponseBodyunion. - Update license years.
ReadableStreamSourceCancelMethodFunctionreturnsJSPromiseOr, because this method can return synchronously.- Fix
ReadableStreamSource.fromStreamcancel after error (#6) - Add
canStreamRequestsfunction to check if streaming is supported in current browsers.
2.2.0 #
Current usage is mostly limited to
package:fetch_clientand these changes restores WASM support, therefore no major version bump was made.
- BREAKING
ReadableStreamDefaultReader.readAsStreamis now generic as in actual stream. - BREAKING
ReadableStream.fromTypedDataStreamnow have 2 generic parametersT extends TypedDataandAbortType extends JSAnyinstead of singleAbortType. Method itself now always returnsReadableStream<JSUint8Array, AbortType>, this means that anyTypedDatais re-viewed to beUint8List. - BREAKING
RequestBodyandResponseBodynow constructible only from JS types:- Removed
fromByteBufferinstead addedfromJSArrayBuffer. - Removed
fromTypedDatainstead addedfromJSTypedArray. - Removed
fromStringinstead addedfromJSString. fromReadableStreamtightened type toReadableStream<JSUint8Array, JSAny>because fetch supports only streams ofUint8Arrays.
- Removed
- BREAKING Fixed typo
RequestDestination.sharedworkertoRequestDestination.sharedWorker. - Fixed
ResponseandRequestnot working in WASM: this happened due to JS runtime being more lax in type assertions, namelyJSStringasStringis ok in JS runtime, but fails in WASM. ResponseandRequestnow use precise typeReadableStream<JSUint8Array, JSAny>
2.1.0 #
- Add
package:fetch_api/enums.dartfetch_api.enumspackage with enumerations available for all platforms (including VM). - Use
DOMExceptionfrompackage:webinstead of alias toJSObject. - Enumerations use
if (dart.library.io) ''for documentation-only imports, this allows to use them in non-JS environments.
2.0.0 #
- BREAKING: migrate to
package:webwith WASM support. - Full rewrite to use
extension types - no moreInstanceMembers. - Internal JS Iterators are now fully covered with generics.
- JS Iterator is no longer exported via public API.
Headersnow use(String, String)in entries instead ofList<String>.FetchOptionsandRequestOptionsare now inherited fromRequestInitand interchangeable.ReadableStreamSourcestart,pullandcancelare now only callable via JS interop, as they require binding to parent object.
1.0.3 #
- Remove type from
IteratorInstanceMembersto support old language version. Technically this is a breaking, andIteratorResultfalls back todynamicnow, but it isn't exposed via public API and wrapper still works the same.
1.0.0 #
- Public stable release.
- Bumped
jsdependency to^0.6.7.
1.0.0-dev.5 #
- BREAKING: Renamed
RequestInittoFetchOptions. This is done to make emphatic, thatfetchandRequesthave different (default) behaviors. - Added
Request. - Added
RequestDuplex. This adds support for request streaming in supported browsers. - Added
ReadableStreamSource. This allows you to create customReadableStreams, that is required for request streaming. - Added
ReadableStreamDefaultController. - Added
ReadableStreamSourceclass that helps you to create custom source forReadableStreams. It can be created from Dart'sStream. - Added
RequestCache. - Added
RequestDestination. - Added missing options to
RequestModeand added docs. - Added
FetchOptionsandRequestOptionswith corresponding docs from MDN. - Compatibility layer:
- BREAKING: Renamed
createRequestInittocreateFetchOptions - Added
createRequestOptions. - Added
createReadableStream. - Added
createReadableStreamSourceFromStream.
- BREAKING: Renamed
- Fixed dev dependency versions, to allow running on Dart 2.19.
1.0.0-dev.4 #
- Fixes for
js.Iteratorwith Arrays. (Resolves issue withHeaders).
1.0.0-dev.3 #
-
BREAKING: Renamed extensions from
<Class>Extensionto<Class>InstanceMembers. -
Added
fetch_api.compatibility_layerlibrary to support Dart 2.19.- Added
createHeadersFromMap - Added
createHeadersFromArray - Added
createRequestInit - Added
createAbortSignalTimeout
- Added
-
AbortSignal- Added
timeoutconstructor-like method. - Added
abortconstructor-like method. - Added
abortedproperty. - Added
reasonproperty. - Added
throwIfAbortedmethod.
- Added
-
AbortController- Added docs.
-
fetch()added docs. -
Response- Fixed internal definition for
_formDatamethod. - Added docs.
- Fixed internal definition for
-
Headers- Added docs.
-
IteratorandIteratorResult- Added docs.
-
ReadableStreamDefaultReaderandReadableStreamDefaultReaderChunk- Added docs.
1.0.0-dev.2 #
- Downgraded
jsdependency to^0.6.5.
1.0.0-dev.1 #
- Initial version.