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