|
| 1 | +| Title | Invert dependency of readable-stream | |
| 2 | +|--------|--------------------------------------| |
| 3 | +| Author | @mcollina | |
| 4 | +| Status | DRAFT | |
| 5 | +| Date | 2017-01-12 12:00:00 | |
| 6 | + |
| 7 | +## Description |
| 8 | + |
| 9 | +The `readable-stream` module is one of the most popular modules on NPM, |
| 10 | +with 33 million download per month. `readable-stream` is the basis of |
| 11 | +most of the ecosystem utilities for manipulating streams, as it provides |
| 12 | +a consistent API across all the different versions of Node.js and the |
| 13 | +browser: from Node.js v0.8, and IE 9 and Safari 5 as the oldest browsers. |
| 14 | + |
| 15 | +`readable-stream` is an export of the latest stream API from the Node.js, |
| 16 | +done via a mixture of babel transpiling and regular expressions. The export |
| 17 | +means that `readable-stream` has to follow the Node.js release cycle, and it |
| 18 | +is not versioned independently. Specifically, versioning of `readable-stream` |
| 19 | +is extremely hard, as *we are currently not bumping major* |
| 20 | +to avoid breaking many packages and maintaining multiple lines. The current |
| 21 | +situation is not ideal, as `readable-stream` passively follows what is merged |
| 22 | +in Node.js. |
| 23 | + |
| 24 | +At the moment `readable-stream` does not have its own documentation, it is the |
| 25 | +documentation of whichever version of Node.js is built from. This creates confusion, |
| 26 | +as the latest `stream` from Node.js supports some features that cannot be ported |
| 27 | +to all versions of Node.js. |
| 28 | + |
| 29 | +This EP proposes to invert that dependency, and have Node.js include |
| 30 | +readable-stream from the `deps` folder. |
| 31 | + |
| 32 | +## Process / Timeline |
| 33 | + |
| 34 | +1. move the code of streams into `readable-stream` |
| 35 | +2. amend the build script for the NPM/ecosystem build |
| 36 | +3. rewrite the tests to easily check against both the node |
| 37 | + source folder and old versions of Node.js and the browser. |
| 38 | +4. merge back all changes that happened in the meanwhile, and sync up |
| 39 | +5. add `nodejs/readable-stream` inside deps of Node.js, and remove the streams implementation |
| 40 | +6. bump *minor* version of `readable-stream` |
| 41 | + |
| 42 | +## Challenges |
| 43 | + |
| 44 | +1. export git history from node.js |
| 45 | +2. handling issues between the two repositories |
| 46 | +3. docs |
| 47 | + |
| 48 | +These challenges needs to be adressed with the rest of the node collaborators. |
| 49 | + |
| 50 | +## Target version of Node |
| 51 | + |
| 52 | +We think we should target this to be shipped in Node 8. |
0 commit comments