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

Move zlib usage under conditional path that requires it

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown 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?

      What is the feature/improvement you would like?

      The following APIs are promisified at the module scope of compression.ts

      Unable to find source-code formatter for language: typescript. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      const zlibInflate = promisify(zlib.inflate.bind(zlib));
      const zlibDeflate = promisify(zlib.deflate.bind(zlib));
      gunZipSync(...)
      

      But they could be moved into the code path that needs them.

      Saslprep

      Saslprep unzips code-point data upon importing using the gunZipSync API. We should at least nest the usage into the functions that need it (cache the result).

      Consider a follow-up or alternative to using zlib for salsprep so it can work in other JS environments.

      What use case would this feature/improvement enable?

      Moving the usage into the compression path that utilizes these APIs allows for one less module needing to exist in order to have a functioning driver.

            Assignee:
            Unassigned Unassigned
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: