Skip to content
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

[PROP]: Use request.js as our default way for any requests on the client side #9

Open
7 tasks
TNieminen opened this issue Aug 19, 2020 · 2 comments
Open
7 tasks
Labels
type:proposal Documentation change proposal

Comments

@TNieminen
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Request.js is an Axios powered module written some time ago to normalise our request patterns on the client side.
Things that the request.js provides:

  • Progress events as callback (back to requester)
  • A global page-level progress event inside a navbar container by passing only one boolean "globalProgress:true"
  • Validation of all the parameters passed into it
  • In-built API versioning support
  • In-built content and response type handling
  • Normalised response status handling
  • Normalised authorisation handling (this was the original motivation)

In addition if we at any point want to extend this further, we can always split it into for instance sub classes.
Also if we want to for whatever reason change axios to another module, we can do that without a major refactor.

Describe the solution you'd like

  • Add a section to styleguide to enforce this as the de-facto request module
  • Add examples of usage
@TNieminen
Copy link
Contributor Author

One possibility would be also to split this into "Akkadu_Components" as a installable module, this way we can also have versioning and maintain module specific in-detail documentation and just have a reference in the style guide.

@HoukasaurusRex
Copy link
Contributor

Might be too early to separate into an npm module until we can use it elsewhere, but this is a good direction and I'd support a request wrapper we use for all client side requests

@HoukasaurusRex HoukasaurusRex added the type:proposal Documentation change proposal label Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:proposal Documentation change proposal
Projects
None yet
Development

No branches or pull requests

2 participants