|
1 | 1 | # Changelog |
2 | 2 |
|
| 3 | +## 0.5.0 (2017-03-08) |
| 4 | + |
| 5 | +* Feature / BC break: Consistent `end` event semantics (EOF) |
| 6 | + (#70 by @clue) |
| 7 | + |
| 8 | + The `end` event will now only be emitted for a `successful` end, not it the |
| 9 | + stream closes due to an unrecoverable `error` event or if it is `close()`d |
| 10 | + explicitly. |
| 11 | + If you want to detect when the stream closes (terminates), use the `close` |
| 12 | + event instead. |
| 13 | + |
| 14 | +* BC break: Remove custom (undocumented) `full-drain` event from `Buffer` |
| 15 | + (#63 and #68 by @clue) |
| 16 | + |
| 17 | + > The `full-drain` event was undocumented and mostly used internally. |
| 18 | + Relying on this event has attracted some low-quality code in the past, so |
| 19 | + we've removed this from the public API in order to work out a better |
| 20 | + solution instead. |
| 21 | + If you want to detect when the buffer finishes flushing data to the stream, |
| 22 | + you may want to look into its `end()` method or the `close` event instead. |
| 23 | + |
| 24 | +* Feature / BC break: Consistent event semantics and documentation, |
| 25 | + explicitly state *when* events will be emitted and *which* arguments they |
| 26 | + receive. |
| 27 | + (#73 and #69 by @clue) |
| 28 | + |
| 29 | + The documentation now explicitly defines each event and its arguments. |
| 30 | + Custom events and event arguments are still supported. |
| 31 | + Most notably, all defined events only receive inherently required event |
| 32 | + arguments and no longer transmit the instance they are emitted on for |
| 33 | + consistency and performance reasons. |
| 34 | + |
| 35 | + ```php |
| 36 | + // old (inconsistent and not supported by all implementations) |
| 37 | + $stream->on('data', function ($data, $stream) { |
| 38 | + // process $data |
| 39 | + }); |
| 40 | + |
| 41 | + // new (consistent throughout the whole ecosystem) |
| 42 | + $stream->on('data', function ($data) use ($stream) { |
| 43 | + // process $data |
| 44 | + }); |
| 45 | + ``` |
| 46 | + |
| 47 | + > This mostly adds documentation (and thus some stricter, consistent |
| 48 | + definitions) for the existing behavior, it does NOT define any major |
| 49 | + changes otherwise. |
| 50 | + Most existing code should be compatible with these changes, unless |
| 51 | + it relied on some undocumented/unintended semantics. |
| 52 | + |
| 53 | +* Feature / BC break: Consistent method semantics and documentation |
| 54 | + (#72 by @clue) |
| 55 | + |
| 56 | + > This mostly adds documentation (and thus some stricter, consistent |
| 57 | + definitions) for the existing behavior, it does NOT define any major |
| 58 | + changes otherwise. |
| 59 | + Most existing code should be compatible with these changes, unless |
| 60 | + it relied on some undocumented/unintended semantics. |
| 61 | + |
| 62 | +* Feature: Consistent `pipe()` semantics for closed and closing streams |
| 63 | + (#71 from @clue) |
| 64 | + |
| 65 | + The source stream will now always be `pause()`d when the destination stream |
| 66 | + closes. Also, properly stop piping if the source stream closes and remove |
| 67 | + all event forwarding. |
| 68 | + |
| 69 | +* Improve test suite by adding PHPUnit to `require-dev` and improving coverage. |
| 70 | + (#74 and #75 by @clue, #66 by @nawarian) |
| 71 | + |
3 | 72 | ## 0.4.6 (2017-01-25) |
4 | 73 |
|
5 | 74 | * Feature: The `Buffer` can now be injected into the `Stream` (or be used standalone) |
|
0 commit comments