deno_std icon indicating copy to clipboard operation
deno_std copied to clipboard

tracking: Deno streams to web streams conversion

Open crowlKats opened this issue 3 years ago • 10 comments

There is also the separate effort to replace any code that uses various deno ns classes that implement Deno.Reader & Deno.Writer that still uses the read & write functions over the readable & writable properties.

io

  • [x] buffer.ts

    • [x] Buffer (#1970)
    • [x] BufReader: replaced by ReadableStreamBYOBReader.read(, {atLeast})
    • [x] BufWriter: unnecessary (doesnt make much sense for web streams)
    • [x] readDelim: replaced by streams/delimiter.ts's DelimiterStream
    • [x] readStringDelim (#2006)
    • [x] readLines: replaced by streams/delimiter.ts's TextLineStream
  • [x] files.ts

    • [x] readRange replaced by streams/byte_slice_stream.ts's ByteSliceStream
  • [x] readers.ts

    • [x] StringReader: replaced by TextDecoderStream
    • [x] MultiReader: replaced by streams/merge.ts
    • [x] LimitedReader (#2007)
  • [x] util.ts Do we even want these?

    • [x] copyN
    • [x] readShort
    • [x] readInt
    • [x] readLong
  • [x] writers.ts unnecessary.

archive

  • [ ] tar (https://github.com/denoland/deno_std/pull/1985)

encoding

  • [x] binary.ts

    • [x] readExact: replaced by ReadableStreamBYOBReader.read(, {atLeast})
    • [x] getNBytes: unecessary
    • [x] readVarnum: doesnt this somewhat clash with io/util.ts functions?
    • [x] readVarbig
    • [x] writeVarnum
    • [x] writeVarbig
  • [x] csv.ts

    • [x] uses BufReader (#1993, #2491)

log

  • [x] handler.ts https://github.com/denoland/deno_std/pull/4021
    • [x] WriterHandler
    • [x] RotatingFileHandler

mime

  • [x] ~~multipart~~ mime was removed in #2336

textproto

not sure what to do with this one. Update: textproto is removed in #2757

please let me know if I missed any.

crowlKats avatar Mar 03 '22 06:03 crowlKats

I'll give readRange from files.ts a crack, if that's still something we want. I'm thinking RangedTransformStream.

Also, update:

  1. std/mime is deprecated
  2. std/textproto is deprecated
  3. Streams-based CSV parsing is implemented

iuioiua avatar Oct 10 '22 03:10 iuioiua

io

  • [x] buffer.ts

    • [x] Buffer (feat: streams based Buffer #1970)
    • [x] BufReader: replaced by ReadableStreamBYOBReader.read(, {atLeast})
    • [x] BufWriter: unnecessary (doesnt make much sense for web streams)
    • [x] readDelim: replaced by streams/delimiter.ts's DelimiterStream
    • [x] readStringDelim (feat(streams): TextDelimiterStream #2006)
    • [x] readLines: replaced by streams/delimiter.ts's TextLineStream

Is the Deno team in favour of deprecating these APIs?

iuioiua avatar Oct 12 '22 06:10 iuioiua

@crowlKats could you update this issue according to iuioiua's comment?

lino-levan avatar Dec 21 '22 17:12 lino-levan

CC @crowlKats

iuioiua avatar Jan 04 '23 19:01 iuioiua

@iuioiua this seems already to have been updated by @kt3k

crowlKats avatar Jan 04 '23 19:01 crowlKats

files.ts

  • [ ] readRange

This is done in streams/ByteSliceStream.

iuioiua avatar Jan 04 '23 19:01 iuioiua

Should we aim to have this issue complete by v1?

iuioiua avatar Jul 25 '23 03:07 iuioiua

That would be nice.

lino-levan avatar Jul 25 '23 03:07 lino-levan

Update: copyN(), readShort(), readInt() and readLong() are deprecated, and can be ticked off. This leaves std/archive and std/log.

iuioiua avatar Oct 25 '23 00:10 iuioiua

std/log has been addressed in https://github.com/denoland/deno_std/pull/4021

kt3k avatar Dec 28 '23 04:12 kt3k

Closing as this work has essentially been completed. The remaining work on @std/archive can be tracked in #1658. Thank you to all that helped!

iuioiua avatar Jul 19 '24 06:07 iuioiua