w3c / w3c/FileAPI

Refactor text() et al to share more infrastructure with Fetch

Open
#133 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
118
Forks
52
Avg merge
9d 16h
Merged PRs (30d)
1

Description

Andrea implemented these methods in Firefox and ended up using a shared abstraction with our code for Fetch.

If I look at https://fetch.spec.whatwg.org/#concept-body-consume-body and https://w3c.github.io/FileAPI/#text-method-algo side-by-side it seems quite doable to have less duplication here.

(We might want to point out the one major difference though, which is that File API will create an endless series of streams for the same underlying data where in Fetch that'd require explicit cloning.)

Contributor guide

Open the contributing guide

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

Read the Fetch “concept-body-consume-body” algorithm alongside the File API “text method algorithm” linked in the issue, starting with the shared steps and their stream-handling assumptions. The work is done when text() and related methods reuse more common infrastructure while preserving File API’s repeated-stream behavior rather than requiring explicit cloning.

Written by the indexing model from the issue text.

Assessment

Domain
api, web-dev
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.