nestdb icon indicating copy to clipboard operation
nestdb copied to clipboard

Liberate NestDB from the "binary-search-tree" dependency

Open JamesMGreene opened this issue 8 years ago • 4 comments

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 util module, provided by browserify for the browser version
    • this module is pretty large and its usage can be easily replaced with the tiny inherits module from NPM
  • a very outdated (~1.4.4) userland underscore module 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 replace underscore with lodash in the main NestDB repo without incurring the bloat of having both underscore and lodash present in the prebuilt browser version

JamesMGreene avatar Aug 27 '17 14:08 JamesMGreene

P.S. Doing this is part of offering full support for React Native: https://github.com/facebook/react-native/issues/526

JamesMGreene avatar Aug 27 '17 15:08 JamesMGreene

Related nedb-core commit: https://github.com/nedbhq/nedb-core/commit/1049fc7e5384db693d008b236745436112ea8d2b

JamesMGreene avatar Aug 28 '17 02:08 JamesMGreene

May want to consider alternative packages if they suit the needs, e.g.

JamesMGreene avatar Sep 13 '17 16:09 JamesMGreene

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.

JamesMGreene avatar Sep 13 '17 19:09 JamesMGreene