firefox-devtools / firefox-devtools/profiler-server
Change implementation of the Concatenator to make it look like more a stream
- Vorherrschende Sprache
- TypeScript
- Sterne
- 21
- Forks
- 15
- Ø Merge
- 9 Std. 23 Min.
- Gemergte PRs (30 T.)
- 8
Beschreibung
The Concatenator works by keeping all chunks in an array, and concatenating them all when the stream is ended. Then we keep and return this result when `transferContents` is called. The result is also cleared when the stream is destroy.
Node v14 now autodestroys stream by default when it ends.
The easy option is to force autoDestroy to true in the constructor.
A better option could be to output the result at the end like a stream, simply pushing the result of the concatenation. Possibly we would need to use objectMode for this too, so that node handles this result as one object instead of a big chunk. This would make the object more true to how streams work, and in the end more compatible with this mechanism in the long run.
┆Issue is synchronized with this [Jira Task](https://mozilla-hub.atlassian.net/browse/FP-985)
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginne damit, die Implementierung von Concatenator und die Aufrufer von transferContents zu lokalisieren. Lies, wie der Node-Stream erstellt, beendet, zerstört und konsumiert wird, und ermittle dann, welches vorgeschlagene Stream-Verhalten mit diesen Aufrufern kompatibel ist. Als abgeschlossen gilt die Aufgabe, wenn die Implementierung nicht mehr davon abhängt, das fertige Ergebnis nach der Zerstörung des Streams zu behalten, und weiterhin mit dem bestehenden transferContents-Ablauf kompatibel ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- backend
- Issue-Typ
- Refactoring
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100