Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-2997

Add ability to specify options dependencies programatically

    • Type: Icon: New Feature New Feature
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      Problem Description

      The Node.js driver uses

      try { require('...') } catch {}
      

      to load optional dependencies. That does not always play well with JS bundlers or other source code transformations, where `require()` may fall back to searching the filesystem instead of the bundle.

      It would be nice if the driver provided a way to pass in these dependencies programatically, leaving the actual `require()` call to its consumer.

      This could (for example) come in the form of options passed to the MongoClient constructor/connect method, or one or more global functions on the driver exports object itself for storing the modules.

            Assignee:
            Unassigned Unassigned
            Reporter:
            anna.henningsen@mongodb.com Anna Henningsen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: