klaemo commented on code in PR #383:
URL: https://github.com/apache/couchdb-nano/pull/383#discussion_r4444957360


##########
README.md:
##########
@@ -229,19 +229,14 @@ const agentOptions = {
   connections: null,
   maxRedirections: 0
 }
-const undici = require('undici')
-const undiciOptions = new undici.Agent(agentOptions)
-const nano = Nano({ url: 'http://127.0.0.1:5984', undiciOptions })
+const { Agent, install } = require('undici')
+// use the installed Undici's fetch to avoid incompatibility with Node.js 
built-in
+install()

Review Comment:
   Correction on the HTTP/2 bit, I overstated it: it only affects `fetch` to 
HTTPS servers, not WebSocket/EventSource, and Node 26's built-in fetch already 
uses h2. In my tests `install()` switched fetch to h2 on Node 22, but on Node 
24 only if it ran before anything else touched `fetch`. That load-order 
dependence is one more reason I'd keep it out of the README.
   
   I also checked that `Dispatcher1Wrapper` handles more than GETs: JSON, 
Buffer, stream and form bodies plus streamed responses all work on 22/24/26.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to