1.2 KiB
1.2 KiB
Docker Module - Development Hints
smartrequest v5+ Migration (2025-11-17)
Breaking Change
smartrequest v5.0.0+ returns web ReadableStream objects (Web Streams API) instead of Node.js streams.
Solution Implemented
All streaming methods now convert web ReadableStreams to Node.js streams using:
plugins.smartstream.nodewebhelpers.convertWebReadableToNodeReadable(webStream)
Files Modified
-
ts/classes.host.ts:requestStreaming()- Converts web stream to Node.js stream before returninggetEventObservable()- Works with converted Node.js stream
-
ts/classes.image.ts:createFromTarStream()- Uses converted Node.js stream for event handlingexportToTarStream()- Uses converted Node.js stream for backpressure management
Testing
- Build: All 11 type errors resolved
- Tests: Node.js tests pass (DockerHost, DockerContainer, DockerImage, DockerImageStore)
Notes
- The conversion maintains backward compatibility with existing code expecting Node.js stream methods (
.on(),.emit(),.pause(),.resume()) - smartstream's
nodewebhelpersmodule provides bidirectional conversion utilities between web and Node.js streams