Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove start & end from range options #86

Closed
vweevers opened this issue Oct 20, 2019 · 4 comments
Closed

Remove start & end from range options #86

vweevers opened this issue Oct 20, 2019 · 4 comments
Labels
discussion Discussion semver-major Changes that break backward compatibility

Comments

@vweevers
Copy link
Member

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 (Level/abstract-leveldown#70) and tests don't cover it.

@vweevers vweevers added discussion Discussion semver-major Changes that break backward compatibility labels Oct 20, 2019
@juliangruber
Copy link
Member

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
Copy link
Member Author

@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
Copy link
Member

This will greatly simplify the leveldown C++ code.

vweevers added a commit to Level/abstract-leveldown that referenced this issue Apr 3, 2021
An error is now thrown when an iterator is created with one of these
options. Ref Level/community#86
vweevers added a commit to Level/codec that referenced this issue Apr 4, 2021
vweevers added a commit to Level/abstract-leveldown that referenced this issue Apr 9, 2021
An error is now thrown when an iterator is created with one of these
options. Ref Level/community#86
vweevers added a commit to Level/codec that referenced this issue Apr 9, 2021
@vweevers
Copy link
Member Author

vweevers commented Apr 9, 2021

Work is tracked in #98.

@vweevers vweevers closed this as completed Apr 9, 2021
vweevers added a commit to Level/leveldown that referenced this issue Apr 9, 2021
Removes legacy ranges options (Level/community#86).
vweevers added a commit to Level/memdown that referenced this issue Apr 10, 2021
vweevers added a commit to Level/leveldown that referenced this issue Apr 10, 2021
Removes legacy ranges options (Level/community#86).
vweevers added a commit to Level/rocksdb that referenced this issue Apr 17, 2021
Removes legacy ranges options (Level/community#86).

Cherry-picked from Level/leveldown@15d5a9e
vweevers added a commit to Level/level-rocksdb that referenced this issue Sep 12, 2021
vweevers added a commit to Level/subleveldown that referenced this issue Sep 25, 2021
- Removes legacy range options (Level/community#86)
- Drops legacy runtime environments (Level/community#98)
- In browsers, `process.nextTick()` has been replaced with
  `queue-microtask`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discussion semver-major Changes that break backward compatibility
Projects
None yet
Development

No branches or pull requests

3 participants