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

Add compass:exports field to bson exports conditions

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • bson-5.0.1
    • Affects Version/s: None
    • Component/s: None
    • 0
    • Not Needed
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Use Case

      As a Compass Engineer
      I want to resolve the CJS module instead of ESM when bundling / resolving BSON imports
      So that I do not have to work around TLA and get the same BSON when the driver "requires" the CJS module.

      User Impact

      • None, this effects compass. It adds a custom export condition that we can hook into.

      Dependencies

      • None

      Unknowns

      • None

      Acceptance Criteria

      Implementation Requirements

      • Add a "compass:exports" field to the package.json "exports" conditions
      • point it's "default" field at the CJS module, and "types" at the definitions.

      Testing Requirements

      • Manually verify this unblocks compass

      Documentation Requirements

      • None

      Follow Up Requirements

      • Could this be a way to make our internal type definitions available to compass?
        • Maybe not, tsc would need to be told to look at that exports condition, something to consider

            Assignee:
            anna.henningsen@mongodb.com Anna Henningsen
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: