Liberate NestDB from the "binary-search-tree" dependency
Liberate NestDB from the binary-search-tree dependency by creating either a separate published module or a local module of the AVLTree.
Otherwise, we will forever be stuck with the outdated and unmaintained dependency on binary-search-tree, which depends on:
- the core
utilmodule, provided by browserify for the browser version- this module is pretty large and its usage can be easily replaced with the tiny
inheritsmodule from NPM
- this module is pretty large and its usage can be easily replaced with the tiny
- a very outdated (
~1.4.4) userlandunderscoremodule that it doesn't even USE!- this module should be moved to a devDependency (see PR https://github.com/louischatriot/node-binary-search-tree/pull/16) and, ideally, replaced with
lodash. Either action would then also allow us to replaceunderscorewithlodashin the main NestDB repo without incurring the bloat of having bothunderscoreandlodashpresent in the prebuilt browser version
- this module should be moved to a devDependency (see PR https://github.com/louischatriot/node-binary-search-tree/pull/16) and, ideally, replaced with
P.S. Doing this is part of offering full support for React Native: https://github.com/facebook/react-native/issues/526
Related nedb-core commit: https://github.com/nedbhq/nedb-core/commit/1049fc7e5384db693d008b236745436112ea8d2b
May want to consider alternative packages if they suit the needs, e.g.
- functional-red-black-tree
- Notably used by
eslintandmemdown
- Notably used by
- bintrees
- avl
- bbtree
If sticking with the implementation from binary-search-tree, then also incorporate the following open PRs from that project:
- https://github.com/louischatriot/node-binary-search-tree/pull/4
- https://github.com/louischatriot/node-binary-search-tree/pull/5
- https://github.com/louischatriot/node-binary-search-tree/pull/12
- https://github.com/louischatriot/node-binary-search-tree/pull/16
- Fixes existing issue https://github.com/louischatriot/node-binary-search-tree/issues/7
Perhaps consider addressing existing issue https://github.com/louischatriot/node-binary-search-tree/issues/14 by using inherits instead of util.inherits.