-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
Use Case
As a Developer
I want the driver to use the global WHATWG URLSearchParams class.
So that the driver relies on the standard web API available in all modern runtimes instead of the Node.js-specific url module.
User Experience
- Driver uses globalThis.URLSearchParams for connection string parsing.
Risks/Unknowns
Edge Cases: Node's implementation of url might handle specific edge cases (like + vs %20 encoding) differently than the strict WHATWG browser standard. We must ensure MongoDB connection string parsing rules are preserved.
Acceptance Criteria
Implementation Requirements
- Remove import: Remove require('url') usage for URLSearchParams.
- Usage: Replace new (require('url').URLSearchParams)(...) with new URLSearchParams(...).
- Compatibility: Ensure parsing behavior (handling of +, %20, etc.) matches expectations for connection strings.
Testing Requirements
- Connection string parsing tests (including spec tests) must pass using the global implementation.
- Verify node:url is not imported for parsing logic.
Documentation Requirements
- DOCSP ticket, API docs, etc
Follow Up Requirements
- additional tickets to file, required releases, etc
- if node behavior differs/will differ from other drivers, confirm with dbx devs what standard to aim for and what plan, if any, exists to reconcile the diverging behavior moving forward