unjs / unjs/node-mock-http

support abort `signal` for direct fetch util

Open
#9 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
17
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Describe the feature

See: https://github.com/nuxt/nuxt/issues/22684

We don't yet support AbortController meaning that the fetch created with createFetch does not have a way to cancel requests. This may be desirable, depending on the difficulty of implementing a signal, but I thought it would be worth tracking it all the same.

Additional information
  • Would you be willing to help implement this feature?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked implementation in unenv at src/runtime/fetch/index.ts, lines 6-34, and review the related Nuxt issue. Determine how the direct fetch created there should accept and respond to an AbortController signal; done means requests can be cancelled through that signal.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.