caolan / caolan/highland

Highland v3.0.0

Open
#179 67 comments 0 reactions 0 assignees View on GitHub
3.x
Dominant language
JavaScript
Stars
3.4k
Forks
145
PR merge metrics
No merged PRs in 30d

Description

This issue tracks any changes we want for v3.0.0. See the 3.0.0 branch.

The biggest change for now is a reimplementation of the Highland engine. See the original PR at #175.
## Breaking changes
- Can no longer call `fork` after `consume`. Must call `fork` at the start.
- Can never `consume` a stream twice.
- The (undocumented) `stream.source` no longer exists.
- ~~`pipe` passes along errors if piping to a Highland stream instead of calling `this.emit('error')` (#166).~~
- ~~`wrapCallback` and stream constructor passes an array for the default mapping hint when there are more than one argument is passed to the callback (#247, #335).~~ See https://github.com/caolan/highland/issues/360#issue-99747182
- Renames and reargs (https://github.com/caolan/highland/issues/179#issuecomment-116208712)
- `zipAll` renamed to `zipEach`.
- `zipAll0` renamed to `zipAll`.
- `reduce` and `scan` argument order reversed
- `map` will now throw an error if the argument is not a function. The old behavior instead mapped all stream elements to the argument if it was not a function.
## Before release
- [x] Implement `onDestroy` (see #172)
- [x] Disable multiple `consumes` without a fork.
- [ ] Make sure all transforms correctly destroy their parent. Anything `consume`-based should get this for free, but not all transforms use `consume`. Maybe we should add a `createDownstream` method that does this for us.
- [ ] merge
- [ ] parallel
- [x] latest
- [ ] sequence
- [x] flatten
- [x] reduce/reduce1
- [x] scan/scan1
- [x] Create a test like `noValueOnError` to test the backpropagation behavior.
- [x] ~~Make `pipe` pass along errors to a Highland stream (#166).~~
- [x] Add a statement to the `pipe` docs pointing to `through` for the case when users want to pipe along errors as well as values to another Highland stream (https://github.com/caolan/highland/issues/179#issuecomment-125669798).
- [x] Remove `ConsumeStream` and `PipelineWrapperStream` (to make it easier to port #337).
- [x] `ConsumerStream`
- [x] `PipelineWrapperStream`
- [x] Port `use` (see #337).
- [x] Create a test like `noValueOnError` to test that core transforms always return an object of the appropriate extended type.
- [ ] Docs for `use`.
- [ ] ~~Fix default mapping hint behavior (#335).~~ Remove the note in the docs that say we are changing the default behavior.
- [x] Rename & reargs
- [x] `reduce` and `scan`
- [x] `zipAll` and `zipAll0`
- [x] `pickBy`
- [x] Make `map` throw an error if not given a function (#404).
- [x] Test that destroyed fork does not contribute backpressure (https://github.com/caolan/highland/issues/179#issuecomment-136904520)
- [ ] Create `highland-2` module for reverting the transform rename/reargs (https://github.com/caolan/highland/issues/179#issuecomment-116208712)
- [ ] Split `index.js` into `highland/core` and `highland/transforms`
- [x] Release the pending 2.x version.
- [ ] Merge 2.x into 3.0.0 once released.
## Nice to have but can be delayed until after release
- [x] Port over sync optimizations.
- [ ] Port over iterative `consume` and redirect.
- [ ] Check for memory leaks.
- [ ] Create some benchmarks.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the 3.0.0 branch and the original engine reimplementation PR at #175. The remaining work spans index.js, stream transforms, documentation, tests, memory leaks, and benchmarks, so select one unchecked checklist item and trace the related implementation first. Done means that item is implemented or verified and the relevant checklist entry is resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.