-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove pure JS (non native) io functions from Deno namespace #9795
Comments
Why move the types? They are referred to by other built ins that are returned, are they not? |
Buffer is also mentioned in #9588, we should maybe close that? |
Same reason as to move the functions. Code using
The builtins never explicitly return or take a reader/writer after these changes as far as i'm aware. They only return types that implement |
@lucacasonato in addition to that: would you be open to rename |
No. They are both in the process of being deprecated and will be removed. No reason to rename. |
I'm in agreement. It's very painful to let web streams (ReadableStream/WritableStream) win over go streams (Reader/Writer). Go streams is plainly more general and vastly simpler. But we must have web streams because of fetch. And having two different and incompatible stream abstractions is worse than having one shitty one. One of the original intentions of Deno was to correct the abysmal streams implementation in Node. I think Go provides a very elegant and complete solution with a beautiful library of combinations. |
We just have to hope that there will be a webstream2 at some point in the future that is based on go streams :/ |
Just to clarify, this issue was about a purely symbolic refactor to remove the explicit type definitions of Why @ry mentions above is the result of more recent discussion to remove even the concrete |
We're removing the usages of |
Perhaps, 2.0 is a good time to deprecate these interfaces. A counterargument is fast streams implementations are still in progress, and I wouldn't expect people to be happy with the deprecation unless the performance of the alternative was on par or better. |
What to do about |
There seem a few concerning points to this move:
|
sync behavior might be implemented as
|
Update: |
What do we think about this? Best to come to a decision before Deno v2. Related: |
All of these APIs are no longer available as of #25213 and Deno |
We'll be also moving |
I propose we remove the following APIs from the Deno namespace, and move them to std:
Types:
Deno.Reader
Deno.Writer
Deno.ReaderSync
Deno.WriterSync
Deno.Closer
Functions:
Deno.Buffer
(chore: deprecate Deno.Buffer and read/write utils #9793)Deno.copy
(chore(runtime): deprecateDeno.copy
#11369)Deno.iter
(chore: deprecate Deno.iter and Deno.iterSync #10025)Deno.iterSync
(chore: deprecate Deno.iter and Deno.iterSync #10025)Deno.readAll
(chore: deprecate Deno.Buffer and read/write utils #9793)Deno.readAllSync
(chore: deprecate Deno.Buffer and read/write utils #9793)Deno.writeAll
(chore: deprecate Deno.Buffer and read/write utils #9793)Deno.writeAllSync
(chore: deprecate Deno.Buffer and read/write utils #9793)Timeline
I suggest we mark all the APIs we want to remove with
@deprecated
, and add adeno lint
diagnostic for when these APIs are used. In Deno 2.0 we can then remove these APIs.Reasoning
Code which does not actually require native syscalls should not use
Deno
namespace APIs as this makes the code incompatible with browsers, even though there is no need for that to be the case. An example of this: https://deno.land/std@0.90.0/io/streams.ts. This usesDeno
APIs, even though no native calls are preformed, making this code unusable in a web browser for no good reason.The text was updated successfully, but these errors were encountered: