Accept `Blob`s anywhere where a `Buffer` is currently accepted for writing
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 122k
- Forks
- 37.3k
- Ø Merge
- 4 T. 2 Std.
- Gemergte PRs (30 T.)
- 283
Beschreibung
What is the problem this feature will solve?
Because Buffers aren't immutable, any time a Buffer is passed to something which will perform an asynchronous write, there is a concurrency hazard where the buffer could conceivably get modified before it gets a chance to be written. This can lead to bugs which are hard to track down. (I speak from experience.)
What is the feature you are proposing to solve the problem?
Anywhere where Buffer is currently accepted for a write operation, e.g. and perhaps most notably stream.Writable.write() and stream.Writable.end(), also make it acceptable to pass a Blob. Blobs are always immutable.
What alternatives have you considered?
Just keep using Buffers, mostly keep my fingers crossed, and sometimes make copies of Buffers as a safeguard.
(Note: It also makes sense to have a way to optionally have Blobs returned from readable streams, but I figure that'd be a different feature request.)
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit den Einstiegspunkten Node.js stream.Writable.write() und stream.Writable.end() und untersuche anschließend andere APIs, die derzeit Buffer für asynchrone Schreibvorgänge akzeptieren. Ermittle das erforderliche Blob-Verhalten und aktualisiere die relevante Implementierung, die Tests und die API-Dokumentation, sodass Blob-Eingaben konsistent akzeptiert werden, ohne das Rückgabeverhalten von readable-stream zu ändern.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- api, backend
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100