Skip to content

Release 5.0.0 #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Feb 12, 2021
Merged

Release 5.0.0 #149

merged 10 commits into from
Feb 12, 2021

Conversation

js2me
Copy link
Member

@js2me js2me commented Feb 11, 2021

Fixes:

Features:

  • Ability to provide custom formatting fetch response
  • "IMAGE" content kind for response\request data objects
  • RequestParams RequestHeaders types for --route-types (routeTypes: true) option (issue Route parameter types #150, thanks @Fabiencdp )
  • --default-response option. Allows to set default type for empty response schema (default: void) (based on issue Default response body type. #14)
  • Request cancellation support (issue Request cancellation support #96, thanks @ApacheEx)
    RequestParams type now have the cancelToken field
    HttpClient instance now have the abortRequest(cancelToken) method

BREAKING_CHANGES:

  • Fully refactored http-client.eta template, make it more flexible and simpler.
    HttpClient["request"] takes one argument with type FullRequestParams
    (previously it takes many count of arguments which was not flexible)
  • Changed the default response body type from any to void (issue Default response body type. #14)

Internal:

  • Changed templates:
    • http-client.eta
    • procedure-call.eta
    • api.eta

This version works with previous templates.

…ge content kind; feat: request content type auto substitution
@js2me js2me linked an issue Feb 12, 2021 that may be closed by this pull request
@js2me js2me changed the title Next release Release 5.0.0 Feb 12, 2021
@js2me js2me linked an issue Feb 12, 2021 that may be closed by this pull request
@js2me js2me merged commit baf3814 into master Feb 12, 2021
then<TResult1 = ResolveType, TResult2 = never>(onfulfilled?: ((value: ResolveType) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: RejectType) => TResult2 | PromiseLike<TResult2>) | undefined | null): TPromise<TResult1 | TResult2, RejectType>;
catch<TResult = never>(onrejected?: ((reason: RejectType) => TResult | PromiseLike<TResult>) | undefined | null): TPromise<ResolveType | TResult, RejectType>;
}
<% } %>

export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes it hard to type responses in code that uses the HttpClient.
(For example when using this with the call method of redux-saga where you need to type the expected response yourself, since call uses any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants