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

Remove custom httpClient #1824

Open
flevi29 opened this issue Jan 10, 2025 · 0 comments
Open

Remove custom httpClient #1824

flevi29 opened this issue Jan 10, 2025 · 0 comments
Labels
breaking-change The related changes are breaking for the users

Comments

@flevi29
Copy link
Collaborator

flevi29 commented Jan 10, 2025

fetch can be polyfilled, and that should be enough. httpClient just adds unnecessary complexity.

TODO: Better description

@flevi29 flevi29 added the breaking-change The related changes are breaking for the users label Jan 10, 2025
@flevi29 flevi29 mentioned this issue Jan 10, 2025
3 tasks
meili-bors bot added a commit that referenced this issue Mar 12, 2025
1741: Improve `HttpRequests` r=Strift a=flevi29

# 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](https://github.com/meilisearch/meilisearch-js/blob/main/src/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](https://developer.mozilla.org/en-US/docs/Web/API/URL), [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) and [URLSearchParams](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) web standard features, which are safer and easier to work with
  - makes use of [Private properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_properties) to hide internal implementation that should not be public (this is [widely supported](https://caniuse.com/mdn-javascript_classes_private_class_fields) and [polyfillable](https://babeljs.io/docs/babel-plugin-transform-private-methods))
- fixes some `EnqueuedTaskObject`s not being converted to `EnqueuedTask`

> [!CAUTION]
> #### BREAKING
> Rename `Config.requestConfig` -> `Config.requestInit`, `signal` can no longer be passed to it.

> [!WARNING]
> Deprecate `Config.httpClient` #1824 

## 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!


Co-authored-by: F. Levi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change The related changes are breaking for the users
Projects
None yet
Development

No branches or pull requests

1 participant