Closed Soremwar closed 1 year ago
I think that would be a great addition. I would kindly ask to support this long-term as I have no experience with deno.
readable-stream is one of the most popular modules of the npm ecosystem, and it would indeed help in supporting both runtimes.
Well Deno isn't that different from Node in terms of syntaxis. As long as the tests for the Deno build keep passing, the only thing to watch out for are the typings for the public interfaces of the library. I'd be happy to offer that kind of support for as long as its needed, but I think it would be a really trivial work to do.
There are no types here.
Don't worry, I'll provide them. In fact I already have them
One question, how are the tests for the streams generated? Do you copy them from the Node repo and ensure they run here? Can they be modified to use (let's say) a different testing library other than Node's native one?
I think this was implemented on the Deno side.
One important feature that Deno's std library has is the NodeJS polyfill. This allows many third party libraries developed for Node to run in Deno without a lot of effort from developers in order to support both platforms. One great module missing from this compatibility layer however, is the Stream module. Even though I myself have put a lot of effort into making it work by porting it to native TypeScript code, I recognize the mantainability of that port is gonna be a concern in the future, and possible bug detection or modifications right now are based on trial and error mostly, due to the complexity handled by the internals of Streams
Luckily, thanks to some experimentation from @benjamingr and myself, we have determined that consuming
readable-stream
natively is indeed possible from Deno with a few thinkering to a bundle produced by esbuild and some minor changes to library code.If you all agree I'll start to work in adding this kind of support for Deno right away. Thank you for your efforts, I look forward to adding a "Deno compatible" badge in the front page of this library :)