refactor(deps)!: Remove duplexify
dependency + Revamp Stream Implementation
#2041
Labels
api: storage
Issues related to the googleapis/nodejs-storage API.
next major: breaking change
this is a change that we should wait to bundle into the next major version
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
web
Now that we've resolved the following:
pumpify
dependency #1915stream-events
dependency #1916We should remove duplexify. In all cases where it is used today, native Node.js Stream options, namely
Transform
, make more sense.Today Duplexify streams are passed around to too many functions and have lots of random ‘side effects’ to keep track of; leading issues that are difficult to debug. A refactor using native Node.js streams and pipelines will make things much more straightforward and would shrink the overall codebase. For example, we can trust the 'close' event more in native streams than in the duplexify implementation; namely in the cases of requests (duplexify streams 'close' before a 'response' is received).
This is a breaking change as
duplexify.Duplexify
is exposed as a return type in some public APIs.As an additional note, in the future we can move to the
Web Streams API
for web compatibility - moving to Node.js Streams first will make this step much easier as theReadable
,Writable
, andTransform
implementations are similar.The text was updated successfully, but these errors were encountered: