feat(http): add wip http client package #5

Open
Torthu wants to merge 60 commits from httpclient into main
Torthu commented 2025-02-25 09:25:14 +00:00 (Migrated from github.com)

Introducing HttpClient as a new package.

The HttpClient has three main features:

  1. Deduplicates HTTP requests - meaning if the same resource is requested with the same request it will only call fetch once.
  2. Built in abort - adds an AbortSignal and exposes a method for aborting fetch requests.
  3. Retry logic - supports retries out of the box - i.e try n times before rejecting the Promise.

Secondary features:

  1. Optional onTimeout, onAbort, onRetry callbacks to keep state on track.
Introducing HttpClient as a new package. The HttpClient has three main features: 1) Deduplicates HTTP requests - meaning if the same resource is requested with the same request it will only call fetch once. 2) Built in abort - adds an AbortSignal and exposes a method for aborting fetch requests. 3) Retry logic - supports retries out of the box - i.e try n times before rejecting the Promise. Secondary features: 1) Optional onTimeout, onAbort, onRetry callbacks to keep state on track.
This pull request has changes conflicting with the target branch.
  • package-lock.json
  • package.json
  • packages/broadcast/README.md
  • packages/broadcast/jest.config.js
  • packages/broadcast/package.json
  • packages/broadcast/test/Broadcast.spec.ts
  • packages/broadcast/tsconfig.json
  • packages/forms/package.json
  • packages/http/package.json
  • packages/http/src/HttpClient.ts
  • packages/http/src/index.ts
  • packages/http/src/types/FetchOptions.ts
  • packages/http/src/types/InFlight.ts
  • packages/http/src/types/Middleware.ts
  • packages/http/test/HttpClient.spec.ts
  • packages/http/tsconfig.json
  • packages/router/package.json
  • packages/store/README.md
  • packages/store/package.json
  • packages/store/src/Store.ts
  • packages/store/src/connectDevtools.ts
  • packages/store/src/index.ts
  • packages/store/src/types/index.ts
  • packages/store/src/useStore.ts
  • packages/store/src/utils/index.ts
  • packages/store/test/Store.spec.ts
  • packages/store/tsconfig.json
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin httpclient:httpclient
git switch httpclient

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff httpclient
git switch httpclient
git rebase main
git switch main
git merge --ff-only httpclient
git switch httpclient
git rebase main
git switch main
git merge --no-ff httpclient
git switch main
git merge --squash httpclient
git switch main
git merge --ff-only httpclient
git switch main
git merge httpclient
git push origin main
Sign in to join this conversation.
No description provided.