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

[v4.x BACKPORT] Add Deno platform information to client metadata

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Unknown Unknown
    • 4.16.0
    • Affects Version/s: None
    • Component/s: None
    • 2
    • 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?

      Backport NODE-5188 to v4.x.

      Parent Ticket Description:

      Use Case

      Deno when running with Node.js compatibility will still report a client metadata platform that has "Node.js" and Node.js version information. Instead we can feature detect Deno and modify the platform information to be more accurate.

      User Impact

      • Client metadata is more accurate for the runtime executing the driver.

      Unknowns

      • Can we access Deno version information?
        • Yes, under Deno.version.deno
      • Can we access Bun version information?
        • Yes, under Bun.version

      Acceptance Criteria

      Implementation Requirements

      • if a Deno property exists on globalThis:
        • Change the platform to declare 'Deno' as the platform
        • Change the version information to deno's version info, if possible
      • if a Bun property exists on globalThis:
        • Change the platform to declare 'Bun' as the platform
        • Change the version information to bun's version info, if possible
      • When accessing version information ensure code is robust such that it won't fail but rather select a reasonable default.

      Testing Requirements

      • Unit test by adding a Deno global object

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            dbeng-pm-bot PM Bot
            Durran Jordan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: