deno_std icon indicating copy to clipboard operation
deno_std copied to clipboard

suggestion: deprecate `writableStrategy` and `readableStrategy` argument properties for `std/json` constructors

Open iuioiua opened this issue 1 year ago • 6 comments

The TransformStreams in std/json are the only ones with writableStrategy and readableStrategy argument properties in their constructors. There are many other TransformStreams in the Standard Library, but none of them has these options, nor do they seem to need to. The std/json classes don't seem to be part of a special case either that justifies these properties. I think these options should be deprecated to trim needless moving parts.

iuioiua avatar Jan 05 '24 05:01 iuioiua

I feel these options can be useful when the users need to control the buffer amount at transform stream node (when downstream is slower than upstream).

@crowlKats @ayame113 What do you think?

kt3k avatar Jan 05 '24 08:01 kt3k

Perhaps. But I've yet to see demand for such functionality. If so, we should do this for all other TransformStreams in the Standard Library.

iuioiua avatar Jan 05 '24 08:01 iuioiua

What shall we do?

  1. Remove all strategy options for stream implementations. I suspect zero-little demand for this functionality, so this one has my vote.
  2. Ensure all streams have strategy options.

iuioiua avatar Jan 10 '24 02:01 iuioiua

Let's not decide right now, but let's keep this issue open for a while to see more thoughts/opinions

kt3k avatar Jan 10 '24 04:01 kt3k

@ayame113 and @crowlKats, WDYT?

iuioiua avatar Apr 10 '24 08:04 iuioiua

I am in favour

crowlKats avatar Apr 10 '24 08:04 crowlKats