Refactor url.URLSearchParams to WHATWG URLSearchParams

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • 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?
    • None
    • None
    • None
    • None
    • None
    • 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

            Assignee:
            Unassigned
            Reporter:
            Sergey Zelenov
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: