-
-
Notifications
You must be signed in to change notification settings - Fork 267
Break levelup into smaller packages #270
Comments
@rvagg, you are an absolute class act as a project maintainer / lead. 👑🎩🌟 |
👍 for factoring out read-stream Maybe another way to think about this is to take a use case and see what is the least possible amount of work to be done to make it work...instead of modularizing without knowing the absolute gain and use cases in need of that refactor. Taking the db.post.read(function(args){
var key = args[0];
var value = args[1][0];
var extra = args[1][1];
return [key, value, extra];
}); Basically hooks before and after each operation. |
Yes this would be great! In the new version level-sublevel still basically rewrites the LevelUP object, which is mostly about hmm, so maybe the _premethod returns gets to call leveldown, and then the callback isn't the user cb, but is one that calls the |
referencing #273 from here as I think it's part of this initiative edit thanks neonstalwart for fixing typo in this comment |
for overview i turned the bullet points in rod's post into checkboxes |
I ticked the "the logic for keeping track of the open/close state" /cc @juliangruber |
I think we have arrived at a point where we can say that this has been achieved, |
This is intended as a follow-up to the discussion in #255 where we have been unable to reach enough of a consensus to merge the proposed feature. The approach outlined in this issue has been suggested as something of a compromise and an attempt to provide the Dulcimer community with something useful without going against the fundamental ideas of LevelUP that some have stated as their main objection to the merge.
One major problem we are bumping up against is the inability to get at the deep insides of LevelUP itself. While we have obviously achieved a good API that is extensible, otherwise there wouldn't be such a vibrant ecosystem, we have extensibility problems at a deeper level, with too much logic tucked away internally with no means of accessing it.
Plus, LevelUP turns out to be too big for most of our tastes, even the fact that we have a lib directory is a warning sign. We're already removing WriteStream and opting for a user-lang pluggable mechanism, we should be able to take a similar approach with all of the components of LevelUP. If we modularise properly we can leave LevelUP as a simple glue between the main parts that form what we know of as LevelUP today but with the logic of each of those parts residing in self-contained, separately tested and documented packages. We can perform most of this work in the Level org too.
Some things this would enable:
Initial suggestion for package split-up:
Also a bunch of smaller things such as:
/NotFound/
matching stuff, which I have already re-implemented in other places myselfAnd doing a re-audit of the logic that is currently duplicated across levelup and abstract-leveldown, particularly the argument checking. In fact, an abstract-levelup might even be in order purely to define the levelup interface and provide a basic shell for it.
Discussion and humorous animated GIFs please.
The text was updated successfully, but these errors were encountered: