meilisearch-js
meilisearch-js copied to clipboard
Improve `HttpRequests`
Pull Request
Sorry for the huge PR, but HttpRequests is core, and is used everywhere.
What does this PR do?
- completely refactors http-requests.ts
- fixes #1654
- request parameters are now simple and straight forward
- types are reworked and no longer confusing
- makes full use of URL, Headers and URLSearchParams web standard features, which are safer and easier to work with
- makes use of Private properties to hide internal implementation that should not be public (this is fairly widely supported and polyfillable)
- fixes some
EnqueuedTaskObjects not being converted toEnqueuedTask
[!CAUTION] BREAKING: From now on only some methods are public on
HttpRequests(get,post,put,patch,delete), the rest of the properties and methods are internal implementation details, and are not meant to be directly accessed.
PR checklist
Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?
Thank you so much for contributing to Meilisearch!