Level / community

Discussion, support and common information for projects in the community.
MIT License
42 stars 15 forks source link

Remove start & end from range options #86

Closed vweevers closed 3 years ago

vweevers commented 4 years ago

I propose that we remove the start and end options from iterators & streams. Without doing a soft deprecation, because they were documented as legacy options 5 years ago. I prefer ripping off the band aid and throwing an error if start or end properties are present in options.

@Level/core Anyone opposed? Give a thumbs up or down. Keep reading for the motivation.


The start/end options are more surprising in reverse mode. While ltgte options fulfill the documented promise of "the returned entries are the same, but in reverse", start/end options must be swapped by the user to achieve that.

The relevant code to handle the whole set of options - which I think in many implementations has been built up through trial & error, putting trust in the extensive tests - is hard to follow, and hard to change.

In addition, there are rules of precedence between start/end and ltgte although a formal decision was never made (https://github.com/Level/abstract-leveldown/issues/70) and tests don't cover it.

juliangruber commented 4 years ago

I would still favor a soft deprecation, so we don't surprise anyone, but if you want to go ahead and remove it right away that should work too I guess

vweevers commented 4 years ago

@juliangruber It'll be released as semver-major across the board, with the usual changelogs and upgrade guides. For the folks that missed both the 5-year-long documented notice and the upgrade guides, we'll throw an error. I think that's more than enough.

ralphtheninja commented 4 years ago

This will greatly simplify the leveldown C++ code.

vweevers commented 3 years ago

Work is tracked in https://github.com/Level/community/issues/98.